BugFix for PHP7.1: PHP Warning: A non-numeric value encountered in /tmp/Dolibarr/htdocs/product/class/product.class.php on line 1709

This commit is contained in:
BadPixxel 2018-03-10 15:48:40 +01:00
parent 7b0119aee0
commit ea3872b0cb

View File

@ -1677,7 +1677,7 @@ class Product extends CommonObject
return -1; return -1;
} }
if ($newprice!='' || $newprice==0) if ($newprice !== '' || $newprice === 0)
{ {
if ($newpricebase == 'TTC') if ($newpricebase == 'TTC')
{ {
@ -1703,8 +1703,8 @@ class Product extends CommonObject
$price_ttc = ( $newnpr != 1 ) ? price2num($newprice) * (1 + ($newvat / 100)) : $price; $price_ttc = ( $newnpr != 1 ) ? price2num($newprice) * (1 + ($newvat / 100)) : $price;
$price_ttc = price2num($price_ttc,'MU'); $price_ttc = price2num($price_ttc,'MU');
if ($newminprice!='' || $newminprice==0) if ( $newminprice !== '' || $newminprice === 0)
{ {
$price_min = price2num($newminprice,'MU'); $price_min = price2num($newminprice,'MU');
$price_min_ttc = price2num($newminprice) * (1 + ($newvat / 100)); $price_min_ttc = price2num($newminprice) * (1 + ($newvat / 100));
$price_min_ttc = price2num($price_min_ttc,'MU'); $price_min_ttc = price2num($price_min_ttc,'MU');