FIX fatal error Unsupported operand types when recording load payment

This commit is contained in:
Laurent Destailleur 2024-03-04 14:46:33 +01:00
parent 0c86f64565
commit db7a62f644

View file

@ -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)) {