FIX_INSURER_STMT_UPLOAD&BDS_EXPORT

This commit is contained in:
velz 2025-06-23 17:10:21 +05:30
parent 0126473c18
commit ae18ed65c8
3 changed files with 17 additions and 10 deletions

View File

@ -1918,7 +1918,7 @@ class EmpDataServiceController extends BaseController
$result_for_employees_policy = $this->employeePolicyModel
->select('employee_polices.*')
->join('employees', 'employees.id = employee_polices.employee_id')
->join('emp_endorsement', 'emp_endorsement.employee_id = employees.id') // assuming this is the correct join
->join('emp_endorsement', 'emp_endorsement.pk = employees.id') // assuming this is the correct join
->where('employees.emp_code', $emp_code)
->where('employees.name', $name)
->where('employees.client_id', $client_id)

View File

@ -2037,8 +2037,8 @@ class PolicyTransactionController extends BaseController
//insurer statement list page
public function statementList()
{
// dd($this->validateInsurerStatement(['file_id' => 30]));
// $data['insurers'] = $this->insurerModel->where('is_active',1)->findAll();
// dd($this->validateInsurerStatement(['file_id' => 49]));
$data['insurers'] = $this->insurerModel->where('is_active',1)->findAll();
$today = date('Y-m-d');
$fromday = $from_date = date('Y-m-d', strtotime('-180 days', strtotime($today)));
// echo $fromday;die();
@ -2261,13 +2261,13 @@ class PolicyTransactionController extends BaseController
// dd($highestRowAndColumn);
$excel_data = $sheet->rangeToArray('A1:' . $highestRowAndColumn['column'] . $highestRowAndColumn['row']);
unset($excel_data[0]);
// Kint::dump($excel_data);
// Kint::dump($excel_data);die();
//get no of line items and update in DB
$line_items = 0;
// get uploaded month transactions data
$source_data = $this->PTCOShareDetailsModel->getNonReconcileredPolicyTransactions(insurer_id: $file['insurer_id'], insurer_branch_id: $file['branch_id']);
// var_dump($source_data);die();
// Kint::dump($source_data);//die();
// Kint::dump($source_data);die();
// check policy no,insurer and etc in DB for this month
@ -2277,17 +2277,24 @@ class PolicyTransactionController extends BaseController
if (!$is_row_empty) {
// $excel_row = ExcelSanitizeHelper::sanitizeArrayData($excel_row);
$is_source_found = 0;
// Kint::dump($excel_key,$excel_row[1],$excel_row[2]);
$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
$policy_no = preg_replace( '/[\x{200B}\x{200C}\x{200D}\x{FEFF}\x{00A0}\x{200E}\x{200F}\x{202A}-\x{202E}]/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);
$endorsement_no = preg_replace( '/[\x{200B}\x{200C}\x{200D}\x{FEFF}\x{00A0}\x{200E}\x{200F}\x{202A}-\x{202E}]/u', '', $excel_row[2]); //policy_end_date from excel
// 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']) {
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]);

View File

@ -212,8 +212,8 @@ $(document).ready(function() {
customizeData: function (data) {
for (var i = 0; i < data.body.length; i++) {
for (var j = 0; j < data.body[i].length; j++) {
// Check if the column is the 9th index (10th column)
if (j === 9) {
// Check if the column is the 9th index (10th column) and 10th index (11th column)
if (j === 9 || j === 10) {
data.body[i][j] = '\u200C' + data.body[i][j];
}
}