diff --git a/app/Controllers/EmployeeMultiEventServiceController.php b/app/Controllers/EmployeeMultiEventServiceController.php index 589e9efe..52b703ae 100644 --- a/app/Controllers/EmployeeMultiEventServiceController.php +++ b/app/Controllers/EmployeeMultiEventServiceController.php @@ -1997,7 +1997,8 @@ class EmployeeMultiEventServiceController extends BaseController $endorsement = function ($data, $file, $row) use ($insurer) { $group_key = rand(100000, 999999); - $row[4] = change_date_format($row[4], 'd-M-Y', 'Y-m-d'); // date of exit from excel + // Multi-event sheets often send Y-m-d; standalone deletion uses d-M-Y. Auto-detect both. + $row[4] = change_date_format($row[4], null, 'Y-m-d'); // date of exit from excel // Kint::dump($row[4]); // check if insurer configured with add one day for deletion // if($insurer['deletion_add_day'] == true) diff --git a/app/Controllers/MasterController.php b/app/Controllers/MasterController.php index f4ea0e39..36253252 100755 --- a/app/Controllers/MasterController.php +++ b/app/Controllers/MasterController.php @@ -227,6 +227,7 @@ class MasterController extends AdminController 'Date of Exit' => 'dateofexit', 'Reason for Exit' => 'reasonforexit', 'Status' => 'status', + 'Claim Status' => 'claimstatus', 'Old Basic Cover SI' => 'old_basic_cover_si', 'Old SI Premium' => 'old_si_premium', 'New Basic Cover SI' => 'new_basic_cover_si', diff --git a/app/Controllers/VidalApiController.php b/app/Controllers/VidalApiController.php index 5b4c51af..84fbc45d 100644 --- a/app/Controllers/VidalApiController.php +++ b/app/Controllers/VidalApiController.php @@ -830,6 +830,7 @@ class VidalApiController extends BaseController } log_message('error', "VIDAL - TPA ID Pull | called for policy_no: {$policyNo} , client_policy_id: {$client_policy_id}"); + log_message('error', "VIDAL - TPA ID Pull | Api Headers and Body ".json_encode(['url' => $url, 'method' => $method, 'headers' => $headers])); // Fetch file download dates $batchFiles = $this->db->table('batch_files f') @@ -910,11 +911,13 @@ class VidalApiController extends BaseController $fetchedCount = count($data['dependents']); log_message('error', "VIDAL - TPA ID Pull | Fetched {$fetchedCount} records "); + // log_message('error', "VIDAL - TPA ID Pull | Response Data ".json_encode($response)); $allBenef = array_merge($allBenef, $data['dependents']); } - // dd($allBenef ); + + // log_message('error', "VIDAL - TPA ID Pull | All Benef Data ".json_encode($allBenef)); //save API data as JSON for analysis $json = json_encode($allBenef, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); diff --git a/app/Models/EmployeePolicyModel.php b/app/Models/EmployeePolicyModel.php index 1ffaf8d0..6e3d70ee 100755 --- a/app/Models/EmployeePolicyModel.php +++ b/app/Models/EmployeePolicyModel.php @@ -435,6 +435,14 @@ class EmployeePolicyModel extends Model and is_active = 1 limit 1 ) as self_employee_id', + '( + select name from employees + where emp_code = emp.emp_code + and client_id = emp.client_id + and lower(relationship) = "self" + and is_active = 1 + limit 1 + ) as self_name', $ecard_download_link ]) ->join('employees emp', 'employee_polices.employee_id = emp.id') diff --git a/app/Views/file_list.php b/app/Views/file_list.php index 95633200..ccee91c9 100755 --- a/app/Views/file_list.php +++ b/app/Views/file_list.php @@ -369,7 +369,9 @@ $fl_col_width_px = nhance_dt_column_widths_px($fl_header_labels, $fl_col_max_len } $('#title_header_name').html(title); + destroyEmpUploadListDataTable(); $('#emp_data_success').html(res.data); + initEmpUploadListDataTable(); }, error: function(xhr, status, error) { console.error(xhr.responseText); @@ -385,6 +387,82 @@ $fl_col_width_px = nhance_dt_column_widths_px($fl_header_labels, $fl_col_max_len }) + function destroyEmpUploadListDataTable() { + if ($.fn.DataTable && $.fn.DataTable.isDataTable('#tech-companies-1')) { + $('#tech-companies-1').DataTable().clear().destroy(); + } + } + + function initEmpUploadListDataTable() { + var $table = $('#tech-companies-1'); + if (!$table.length || !$.fn.DataTable) { + return; + } + + destroyEmpUploadListDataTable(); + + if (typeof nhanceListDataTableBeforeInit === 'function') { + nhanceListDataTableBeforeInit(); + } + + var dtOptions = { + ordering: true, + searching: true, + paging: true, + pageLength: 10, + order: [[0, 'asc']], + autoWidth: false, + scrollX: false, + scrollY: false, + scrollCollapse: false, + sScrollX: '', + sScrollY: '', + sScrollXInner: '', + bScrollCollapse: false, + responsive: false, + language: { + paginate: { + first: 'First', + last: 'Last', + next: 'Next', + previous: 'Previous' + } + } + }; + + var empUploadTable = typeof nhanceMergeListDataTableOptions === 'function' + ? $table.DataTable(nhanceMergeListDataTableOptions(dtOptions)) + : $table.DataTable(dtOptions); + + if (typeof nhanceListDataTableAfterInit === 'function') { + nhanceListDataTableAfterInit(); + } + if (typeof nhanceListDataTableBindAdjust === 'function') { + nhanceListDataTableBindAdjust(empUploadTable); + } + + // Modal is often still animating when HTML is injected — re-measure after shown + $('#full-width-modal-emp-list') + .off('shown.bs.modal.empUploadList') + .on('shown.bs.modal.empUploadList', function () { + if ($.fn.DataTable.isDataTable('#tech-companies-1')) { + $('#tech-companies-1').DataTable().columns.adjust(); + } + }); + + setTimeout(function () { + if ($.fn.DataTable.isDataTable('#tech-companies-1')) { + $('#tech-companies-1').DataTable().columns.adjust(); + } + }, 0); + } + + $('#full-width-modal-emp-list').on('hidden.bs.modal', function () { + destroyEmpUploadListDataTable(); + $('#emp_data_success').empty(); + }); + + $('body').on('click', '.upload_button', function() { $('#uploadForm')[0].reset(); diff --git a/app/Views/view_file_upload_emp_list.php b/app/Views/view_file_upload_emp_list.php index aab97b08..d1f33fef 100755 --- a/app/Views/view_file_upload_emp_list.php +++ b/app/Views/view_file_upload_emp_list.php @@ -1,70 +1,59 @@ - -
-
-
- - - - - - - - - - - - - - - +
+
+ + + + + + + + + + + + - -
-
- -
-
- - - \ No newline at end of file + + + + +