From 742f81e7ce86ad36b67d35bd5d1de2333e94726e Mon Sep 17 00:00:00 2001 From: "venkatesh.r" Date: Tue, 5 Aug 2025 11:42:25 +0530 Subject: [PATCH] CHANGE_STATEMENT_UPLOAD_BDS_CRS : RV --- app/Controllers/ClientController.php | 6 +++--- .../PolicyTransactionController.php | 18 +++++++++++++++--- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/app/Controllers/ClientController.php b/app/Controllers/ClientController.php index a61d0917..c2c94c0f 100755 --- a/app/Controllers/ClientController.php +++ b/app/Controllers/ClientController.php @@ -5100,9 +5100,9 @@ class ClientController extends AdminController // return $this->downloadInsurerExcelExport($batch_data); // dd($res); die; - // $PolicyTransactionController = new PolicyTransactionController(); - // $res = $PolicyTransactionController->validateInsurerStatement(['file_id' => '36']); - + $PolicyTransactionController = new PolicyTransactionController(); + $res = $PolicyTransactionController->validateInsurerStatement(['file_id' => '131']); + dd($res); // $params = [ // 'client_policy_id' => 6090, diff --git a/app/Controllers/PolicyTransactionController.php b/app/Controllers/PolicyTransactionController.php index 3d9ee4f6..cd08d50d 100644 --- a/app/Controllers/PolicyTransactionController.php +++ b/app/Controllers/PolicyTransactionController.php @@ -2279,7 +2279,9 @@ class PolicyTransactionController extends BaseController // if all good return true, otherwise return false with messssage foreach ($excel_data as $excel_key => $excel_row) { $is_row_empty = check_row_is_empty_or_null($excel_row); + if (!$is_row_empty) { + // $excel_row = ExcelSanitizeHelper::sanitizeArrayData($excel_row); $is_source_found = 0; // Kint::dump($excel_key,$excel_row[1],$excel_row[2]); @@ -2297,8 +2299,17 @@ class PolicyTransactionController extends BaseController // Kint::dump($excel_key,$policy_no,$endorsement_no,$policy_start_date,$policy_end_date);//die(); foreach ($source_data as $source_key => $source_row) { $source_endorsement_no = $source_row['endorsement_no'] !== null ? $source_row['endorsement_no'] : null; - // Kint::dump($source_endorsement_no); - if (($policy_no == $source_row['policy_no']) && $endorsement_no == $source_endorsement_no && change_date_format($policy_start_date, 'd-m-Y', 'Y-m-d') == $source_row['policy_start_date'] && change_date_format($policy_end_date, 'd-m-Y', 'Y-m-d') == $source_row['policy_end_date'] && $client_name == $source_row['client_name']) + // Kint::dump($source_row, $source_endorsement_no, $policy_no, $endorsement_no); + + // if (($policy_no == $source_row['policy_no']) && $endorsement_no == $source_endorsement_no && change_date_format($policy_start_date, 'd-m-Y', 'Y-m-d') == $source_row['policy_start_date'] && change_date_format($policy_end_date, 'd-m-Y', 'Y-m-d') == $source_row['policy_end_date'] && $client_name == $source_row['client_name']) + // { + // $is_source_found = 1; + // $line_items = $line_items + 1; + // unset($source_data[$source_key]); + // continue 2; + // } + + if (($policy_no == $source_row['policy_no']) && $endorsement_no == $source_endorsement_no) { $is_source_found = 1; $line_items = $line_items + 1; @@ -2395,7 +2406,8 @@ class PolicyTransactionController extends BaseController foreach ($source_data as $source_key => $source_row) { // Kint::dump(change_date_format($excel_row[3],'d-m-Y','Y-m-d')); $source_endorsement_no = $source_row['endorsement_no'] !== null ? $source_row['endorsement_no'] : null; - if (($policy_no == $source_row['policy_no']) && $endorsement_no == $source_endorsement_no && change_date_format($policy_start_date, 'd-m-Y', 'Y-m-d') == $source_row['policy_start_date'] && change_date_format($policy_end_date, 'd-m-Y', 'Y-m-d') == $source_row['policy_end_date'] && $client_name == $source_row['client_name']) { + // if (($policy_no == $source_row['policy_no']) && $endorsement_no == $source_endorsement_no && change_date_format($policy_start_date, 'd-m-Y', 'Y-m-d') == $source_row['policy_start_date'] && change_date_format($policy_end_date, 'd-m-Y', 'Y-m-d') == $source_row['policy_end_date'] && $client_name == $source_row['client_name']) { + if (($policy_no == $source_row['policy_no']) && $endorsement_no == $source_endorsement_no) { $is_source_found = 1; //calculate percentage first