Fix: use the good price min with multiprice
This commit is contained in:
parent
8f32052fe1
commit
c41f26fb0a
@ -851,12 +851,14 @@ if (($_POST['action'] == 'addline' || $_POST['action'] == 'addline_predef') && $
|
||||
{
|
||||
$pu_ht = $prod->multiprices[$object->client->price_level];
|
||||
$pu_ttc = $prod->multiprices_ttc[$object->client->price_level];
|
||||
$price_min = $prod->multiprices_min[$object->client->price_level];
|
||||
$price_base_type = $prod->multiprices_base_type[$object->client->price_level];
|
||||
}
|
||||
else
|
||||
{
|
||||
$pu_ht = $prod->price;
|
||||
$pu_ttc = $prod->price_ttc;
|
||||
$price_min = $prod->price_min;
|
||||
$price_base_type = $prod->price_base_type;
|
||||
}
|
||||
|
||||
@ -905,7 +907,7 @@ if (($_POST['action'] == 'addline' || $_POST['action'] == 'addline_predef') && $
|
||||
|
||||
if ($result >= 0)
|
||||
{
|
||||
if($prod->price_min && (price2num($pu_ht)*(1-price2num($_POST['remise_percent'])/100) < price2num($prod->price_min)))
|
||||
if($price_min && (price2num($pu_ht)*(1-price2num($_POST['remise_percent'])/100) < price2num($price_min)))
|
||||
{
|
||||
$object->error = $langs->trans("CantBeLessThanMinPrice",price2num($prod->price_min,'MU').' '.$langs->trans("Currency".$conf->monnaie)) ;
|
||||
$result = -1 ;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user