Fix defineBuyPrice no min price is not error

No min buy price is not error, return 0 if no buyprice set
This commit is contained in:
fappels 2015-11-21 12:35:45 +01:00
parent 0892724ffe
commit ecd3114683

View File

@ -4221,7 +4221,7 @@ abstract class CommonObject
$result = $product->fetch($fk_product);
if ($result <= 0)
{
$this->error='ErrorProductIdDoesNotExists';
$this->errors[] = 'ErrorProductIdDoesNotExists';
return -1;
}
if (($product->pmp > 0))
@ -4238,10 +4238,10 @@ abstract class CommonObject
{
$buyPrice = $productFournisseur->fourn_price;
}
else
else if ($result < 0)
{
$this->error = $productFournisseur->error;
return -1;
$this->errors[] = $productFournisseur->error;
return -2;
}
}
}