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:
parent
39bc4d5f02
commit
75a9178549
@ -4560,7 +4560,7 @@ abstract class CommonObject
|
|||||||
$productFournisseur = new ProductFournisseur($this->db);
|
$productFournisseur = new ProductFournisseur($this->db);
|
||||||
if (($result = $productFournisseur->find_min_price_product_fournisseur($fk_product)) > 0)
|
if (($result = $productFournisseur->find_min_price_product_fournisseur($fk_product)) > 0)
|
||||||
{
|
{
|
||||||
$buyPrice = $productFournisseur->fourn_price;
|
$buyPrice = $productFournisseur->fourn_unitprice;
|
||||||
}
|
}
|
||||||
else if ($result < 0)
|
else if ($result < 0)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user