From 5d141a63f3f26a25303aac71f72ca0195f13d09d Mon Sep 17 00:00:00 2001 From: "sanjeev.p" Date: Mon, 4 May 2026 18:23:28 +0530 Subject: [PATCH 1/3] FIX_reopen fixes --- app/Views/client_kyc.php | 6 +++--- app/Views/leads_form.php | 9 +++++++-- app/Views/leads_non_eb.php | 6 ++++-- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/app/Views/client_kyc.php b/app/Views/client_kyc.php index 11daea59..83baa2b3 100755 --- a/app/Views/client_kyc.php +++ b/app/Views/client_kyc.php @@ -49,7 +49,7 @@
- Allowed: PDF, JPG, JPEG, PNG. Size : 200KB/image 25MB/PDF + Allowed: PDF, JPG, JPEG, PNG.
@@ -170,7 +170,7 @@
- Allowed: PDF, JPG, JPEG, PNG. Size : 200KB/image 25MB/PDF + Allowed: PDF, JPG, JPEG, PNG.
@@ -505,7 +505,7 @@ - Allowed: PDF, JPG, JPEG, PNG. Size : 200KB/image 25MB/PDF + Allowed: PDF, JPG, JPEG, PNG.
diff --git a/app/Views/leads_form.php b/app/Views/leads_form.php index 3e077886..f42e8830 100644 --- a/app/Views/leads_form.php +++ b/app/Views/leads_form.php @@ -449,11 +449,16 @@
-
+ +
+ +
-
diff --git a/app/Views/leads_non_eb.php b/app/Views/leads_non_eb.php index 7ee7ca64..a0d9946e 100644 --- a/app/Views/leads_non_eb.php +++ b/app/Views/leads_non_eb.php @@ -469,8 +469,10 @@ var pageBackButton = '
- - + +
From 961b0e246ab0b41169245b949b6de46de99573a8 Mon Sep 17 00:00:00 2001 From: "sanjeev.p" Date: Mon, 4 May 2026 18:30:59 +0530 Subject: [PATCH 2/3] FIX_reopen fixes --- app/Views/leads_form.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/Views/leads_form.php b/app/Views/leads_form.php index f42e8830..939d4b57 100644 --- a/app/Views/leads_form.php +++ b/app/Views/leads_form.php @@ -449,16 +449,14 @@
-
- +
+ +
From 57add4c4c91827adeeafed0a93a072bad360e9e2 Mon Sep 17 00:00:00 2001 From: velz Date: Tue, 5 May 2026 09:17:44 +0530 Subject: [PATCH 3/3] FIX_API_API_DATA_STORE --- app/Controllers/EmployeeController.php | 49 +++++++++++++++++++- app/Controllers/FhplApiController.php | 5 ++ app/Controllers/HealthIndiaApiController.php | 5 +- app/Helpers/utility_helper.php | 7 +++ app/Views/batch_list.php | 28 +++++++++-- 5 files changed, 86 insertions(+), 8 deletions(-) diff --git a/app/Controllers/EmployeeController.php b/app/Controllers/EmployeeController.php index 3c1d1940..8db53a2f 100755 --- a/app/Controllers/EmployeeController.php +++ b/app/Controllers/EmployeeController.php @@ -4367,10 +4367,55 @@ class EmployeeController extends AdminController $not_in_tpa = $this->employeePolicyModel->getTPADataVariationReport($client_id, $client_policy_id, $file_id, $tpa_emp_codes); if (!empty($not_in_tpa) || !empty($not_in_nhance) || !empty($emp_data_wo_tpa_id)) { + $not_in_nhance_button_enable_status = false; + if(count($not_in_tpa)) + { + foreach($not_in_nhance as $nih) + { + if($nih['ref'] === '' || empty($nih['ref'])) + { + $not_in_nhance_button_enable_status = true; + break; + } + } + } + + $not_in_nhance_inception_count = 0; + $not_in_nhance_deletion_count = 0; + foreach ($not_in_nhance as $nih) { + $hasRefKey = array_key_exists('ref', $nih); + $ref = $hasRefKey ? $nih['ref'] : null; + // Empty/null ref: no key, NULL, '', or whitespace-only string. + $refIsEmpty = !$hasRefKey + || $ref === null + || $ref === '' + || (is_string($ref) && trim($ref) === ''); + + $actionIsDeletion = strtoupper(trim((string) ($nih['action_flag_status'] ?? ''))) === 'D'; + + // Every empty/null ref row counts as inception; those that also have flag D additionally count as deletion. + if ($refIsEmpty) { + $not_in_nhance_inception_count++; + if ($actionIsDeletion) { + $not_in_nhance_deletion_count++; + } + } + } + + $not_in_nhance_proceed_button_text = sprintf( + 'Proceed - Inception(%d) + Deletion(%d)', + $not_in_nhance_inception_count, + $not_in_nhance_deletion_count + ); + $response = [ 'not_in_tpa' => $not_in_tpa, 'not_in_nhance' => $not_in_nhance, 'mismatch_data' => $emp_data_wo_tpa_id, + 'not_in_nhance_button_enable_status' => $not_in_nhance_button_enable_status, + 'not_in_nhance_inception_count' => $not_in_nhance_inception_count, + 'not_in_nhance_deletion_count' => $not_in_nhance_deletion_count, + 'not_in_nhance_proceed_button_text' => $not_in_nhance_proceed_button_text, ]; if ($type === 'view') { @@ -4447,10 +4492,10 @@ class EmployeeController extends AdminController { if($generationResult['data']['file_id']) { - sleep(1); + // sleep(1); //initiate update references b/w tpa_api_data and employess (pk update) // $this->reconTpaApiDataWithEmployeepolicies(['file_id' => $file_id]); - sleep(1); + // sleep(1); //initiate deleteion if any // $this->initializeDeletionProcessForTpaApiData(['file_id' => $file_id]); diff --git a/app/Controllers/FhplApiController.php b/app/Controllers/FhplApiController.php index d941c757..7d5ae66f 100644 --- a/app/Controllers/FhplApiController.php +++ b/app/Controllers/FhplApiController.php @@ -1064,6 +1064,11 @@ class FhplApiController extends BaseController 'is_active' => 1, 'created_by' => $file_info[0]['created_by'] ?? null, 'action_flag_status' => $row['IsActive'] == 1 ? 'A' : 'D' + 'si' => $row['BASE_SUMINSURED'], + 'doj' => change_date_format($row['DATE_OF_JOINING'],'Y-m-d\TH:i:s'), + 'endorsement_no' => $row['ENDORSEMENT_NO'] + // 'date_of_exit' => $row['DATE_OF_RESIGN_FROM_POLICY'] + ]; } diff --git a/app/Controllers/HealthIndiaApiController.php b/app/Controllers/HealthIndiaApiController.php index 5e9f79bc..db356888 100644 --- a/app/Controllers/HealthIndiaApiController.php +++ b/app/Controllers/HealthIndiaApiController.php @@ -1092,7 +1092,10 @@ class HealthIndiaApiController extends BaseController 'is_active' => 1, 'created_by' => $file_info[0]['created_by'] ?? null, - 'action_flag_status' => $row['insuredStatus'] == 'Active' ? 'A' : 'D' + 'action_flag_status' => $row['insuredStatus'] == 'Active' ? 'A' : 'D', + 'doj' => change_date_format($row['doj'],), + 'si' => $row['baseSumInsured'], + 'endorsement_no' => $row['endorsementNumber'] ]; } // log_message('error','HEALTH_INDIA - COUNT' . count($mappedRows)); diff --git a/app/Helpers/utility_helper.php b/app/Helpers/utility_helper.php index c0657c30..9498fb88 100755 --- a/app/Helpers/utility_helper.php +++ b/app/Helpers/utility_helper.php @@ -661,6 +661,13 @@ if (! function_exists('change_date_format')) { $date_str = trim($date_str); // Allowed date formats $allowed_formats = [ + + // ISO 8601 datetime (must come before plain Y-m-d to avoid partial match issues) + 'Y-m-d\TH:i:sP', // 2025-07-26T00:00:00+05:30 + 'Y-m-d\TH:i:s\Z', // 2025-07-26T00:00:00Z + 'Y-m-d\TH:i:s', // 2025-07-26T00:00:00 + + // Day Month Year (clear unambiguous formats) 'd M Y', // 01 Dec 2024 'd-M-Y', // 01-Dec-2024 diff --git a/app/Views/batch_list.php b/app/Views/batch_list.php index 8849f24f..a610e38a 100755 --- a/app/Views/batch_list.php +++ b/app/Views/batch_list.php @@ -522,6 +522,10 @@ for ($i = 0; $i < $batch_col_count; $i++) {