Merge pull request #11832 from hregis/10.0_mc

FIX avoid Warning: A non-numeric value encountered
This commit is contained in:
Laurent Destailleur 2019-09-06 23:25:56 +02:00 committed by GitHub
commit b2fe04e2f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -433,7 +433,7 @@ if (empty($reshook))
}
$qty = GETPOST('qty'.$predef);
$remise_percent = GETPOST('remise_percent'.$predef);
$remise_percent = ((GETPOST('remise_percent'.$predef) != '') ? GETPOST('remise_percent'.$predef) : 0);
if ($qty == '')
{
@ -566,7 +566,8 @@ if (empty($reshook))
$info_bits=0;
if ($tva_npr) $info_bits |= 0x01;
if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS) )&& ($price_min && (price2num($pu_ht)*(1-price2num($remise_percent)/100) < price2num($price_min))))
if (((! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance))
|| empty($conf->global->MAIN_USE_ADVANCED_PERMS) ) && ($price_min && (price2num($pu_ht)*(1-price2num($remise_percent)/100) < price2num($price_min))))
{
$object->error = $langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, -1, $conf->currency));
$result = -1 ;