FIX_STMT_UPLOAD_INT_ISSUE
This commit is contained in:
parent
0682a4ed70
commit
1dc56c325b
@ -5702,8 +5702,8 @@ class ClientController extends AdminController
|
|||||||
// ---------- POLICY TRANSACTION CONTROLLER --------------------------------------------------------------------------------
|
// ---------- POLICY TRANSACTION CONTROLLER --------------------------------------------------------------------------------
|
||||||
|
|
||||||
$policyTransactionController = new PolicyTransactionController();
|
$policyTransactionController = new PolicyTransactionController();
|
||||||
// $res = $policyTransactionController->validateInsurerStatement(['file_id' => '60']);
|
// $res = $policyTransactionController->validateInsurerStatement(['file_id' => '62']);
|
||||||
// $res = $policyTransactionController->updateInsurerStatement(['file_id' => '22']);
|
// $res = $policyTransactionController->updateInsurerStatement(['file_id' => '62']);
|
||||||
// dd('-----', $res);
|
// dd('-----', $res);
|
||||||
|
|
||||||
// ----------EMP DATA SERVICE CONTROLLER--------------------------------------------------------------------------------
|
// ----------EMP DATA SERVICE CONTROLLER--------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -2510,6 +2510,7 @@
|
|||||||
// check policy no,insurer and etc in DB for this month
|
// check policy no,insurer and etc in DB for this month
|
||||||
// if all good return true, otherwise return false with messssage
|
// if all good return true, otherwise return false with messssage
|
||||||
$data_to_update = [];
|
$data_to_update = [];
|
||||||
|
try{
|
||||||
foreach ($excel_data as $excel_key => $excel_row) {
|
foreach ($excel_data as $excel_key => $excel_row) {
|
||||||
$is_row_empty = check_row_is_empty_or_null($excel_row);
|
$is_row_empty = check_row_is_empty_or_null($excel_row);
|
||||||
if (!$is_row_empty) {
|
if (!$is_row_empty) {
|
||||||
@ -2534,14 +2535,14 @@
|
|||||||
|
|
||||||
// $actual_bp_per = trim($excel_row[9]); //commented becoz this filed removed tfrom excel file
|
// $actual_bp_per = trim($excel_row[9]); //commented becoz this filed removed tfrom excel file
|
||||||
$actual_bp_per = 0; //set default value 0 for maintaining existing code flow
|
$actual_bp_per = 0; //set default value 0 for maintaining existing code flow
|
||||||
$actual_bp_brokerage = trim($excel_row[5]);
|
$actual_bp_brokerage = (int) trim($excel_row[5]);
|
||||||
$actual_bp_amt = trim($excel_row[3]);
|
$actual_bp_amt = (int) trim($excel_row[3]);
|
||||||
|
|
||||||
if (($actual_bp_brokerage && $actual_bp_brokerage != 0 && $actual_bp_brokerage != "")) {
|
if (($actual_bp_brokerage && $actual_bp_brokerage != 0 && $actual_bp_brokerage != "")) {
|
||||||
$total_amt += $actual_bp_brokerage;
|
$total_amt += $actual_bp_brokerage;
|
||||||
//percentage reverse calculation
|
//percentage reverse calculation
|
||||||
if (($actual_bp_per == 0 || $actual_bp_per == 0) && !empty($actual_bp_amt)) {
|
if (($actual_bp_per == 0 || $actual_bp_per == 0) && !empty($actual_bp_amt)) {
|
||||||
$actual_bp_per = round(($actual_bp_brokerage / $actual_bp_amt) * 100, 2);
|
$actual_bp_per = (int) round(($actual_bp_brokerage / $actual_bp_amt) * 100, 2);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$actual_bp_brokerage = $actual_bp_amt * ($actual_bp_per / 100);
|
$actual_bp_brokerage = $actual_bp_amt * ($actual_bp_per / 100);
|
||||||
@ -2550,14 +2551,14 @@
|
|||||||
|
|
||||||
// $actual_tp_per = trim($excel_row[10]);//commented becoz this filed removed tfrom excel file
|
// $actual_tp_per = trim($excel_row[10]);//commented becoz this filed removed tfrom excel file
|
||||||
$actual_tp_per = 0;//set default value 0 for maintaining existing code flow
|
$actual_tp_per = 0;//set default value 0 for maintaining existing code flow
|
||||||
$actual_tp_brokerage = trim($excel_row[6]);
|
$actual_tp_brokerage = (int) trim($excel_row[6]);
|
||||||
$actual_tp_amt = trim($excel_row[4]);
|
$actual_tp_amt = (int) trim($excel_row[4]);
|
||||||
|
|
||||||
if ($actual_tp_brokerage && $actual_tp_brokerage != 0 && $actual_tp_brokerage != "") {
|
if ($actual_tp_brokerage && $actual_tp_brokerage != 0 && $actual_tp_brokerage != "") {
|
||||||
$total_amt += $actual_tp_brokerage;
|
$total_amt += $actual_tp_brokerage;
|
||||||
//percentage reverse calculation
|
//percentage reverse calculation
|
||||||
if (($actual_tp_per == 0 || $actual_tp_per == "") && !empty($actual_tp_amt)) {
|
if (($actual_tp_per == 0 || $actual_tp_per == "") && !empty($actual_tp_amt)) {
|
||||||
$actual_tp_per = ($actual_tp_brokerage / $actual_tp_amt) * 100;
|
$actual_tp_per = (int) round(($actual_tp_brokerage / $actual_tp_amt) * 100, 2);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$actual_tp_brokerage = $actual_tp_amt * ($actual_tp_per / 100);
|
$actual_tp_brokerage = $actual_tp_amt * ($actual_tp_per / 100);
|
||||||
@ -2594,6 +2595,21 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}catch (\Throwable $th) {
|
||||||
|
|
||||||
|
$this->myLogger->logme("error", "REST-AUTH-CONTROLLER - updateInsurerStatement: Exception: " . $th->getMessage() . " --- Line: " . $th->getLine() . " --- Trace: " . $th->getTraceAsString());
|
||||||
|
$errorData = [
|
||||||
|
'message' => $th->getMessage(),
|
||||||
|
'file' => $th->getFile(),
|
||||||
|
'line' => $th->getLine(),
|
||||||
|
'code' => $th->getCode(),
|
||||||
|
'trace' => $th->getTraceAsString(),
|
||||||
|
'trace_array' => $th->getTrace(), // full array version (optional)
|
||||||
|
'function' => $th->getTrace()[0]['function'] ?? null,
|
||||||
|
'class' => $th->getTrace()[0]['class'] ?? null,
|
||||||
|
];
|
||||||
|
return ['status' => 'failed', 'code' => 500, 'message' => $th->getMessage(), 'error_data' => $errorData];
|
||||||
|
}
|
||||||
// dd($data_to_update);
|
// dd($data_to_update);
|
||||||
$this->coShareStmtDetailsModel->insertBatch($data_to_update, 'id');
|
$this->coShareStmtDetailsModel->insertBatch($data_to_update, 'id');
|
||||||
// dd($data_to_update);
|
// dd($data_to_update);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user