MERGE_UAT_LIVE_ISSEUS

This commit is contained in:
Ubuntu 2026-05-11 12:08:07 +05:30
commit 5fa3553b2d
8 changed files with 75 additions and 28 deletions

View File

@ -518,7 +518,7 @@ class ApiServiceController extends BaseController
$userParams['phone'] = $row['phone'];
$userParams['email'] = $row['email'];
$userParams['relationship'] = $row['relation'];
$userParams['gender'] = $row['gender'];
$userParams['gender'] = $row['gender'] == 'M' ? 'Male' : 'Female';
$userParams['dob'] = $row['dob'];
$userParams['policyNumber'] = $row['policyNumber'];
$userParams['policyStartDate'] = $row['policyStartDate'];

View File

@ -3852,7 +3852,7 @@ class EmployeeController extends AdminController
foreach ($families as $empCode => $members) {
$familiesPayload[$empCode] = $this->buildFamilyPayload($empCode, $members);
}
log_message('error', "[WellnessOnboard] Page {$page} API calls done. Families processed: " . json_encode($familiesPayload));
// ----------------------------------------------------------------
// 5. SEND TO WELLNESS API
// ----------------------------------------------------------------

View File

@ -227,7 +227,7 @@ class EmployeeMultiEventServiceController extends BaseController
'format' => 'mobile',
'allowed_values' => null,
'custom' => 'check_dup_mobileno',
'params' => ['row', 'existing_mobilenos']
'params' => ['row', 'existing_mobilenos', 'excel_data', 'row_key']
],
'email' => [
'col_idx' => 13,

View File

@ -230,7 +230,7 @@ class EmployeeServiceController extends AdminController
'format' => 'mobile',
'allowed_values' => null,
'custom' => 'check_dup_mobileno',
'params' => ['row', 'existing_mobilenos']
'params' => ['row', 'existing_mobilenos', 'excel_data', 'row_key']
],
'email' => [
'col_idx' => 13,

View File

@ -1162,28 +1162,28 @@ class TicketController extends BaseController
// --- EMPLOYEE DETAILS ---
'emp_code' => [
'label' => 'Employee ID',
'rules' => 'required|min_length[2]|max_length[20]|regex_match[/^[a-zA-Z0-9_-]+$/]',
'rules' => 'required|min_length[2]|max_length[20]|regex_match[/^[a-zA-Z0-9\s\/_-]+$/]',
'errors' => [
'required' => 'Employee ID is required.',
'regex_match' => 'Employee ID cannot contain spaces or special characters (only letters, numbers, hyphens and underscores. allowed).'
'regex_match' => 'Employee ID can only contain letters, numbers, spaces, slashes (/), hyphens (-) and underscores (_).'
]
],
'emp_name' => [
'label' => 'Employee Name',
'rules' => 'required|min_length[3]|regex_match[/^[a-zA-Z0-9\s_-]+$/]',
'rules' => 'required|min_length[3]|regex_match[/^[a-zA-Z0-9\s\/_-]+$/]',
'errors' => [
'required' => 'Employee Name is required',
'min_length' => 'Employee Name must be at least 3 characters long',
'regex_match' => 'Employee Name can only contain letters, numbers, spaces, hyphens, and underscores.'
'regex_match' => 'Employee Name can only contain letters, numbers, spaces, slashes (/), hyphens (-), and underscores (_).'
]
],
'insured_name' => [
'label' => 'Insured Name',
'rules' => 'required|min_length[3]|regex_match[/^[a-zA-Z0-9\s_-]+$/]',
'rules' => 'required|min_length[3]|regex_match[/^[a-zA-Z0-9\s\/_-]+$/]',
'errors' => [
'required' => 'Insured Name is required',
'min_length' => 'Insured Name must be at least 3 characters long',
'regex_match' => 'Insured Name can only contain letters, numbers, spaces, hyphens, and underscores.'
'regex_match' => 'Insured Name can only contain letters, numbers, spaces, slashes (/), hyphens (-), and underscores (_).'
]
],
'relationship' => ['label' => 'Relationship','rules' => 'required',
@ -1393,19 +1393,19 @@ class TicketController extends BaseController
// --- EMPLOYEE DETAILS ---
'emp_code' => [
'label' => 'Employee ID',
'rules' => 'required|min_length[2]|max_length[20]|regex_match[/^[a-zA-Z0-9_-]+$/]',
'rules' => 'required|min_length[2]|max_length[20]|regex_match[/^[a-zA-Z0-9\s\/_-]+$/]',
'errors' => [
'required' => 'Employee ID is required.',
'regex_match' => 'Employee ID cannot contain spaces or special characters (only letters, numbers, hyphens and underscores. allowed).',
'regex_match' => 'Employee ID can only contain letters, numbers, spaces, slashes (/), hyphens (-) and underscores (_).',
]
],
'emp_name' => [
'label' => 'Employee Name',
'rules' => 'required|min_length[3]|regex_match[/^[a-zA-Z0-9\s_-]+$/]',
'rules' => 'required|min_length[3]|regex_match[/^[a-zA-Z0-9\s\/_-]+$/]',
'errors' => [
'required' => 'Employee Name is required',
'min_length' => 'Employee Name must be at least 3 characters long',
'regex_match' => 'Employee Name can only contain letters, numbers, spaces, hyphens, and underscores.'
'regex_match' => 'Employee Name can only contain letters, numbers, spaces, slashes (/), hyphens (-), and underscores (_).'
]
],
'emp_mobile' => ['label' => 'Employee Mobile No','rules' => 'required|numeric|exact_length[10]',
@ -1650,28 +1650,28 @@ class TicketController extends BaseController
// --- EMPLOYEE DETAILS ---
'emp_code' => [
'label' => 'Employee ID',
'rules' => 'required|min_length[2]|max_length[20]|regex_match[/^[a-zA-Z0-9_-]+$/]',
'rules' => 'required|min_length[2]|max_length[20]|regex_match[/^[a-zA-Z0-9\s\/_-]+$/]',
'errors' => [
'required' => 'Employee ID is required.',
'regex_match' => 'Employee ID cannot contain spaces or special characters (only letters, numbers, hyphens and underscores. allowed).',
'regex_match' => 'Employee ID can only contain letters, numbers, spaces, slashes (/), hyphens (-) and underscores (_).',
]
],
'emp_name' => [
'label' => 'Employee Name',
'rules' => 'required|min_length[3]|regex_match[/^[a-zA-Z0-9\s_-]+$/]',
'rules' => 'required|min_length[3]|regex_match[/^[a-zA-Z0-9\s\/_-]+$/]',
'errors' => [
'required' => 'Employee Name is required',
'min_length' => 'Employee Name must be at least 3 characters long',
'regex_match' => 'Employee Name can only contain letters, numbers, spaces, hyphens, and underscores.'
'regex_match' => 'Employee Name can only contain letters, numbers, spaces, slashes (/), hyphens (-), and underscores (_).'
]
],
'insured_name' => [
'label' => 'Insured Name',
'rules' => 'required|min_length[3]|regex_match[/^[a-zA-Z0-9\s_-]+$/]',
'rules' => 'required|min_length[3]|regex_match[/^[a-zA-Z0-9\s\/_-]+$/]',
'errors' => [
'required' => 'Insured Name is required',
'min_length' => 'Insured Name must be at least 3 characters long',
'regex_match' => 'Insured Name can only contain letters, numbers, spaces, hyphens, and underscores.'
'regex_match' => 'Insured Name can only contain letters, numbers, spaces, slashes (/), hyphens (-), and underscores (_).'
]
],
'relationship' => ['label' => 'Relationship','rules' => 'required',
@ -1882,19 +1882,19 @@ class TicketController extends BaseController
// --- EMPLOYEE DETAILS ---
'emp_code' => [
'label' => 'Employee ID',
'rules' => 'required|min_length[2]|max_length[20]|regex_match[/^[a-zA-Z0-9_-]+$/]',
'rules' => 'required|min_length[2]|max_length[20]|regex_match[/^[a-zA-Z0-9\s\/_-]+$/]',
'errors' => [
'required' => 'Employee ID is required.',
'regex_match' => 'Employee ID cannot contain spaces or special characters (only letters, numbers, hyphens and underscores. allowed).',
'regex_match' => 'Employee ID can only contain letters, numbers, spaces, slashes (/), hyphens (-) and underscores (_).',
]
],
'emp_name' => [
'label' => 'Employee Name',
'rules' => 'required|min_length[3]|regex_match[/^[a-zA-Z0-9\s_-]+$/]',
'rules' => 'required|min_length[3]|regex_match[/^[a-zA-Z0-9\s\/_-]+$/]',
'errors' => [
'required' => 'Employee Name is required',
'min_length' => 'Employee Name must be at least 3 characters long',
'regex_match' => 'Employee Name can only contain letters, numbers, spaces, hyphens, and underscores.'
'regex_match' => 'Employee Name can only contain letters, numbers, spaces, slashes (/), hyphens (-), and underscores (_).'
]
],
'emp_mobile' => ['label' => 'Employee Mobile No','rules' => 'required|numeric|exact_length[10]',

View File

@ -2107,8 +2107,8 @@ if (!function_exists('remap_default_age_ratio_into_relationship')) {
}
}
if (!function_exists('check_dup_mobileno')) {
function check_dup_mobileno(array $row, array $existing_mobilenos)
if (!function_exists('check_dup_mobileno_old')) {
function check_dup_mobileno_old(array $row, array $existing_mobilenos)
{
if(!empty($row['12'])){
foreach ($existing_mobilenos as $k => $value) {
@ -2122,6 +2122,41 @@ if (!function_exists('check_dup_mobileno')) {
}
}
if (!function_exists('check_dup_mobileno')) {
function check_dup_mobileno(array $row, array $existing_mobilenos, $excel_data = [], $row_key = null)
{
if(!empty($row['12'])){
$current_relation = strtolower(trim($row['5'] ?? ''));
$current_mobile = trim((string) $row['12']);
foreach ($existing_mobilenos as $k => $value) {
if ($current_relation == 'self' && $current_mobile == trim((string) ($value['mobile'] ?? ''))) {
return array('status' => false, 'error' => "Duplicate Mobile No");
// break;
}
}
foreach ($excel_data as $ed_row => $value) {
if ($row_key !== null && (string) $ed_row === (string) $row_key) {
continue;
}
$excel_relation = strtolower(trim($value['5'] ?? ''));
$excel_mobile = trim((string) ($value['12'] ?? ''));
if ($current_relation == 'self' && $excel_relation == 'self' && $excel_mobile !== '' && $current_mobile == $excel_mobile) {
$duplicate_row_no = is_numeric($ed_row) ? $ed_row + 1 : $ed_row;
$current_row_no = is_numeric($row_key) ? $row_key + 1 : $row_key;
return array('status' => false, 'error' => "This mobile number has already been used for another self in Excel at row no. " . ($duplicate_row_no) . " and " . ($current_row_no));
// break;
}
}
}
return array('status' => true);
}
}
// if (!function_exists('check_dup_email')) {
// function check_dup_email(array $row, array $existing_mobilenos)
// {

View File

@ -298,6 +298,7 @@ $fl_col_width_px = nhance_dt_column_widths_px($fl_header_labels, $fl_col_max_len
</div>
<div class="modal-body">
<form class="parsley-examples" id="uploadForm" action="<?php echo base_url() . 'employee/upload' ?>"
method="post"
enctype="multipart/form-data">
<input type="hidden" id="file_client_id" name="client_id">
<input type="hidden" id="file_policy_id" name="policy_id">
@ -537,12 +538,14 @@ $fl_col_width_px = nhance_dt_column_widths_px($fl_header_labels, $fl_col_max_len
}
}
$('#uploadForm').submit(function() {
$('#uploadForm').submit(function(event) {
event.preventDefault();
var isValid = $('#uploadForm').parsley().validate();
if (!isValid) {
console.log('Form is Empty', 'Warning');
return;
return false;
}
// Create FormData object
@ -595,6 +598,8 @@ $fl_col_width_px = nhance_dt_column_widths_px($fl_header_labels, $fl_col_max_len
window.location.reload(true);
}
});
return false;
})
$('body').on('click', '.reload', function() {

View File

@ -1358,10 +1358,17 @@
toastr.error(response.message || 'Unable to fetch data', 'Error');
}
setTimeout(function() {
window.location.reload();
}, 500);
}, function(xhr, status, error) {
console.error('Error fetching data:', error);
console.error(xhr.responseText);
toastr.error('An error occurred while fetching TPA ID.', 'Error');
setTimeout(function() {
window.location.reload();
}, 500);
});