Fix problem about unit buy price fetching

To fix a bug encountered at customer shop about margin calculation. In some case, returned buy price is total buy price from provider and not unit buy price.
Case opened on forum: http://www.dolibarr.fr/forum/527-bugs-sur-la-version-stable-courante/55467-calcul-des-marges
This commit is contained in:
esprit libre 2016-04-27 16:42:59 +02:00
parent 39bc4d5f02
commit 75a9178549

View File

@ -4560,7 +4560,7 @@ abstract class CommonObject
$productFournisseur = new ProductFournisseur($this->db);
if (($result = $productFournisseur->find_min_price_product_fournisseur($fk_product)) > 0)
{
$buyPrice = $productFournisseur->fourn_price;
$buyPrice = $productFournisseur->fourn_unitprice;
}
else if ($result < 0)
{