From db7a62f644ffcb1068535b2f56d5a6a5c10bd4aa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 4 Mar 2024 14:46:33 +0100 Subject: [PATCH] FIX fatal error Unsupported operand types when recording load payment --- htdocs/loan/payment/payment.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/loan/payment/payment.php b/htdocs/loan/payment/payment.php index 6a136f8ba2e..d65f48665a3 100644 --- a/htdocs/loan/payment/payment.php +++ b/htdocs/loan/payment/payment.php @@ -114,16 +114,16 @@ if ($action == 'add_payment') { if (!$error) { $paymentid = 0; - $pay_amount_capital = price2num(GETPOST('amount_capital')); - $pay_amount_insurance = price2num(GETPOST('amount_insurance')); + $pay_amount_capital = (float) price2num(GETPOST('amount_capital')); + $pay_amount_insurance = (float) price2num(GETPOST('amount_insurance')); // User can't set interest him self if schedule is set (else value in schedule can be incoherent) if (!empty($line)) { $pay_amount_interest = $line->amount_interest; } else { - $pay_amount_interest = price2num(GETPOST('amount_interest')); + $pay_amount_interest = (float) price2num(GETPOST('amount_interest')); } - $remaindertopay = price2num(GETPOST('remaindertopay')); - $amount = $pay_amount_capital + $pay_amount_insurance + $pay_amount_interest; + $remaindertopay = (float) price2num(GETPOST('remaindertopay')); + $amount = (float) price2num($pay_amount_capital + $pay_amount_insurance + $pay_amount_interest, 'MT'); // This term is allready paid if (!empty($line) && !empty($line->fk_bank)) {