FIX_STATEMENT_UPLOAD

This commit is contained in:
VENKATESHWARAN 2025-12-20 16:59:24 +05:30
parent 374aa0fa8c
commit 4bfd58a0e5
2 changed files with 32 additions and 14 deletions

View File

@ -5998,7 +5998,7 @@ class ClientController extends AdminController
// ---------- POLICY TRANSACTION CONTROLLER --------------------------------------------------------------------------------
$policyTransactionController = new PolicyTransactionController();
// $res = $policyTransactionController->validateInsurerStatement(['file_id' => '271']);
// $res = $policyTransactionController->validateInsurerStatement(['file_id' => '281']);
// $res = $policyTransactionController->updateInsurerStatement(['file_id' => '62']);
// dd('-----', $res);

View File

@ -3798,6 +3798,7 @@
// get uploaded month transactions data
$source_data = $this->PTCOShareDetailsModel->getNonReconcileredPolicyTransactions(insurer_id: $file['insurer_id'], insurer_branch_id: $file['branch_id']);
// dd($source_data);
// check policy no,insurer and etc in DB for this month
// if all good return true, otherwise return false with messssage
@ -3808,6 +3809,9 @@
$row_number = $excel_key;
$is_row_empty = check_row_is_empty_or_null($excel_row);
$policy_source_found = 0;
$endorsement_source_found = 0;
$dublicate_found = 0;
if (!$is_row_empty) {
@ -3821,33 +3825,47 @@
$source_endorsement_no = $source_row['endorsement_no'] !== null ? $source_row['endorsement_no'] : null;
// Policy number mismatch
if ($policy_no != $source_row['policy_no']) {
$error_messages[$row_number]['policy_no_mismatch'] =
"Policy number <strong>({$policy_no}) </strong> not in NHance.";
}
// Endorsement number mismatch
if (!empty($endorsement_no) && $endorsement_no != $source_endorsement_no) {
$error_messages[$row_number]['endorsement_no_mismatch'] =
"Endorsement number <strong>({$endorsement_no})</strong> not not in NHance.";
if (($policy_no == $source_row['policy_no']) ){
$policy_source_found = 1;
}
if( $endorsement_no == $source_endorsement_no) {
$endorsement_source_found = 1;
}
// Duplicate check
if (isset($matched_entry[$policy_no . '|' . $endorsement_no])) {
$error_messages[$row_number]['duplicate'] =
"Duplicate entry found. This policy and endorsement <strong>({$policy_no} '|' {$endorsement_no})</strong> combination has already been matched.";
$dublicate_found = 1;
continue 2;
}
if (($policy_no == $source_row['policy_no']) && $endorsement_no == $source_endorsement_no) {
$line_items = $line_items + 1;
$matched_entry[] = $policy_no . '|' . $endorsement_no;
unset($source_data[$source_key]);
continue 2;
}
}
// Policy number mismatch
if ($policy_source_found == 0) {
$error_messages[$row_number]['policy_no_mismatch'] =
"Policy number <strong>({$policy_no}) </strong> not in NHance.";
}
// Endorsement number mismatch
if (!empty($endorsement_no) && $endorsement_source_found == 0) {
$error_messages[$row_number]['endorsement_no_mismatch'] =
"Endorsement number <strong>({$endorsement_no})</strong> not in NHance.";
}
// Duplicate check
if ($dublicate_found == 1) {
$error_messages[$row_number]['duplicate'] =
"Duplicate entry found. This policy and endorsement <strong>({$policy_no} '|' {$endorsement_no})</strong> combination has already been matched.";
}
}
}
// print_rr($error_messages);die;