From 4d0070d1105b1fa203d945bd7449b05f9e27e168 Mon Sep 17 00:00:00 2001 From: velz Date: Mon, 27 Jan 2025 17:31:38 +0530 Subject: [PATCH] FIX_BDS_STMT_UPLOAD_UNICODE_CHAR_HANDLED --- app/Controllers/PolicyTransactionController.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/app/Controllers/PolicyTransactionController.php b/app/Controllers/PolicyTransactionController.php index ca4a1d66..ea4d3901 100644 --- a/app/Controllers/PolicyTransactionController.php +++ b/app/Controllers/PolicyTransactionController.php @@ -2204,16 +2204,19 @@ class PolicyTransactionController extends BaseController $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; $policy_start_date = preg_replace('/^\p{Z}+|\p{Z}+$/u', '', $excel_row[4]);//policy_start_date from excel $policy_end_date = preg_replace('/^\p{Z}+|\p{Z}+$/u', '', $excel_row[5]);//policy_end_date from excel $policy_no = preg_replace('/^\p{Z}+|\p{Z}+$/u', '', $excel_row[1]);//policy_end_date from excel + $policy_no = preg_replace('/[\x{200C}\x{200B}]/u', '', $excel_row[1]);//policy_end_date from excel $client_name = preg_replace('/^\p{Z}+|\p{Z}+$/u', '', $excel_row[3]);//clientname from excel $endorsement_no = preg_replace('/^\p{Z}+|\p{Z}+$/u', '', $excel_row[2]);//policy_end_date from excel - + // Kint::dump($policy_no); foreach ($source_data as $source_key => $source_row) { - $source_endorsement_no = $source_row['endorsement_no'] !== null ? $source_row['endorsement_no'] : ""; + $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']) { $is_source_found = 1; @@ -2295,9 +2298,9 @@ class PolicyTransactionController extends BaseController $line_items = count($excel_data); // get uploaded month transactions data $source_data = $this->PTCOShareDetailsModel->getNonReconcileredPolicyTransactions(insurer_id:$file['insurer_id'],insurer_branch_id:$file['branch_id']); - // Kint::dump($source_data);die; + // Kint::dump($source_data);//die; // Kint::dump($excel_data); - + // die; // check policy no,insurer and etc in DB for this month // if all good return true, otherwise return false with messssage $data_to_update = []; @@ -2311,13 +2314,14 @@ class PolicyTransactionController extends BaseController $policy_start_date = preg_replace('/^\p{Z}+|\p{Z}+$/u', '', $excel_row[4]);//policy_start_date from excel $policy_end_date = preg_replace('/^\p{Z}+|\p{Z}+$/u', '', $excel_row[5]);//policy_end_date from excel $policy_no = preg_replace('/^\p{Z}+|\p{Z}+$/u', '', $excel_row[1]);//policy_end_date from excel + $policy_no = preg_replace('/[\x{200C}\x{200B}]/u', '', $excel_row[1]);// $client_name = preg_replace('/^\p{Z}+|\p{Z}+$/u', '', $excel_row[3]);//clientname from excel $endorsement_no = preg_replace('/^\p{Z}+|\p{Z}+$/u', '', $excel_row[2]);//policy_end_date from excel 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'] : ""; + $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']) { $is_source_found = 1;