From 9f522ff8ccd420a875534031e74a880fed295053 Mon Sep 17 00:00:00 2001 From: Venkatesh Date: Mon, 4 May 2026 15:12:59 +0530 Subject: [PATCH] FIX_FHPL_FETCH_TPA_MISS_MATCH_KEY --- app/Controllers/FhplApiController.php | 37 +++++++++++-------- app/Views/employee_data_list.php | 2 +- app/Views/insurer_or_tpa_data.php | 2 +- app/Views/leads_form_handler.php | 2 +- .../policy_transaction_inception_form.php | 4 +- .../policy_transaction_inception_form_2.php | 4 +- app/Views/view_rfq.php | 2 +- app/Views/view_rfq_non_eb_new.php | 2 +- 8 files changed, 30 insertions(+), 25 deletions(-) diff --git a/app/Controllers/FhplApiController.php b/app/Controllers/FhplApiController.php index d941c757..ab31d7c3 100644 --- a/app/Controllers/FhplApiController.php +++ b/app/Controllers/FhplApiController.php @@ -530,12 +530,19 @@ class FhplApiController extends BaseController $employeePolicyModel = new EmployeePolicyModel(); $employeePolicyData = $employeePolicyModel + ->select(' + employees.*, + employee_polices.id as emp_policy_id, + employee_polices.client_policy_id, + ') ->join('employees', 'employees.id = employee_polices.employee_id') ->where('employee_polices.client_policy_id', $client_policy_id) ->where('employee_polices.tpa_id IS NULL') ->findAll(); $updated = 0; + $employee_policy_ids = []; + $batch_file_success = 'success'; foreach ($employeePolicyData as $policy) { $hasMatchForThisPolicy = false; @@ -566,24 +573,22 @@ class FhplApiController extends BaseController } } } - } - // Handle NO MATCH for this policy - if (!$hasMatchForThisPolicy) { + if (!$hasMatchForThisPolicy) { + $nhanceSideData = [ + 'name' => $policy['name'] ?? null, + 'emp_code' => $policy['emp_code'] ?? null, + 'relationship' => $policy['relationship'] ?? null, + 'gender' => $policy['gender'] ?? null, + 'dob' => $policy['dob'] ?? null, + ]; + $batch_file_success = 'partially success'; - $nhanceSideData = [ - 'name' => $policy_data['name'] ?? null, - 'emp_code' => $policy_data['emp_code'] ?? null, - 'relationship' => $policy_data['relationship'] ?? null, - 'gender' => $policy_data['gender'] ?? null, - 'dob' => $policy_data['dob'] ?? null, - ]; - $batch_file_success = 'partially success'; - - log_message( - 'error', - "FHPL - TPA ID Pull No match for Nhance = " . json_encode($nhanceSideData) - ); + log_message( + 'error', + "FHPL - TPA ID Pull No match for Nhance = " . json_encode($nhanceSideData) + ); + } } // send e-card diff --git a/app/Views/employee_data_list.php b/app/Views/employee_data_list.php index 15df09cf..9097d532 100755 --- a/app/Views/employee_data_list.php +++ b/app/Views/employee_data_list.php @@ -976,7 +976,7 @@ $gst_total = 0; }, function(xhr, status, error) { console.error('Error fetching data:', error); console.error(xhr.responseText); - toastr.error('An error occurred while checking the CD amount.', 'Error'); + toastr.error('An error occurred while fetching e-card.', 'Error'); }); diff --git a/app/Views/insurer_or_tpa_data.php b/app/Views/insurer_or_tpa_data.php index 79ef31df..da28ff61 100755 --- a/app/Views/insurer_or_tpa_data.php +++ b/app/Views/insurer_or_tpa_data.php @@ -1361,7 +1361,7 @@ }, function(xhr, status, error) { console.error('Error fetching data:', error); console.error(xhr.responseText); - toastr.error('An error occurred while checking the CD amount.', 'Error'); + toastr.error('An error occurred while fetching TPA ID.', 'Error'); }); diff --git a/app/Views/leads_form_handler.php b/app/Views/leads_form_handler.php index 919b88e8..0f19fa24 100644 --- a/app/Views/leads_form_handler.php +++ b/app/Views/leads_form_handler.php @@ -733,7 +733,7 @@ if (isset($selected_lead_type)) { $('.loader-mask').delay(350).fadeOut('slow'); console.error('Error fetching data:', error); console.error(xhr.responseText); - toastr.error('An error occurred while checking the CD amount.', 'Error'); + toastr.error('An error occurred while removing the file.', 'Error'); }); }else{ diff --git a/app/Views/policy_transaction_inception_form.php b/app/Views/policy_transaction_inception_form.php index 403a1fb4..6e6a988a 100644 --- a/app/Views/policy_transaction_inception_form.php +++ b/app/Views/policy_transaction_inception_form.php @@ -6185,7 +6185,7 @@ }, function(xhr, status, error) { console.error('Error fetching data:', error); console.error(xhr.responseText); - toastr.error('An error occurred while checking the CD amount.', 'Error'); + toastr.error('An error occurred while creating the vehicle.', 'Error'); $('.loader').fadeOut(); $('.loader-mask').delay(350).fadeOut('slow'); }); @@ -6251,7 +6251,7 @@ }, function(xhr, status, error) { console.error('Error fetching data:', error); console.error(xhr.responseText); - toastr.error('An error occurred while checking the CD amount.', 'Error'); + toastr.error('An error occurred while creating the client.', 'Error'); $('.loader').fadeOut(); $('.loader-mask').delay(350).fadeOut('slow'); diff --git a/app/Views/policy_transaction_inception_form_2.php b/app/Views/policy_transaction_inception_form_2.php index a37a607f..8cf18e05 100644 --- a/app/Views/policy_transaction_inception_form_2.php +++ b/app/Views/policy_transaction_inception_form_2.php @@ -5842,7 +5842,7 @@ }, function(xhr, status, error) { console.error('Error fetching data:', error); console.error(xhr.responseText); - toastr.error('An error occurred while checking the CD amount.', 'Error'); + toastr.error('An error occurred while creating the vehicle.', 'Error'); $('.loader').fadeOut(); $('.loader-mask').delay(350).fadeOut('slow'); }); @@ -5908,7 +5908,7 @@ }, function(xhr, status, error) { console.error('Error fetching data:', error); console.error(xhr.responseText); - toastr.error('An error occurred while checking the CD amount.', 'Error'); + toastr.error('An error occurred while createing the client.', 'Error'); $('.loader').fadeOut(); $('.loader-mask').delay(350).fadeOut('slow'); diff --git a/app/Views/view_rfq.php b/app/Views/view_rfq.php index 1b882ca1..58521104 100644 --- a/app/Views/view_rfq.php +++ b/app/Views/view_rfq.php @@ -7433,7 +7433,7 @@ function appendMultiFileData(data) { $('.loader-mask').delay(350).fadeOut('slow'); console.error('Error fetching data:', error); console.error(xhr.responseText); - toastr.error('An error occurred while checking the CD amount.', 'Error'); + toastr.error('An error occurred while removing the file.', 'Error'); }); }else{ diff --git a/app/Views/view_rfq_non_eb_new.php b/app/Views/view_rfq_non_eb_new.php index abc4f3ad..9f16c805 100644 --- a/app/Views/view_rfq_non_eb_new.php +++ b/app/Views/view_rfq_non_eb_new.php @@ -3271,7 +3271,7 @@ }, function(xhr, status, error) { console.error('Error fetching data:', error); console.error(xhr.responseText); - toastr.error('An error occurred while checking the CD amount.', 'Error'); + toastr.error('An error occurred while saving the data.', 'Error'); }); }