diff --git a/app/Controllers/EmployeeServiceController.php b/app/Controllers/EmployeeServiceController.php index 7d4d22c7..6d5e6a98 100755 --- a/app/Controllers/EmployeeServiceController.php +++ b/app/Controllers/EmployeeServiceController.php @@ -236,7 +236,9 @@ class EmployeeServiceController extends AdminController 'is_mandatory' => false, 'data_type' => 'str', 'format' => null, - 'allowed_values' => null + 'allowed_values' => null, + 'custom' => 'check_dup_email', + 'params' => ['row', 'existing_mobilenos'] ], 'pre_existing_ailments' => [ 'col_idx' => 14, @@ -2029,7 +2031,7 @@ public function getFileMetaDataByFileId($file_id, $status = 'success'){ $value['family_floater_key'] = $relation; $policy_data['basic_cover_si'] = $row[9]; - $policy_data['date_coverage'] = $row[13] != "" && $row[13] != null ? change_date_format($row[13],'d-M-Y','Y-m-d') : null; + $policy_data['date_coverage'] = $row[13] != "" && $row[13] != null ? change_date_format($row[13],null,'Y-m-d') : null; $policy_data['client_policy_id'] = $file['policy_id']; $employee = $this->employeeModel->checkExistingEmployee($value,$file['client_branch_id']); diff --git a/app/Helpers/excel_util_helper.php b/app/Helpers/excel_util_helper.php index 76cf51a3..d1fdf7d2 100755 --- a/app/Helpers/excel_util_helper.php +++ b/app/Helpers/excel_util_helper.php @@ -1726,6 +1726,21 @@ if(!function_exists('check_dup_mobileno')) } } +if(!function_exists('check_dup_email')) +{ + function check_dup_email(array $row,array $existing_mobilenos) + { + foreach($existing_mobilenos as $k => $value) + { + if ($row['13'] == $value['email_corporate']) { + return array('status' => false,'error' => "Duplicate Email"); + // break; + } + } + return array('status' => true); + } +} + if(!function_exists('generate_family_relationship_array')) { function generate_family_relationship_array($family_structure_from_policy_terms) {