From 9dbfb1de4616c7331fa78cb87b34aac845c0ff31 Mon Sep 17 00:00:00 2001 From: thibdrev Date: Mon, 12 Feb 2024 02:11:28 +0100 Subject: [PATCH] qual: phpstan for htdocs/compta/bank/class/paymentvarious.class.php (#28114) htdocs/compta/bank/class/paymentvarious.class.php 241 Property PaymentVarious::$amount (float) does not accept string. htdocs/compta/bank/class/paymentvarious.class.php 459 Property PaymentVarious::$amount (float) does not accept string. --- htdocs/compta/bank/class/paymentvarious.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/bank/class/paymentvarious.class.php b/htdocs/compta/bank/class/paymentvarious.class.php index f74034a103b..33e33291bc8 100644 --- a/htdocs/compta/bank/class/paymentvarious.class.php +++ b/htdocs/compta/bank/class/paymentvarious.class.php @@ -238,7 +238,7 @@ class PaymentVarious extends CommonObject $error = 0; // Clean parameters - $this->amount = trim($this->amount); + $this->amount = (float) price2num($this->amount); $this->label = trim($this->label); $this->note = trim($this->note); $this->fk_bank = (int) $this->fk_bank; @@ -456,7 +456,7 @@ class PaymentVarious extends CommonObject $now = dol_now(); // Clean parameters - $this->amount = price2num(trim($this->amount)); + $this->amount = (float) price2num($this->amount); $this->label = trim($this->label); $this->note = trim($this->note); $this->fk_bank = (int) $this->fk_bank;