FIX_LIVE_ISSUE_MOTOR_POLICY_UPLOAD_ISSUE
This commit is contained in:
parent
d78343ace3
commit
e847af6bcb
@ -5618,17 +5618,18 @@ class PolicyTransactionController extends BaseController
|
||||
$policy_end_date = trim($row[11]);
|
||||
$revenue_type = trim($row[12]);
|
||||
|
||||
$base_premium = trim($row[16]);
|
||||
$non_commission_premium_amount = trim($row[17]);
|
||||
$tp_premium = trim($row[18]);
|
||||
$igst = trim($row[19]);
|
||||
$cgst = trim($row[20]);
|
||||
$sgst = trim($row[21]);
|
||||
$stamp_duty = trim($row[22]);
|
||||
$base_premium = cleanNumber($row[16]);
|
||||
$non_commission_premium_amount = cleanNumber($row[17]);
|
||||
$tp_premium = cleanNumber($row[18]);
|
||||
$igst = cleanNumber($row[19]);
|
||||
$cgst = cleanNumber($row[20]);
|
||||
$sgst = cleanNumber($row[21]);
|
||||
$stamp_duty = cleanNumber($row[22]);
|
||||
$agreed_amount = cleanNumber($row[23]);
|
||||
$agreed_bp_percentage = cleanNumber($row[24]);
|
||||
$agreed_tp_percentage = cleanNumber($row[25]);
|
||||
|
||||
// $total = trim($row[23]);
|
||||
$agreed_amount = trim($row[23]);
|
||||
$agreed_bp_percentage = trim($row[24]);
|
||||
$agreed_tp_percentage = trim($row[25]);
|
||||
// $actual_bp_amount = trim($row[27]);
|
||||
// $actual_tp_amount = trim($row[28]);
|
||||
// $actual_bp_percentage = trim($row[29]);
|
||||
@ -5647,16 +5648,16 @@ class PolicyTransactionController extends BaseController
|
||||
$rewards = 0;
|
||||
|
||||
$calculation = calculateMotorPolicyAmounts([
|
||||
'base_premium' => trim($row[16]),
|
||||
'non_commission_premium_amount' => trim($row[17]),
|
||||
'tp_premium' => trim($row[18]),
|
||||
'igst' => trim($row[19]),
|
||||
'cgst' => trim($row[20]),
|
||||
'sgst' => trim($row[21]),
|
||||
'stamp_duty' => trim($row[22]),
|
||||
'agreed_amount' => trim($row[23]),
|
||||
'agreed_bp_percentage' => trim($row[24]),
|
||||
'agreed_tp_percentage' => trim($row[25]),
|
||||
'base_premium' => $base_premium,
|
||||
'non_commission_premium_amount' => $non_commission_premium_amount,
|
||||
'tp_premium' => $tp_premium,
|
||||
'igst' => $igst,
|
||||
'cgst' => $cgst,
|
||||
'sgst' => $sgst,
|
||||
'stamp_duty' => $stamp_duty,
|
||||
'agreed_amount' => $agreed_amount,
|
||||
'agreed_bp_percentage' => $agreed_bp_percentage,
|
||||
'agreed_tp_percentage' => $agreed_tp_percentage,
|
||||
'standard_bp_percentage' => 15.00,
|
||||
'standard_tp_percentage' => 2.5
|
||||
]);
|
||||
|
||||
@ -3072,6 +3072,8 @@ if (!function_exists('validate_mobile_value')) {
|
||||
if (!function_exists('validate_positive_number_value')) {
|
||||
function validate_positive_number_value($value)
|
||||
{
|
||||
$value = cleanNumber($value);
|
||||
|
||||
if ($value === "" || $value === null) {
|
||||
return ['status' => true, 'error' => null];
|
||||
}
|
||||
|
||||
@ -1382,3 +1382,16 @@ if (! function_exists('add_google_calender_event')) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('cleanNumber')) {
|
||||
|
||||
function cleanNumber($value){
|
||||
if (empty($value)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
$value = str_replace(',', '', trim($value));
|
||||
return is_numeric($value) ? (float)$value : 0;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user