From c822795cc14238765475ea2f5e95c3950f11d1fb Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 23 Mar 2024 01:11:55 +0100 Subject: [PATCH] Fix PhanTypeInvalid{Left,Right}OperandOfNumericOp mostly by typing, casting, idate --- htdocs/commande/class/commande.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 291ead61cd3..d2ee2bb3079 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1634,8 +1634,8 @@ class Commande extends CommonOrder $price = $pu; $remise = 0; if ($remise_percent > 0) { - $remise = round(($pu * $remise_percent / 100), 2); - $price = $pu - $remise; + $remise = round(((float) $pu * $remise_percent / 100), 2); + $price = (float) $pu - $remise; } // Insert line @@ -3187,8 +3187,8 @@ class Commande extends CommonOrder } $remise = 0; if ($remise_percent > 0) { - $remise = round(($pu * $remise_percent / 100), 2); - $price = ($pu - $remise); + $remise = round(((float) $pu * $remise_percent / 100), 2); + $price = ((float) $pu - $remise); } //Fetch current line from the database and then clone the object and set it in $oldline property