From a2f0af5e75b263fdc9685e9536d2f54a69b585f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 16 Mar 2024 17:49:03 +0100 Subject: [PATCH] fix phpstan --- htdocs/loan/class/paymentloan.class.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/loan/class/paymentloan.class.php b/htdocs/loan/class/paymentloan.class.php index d1e34bbbdf9..6d0c922aad3 100644 --- a/htdocs/loan/class/paymentloan.class.php +++ b/htdocs/loan/class/paymentloan.class.php @@ -170,13 +170,13 @@ class PaymentLoan extends CommonObject $this->fk_loan = (int) $this->fk_loan; } if (isset($this->amount_capital)) { - $this->amount_capital = price2num($this->amount_capital ? $this->amount_capital : 0); + $this->amount_capital = (float) price2num($this->amount_capital ? $this->amount_capital : 0); } if (isset($this->amount_insurance)) { - $this->amount_insurance = price2num($this->amount_insurance ? $this->amount_insurance : 0); + $this->amount_insurance = (float) price2num($this->amount_insurance ? $this->amount_insurance : 0); } if (isset($this->amount_interest)) { - $this->amount_interest = price2num($this->amount_interest ? $this->amount_interest : 0); + $this->amount_interest = (float) price2num($this->amount_interest ? $this->amount_interest : 0); } if (isset($this->fk_typepayment)) { $this->fk_typepayment = (int) $this->fk_typepayment; @@ -201,7 +201,7 @@ class PaymentLoan extends CommonObject } $totalamount = $this->amount_capital + $this->amount_insurance + $this->amount_interest; - $totalamount = price2num($totalamount); + $totalamount = (float) price2num($totalamount); // Check parameters if ($totalamount == 0) { @@ -332,13 +332,13 @@ class PaymentLoan extends CommonObject $this->fk_loan = (int) $this->fk_loan; } if (isset($this->amount_capital)) { - $this->amount_capital = trim($this->amount_capital); + $this->amount_capital = (float) $this->amount_capital; } if (isset($this->amount_insurance)) { - $this->amount_insurance = trim($this->amount_insurance); + $this->amount_insurance = (float) $this->amount_insurance; } if (isset($this->amount_interest)) { - $this->amount_interest = trim($this->amount_interest); + $this->amount_interest = (float) $this->amount_interest; } if (isset($this->fk_typepayment)) { $this->fk_typepayment = (int) $this->fk_typepayment;