From e1eeef46abd8f6a3c532eb6054f6ea1b830997dc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 18 Nov 2024 17:10:56 +0100 Subject: [PATCH] Fix test on var --- htdocs/product/class/product.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 08df0210295..0eff9ebfbd3 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -2616,7 +2616,7 @@ class Product extends CommonObject /** * Modify customer price of a product/Service for a given level * - * @param double|string $newprice New price + * @param double $newprice New price * @param string $newpricebase HT or TTC * @param User $user Object user that make change * @param ?float $newvat New VAT Rate (For example 8.5. Should not be a string) @@ -2675,7 +2675,7 @@ class Product extends CommonObject $price = (float) price2num($newprice) / (1 + ((float) $newvat / 100)); $price = (float) price2num($price, 'MU'); - if ($newminprice != '' || $newminprice == 0) { + if ((string) $newminprice != '0') { $price_min_ttc = (float) price2num($newminprice, 'MU'); $price_min = (float) price2num($newminprice) / (1 + ($newvat / 100)); $price_min = (float) price2num($price_min, 'MU'); @@ -2688,7 +2688,7 @@ class Product extends CommonObject $price_ttc = ($newnpr != 1) ? (float) price2num($newprice) * (1 + ($newvat / 100)) : $price; $price_ttc = (float) price2num($price_ttc, 'MU'); - if ($newminprice !== '' || $newminprice == 0) { + if ((string) $newminprice != '0') { $price_min = (float) price2num($newminprice, 'MU'); $price_min_ttc = (float) price2num($newminprice) * (1 + ($newvat / 100)); $price_min_ttc = (float) price2num($price_min_ttc, 'MU');