Skip to content

Commit

Permalink
Fix defineBuyPrice no min price is not error
Browse files Browse the repository at this point in the history
No min buy price is not error, return 0 if no buyprice set
  • Loading branch information
fappels committed Nov 21, 2015
1 parent 0892724 commit ecd3114
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions htdocs/core/class/commonobject.class.php
Expand Up @@ -4221,7 +4221,7 @@ public function defineBuyPrice($unitPrice = 0, $discountPercent = 0, $fk_product
$result = $product->fetch($fk_product);
if ($result <= 0)
{
$this->error='ErrorProductIdDoesNotExists';
$this->errors[] = 'ErrorProductIdDoesNotExists';
return -1;
}
if (($product->pmp > 0))
Expand All @@ -4238,10 +4238,10 @@ public function defineBuyPrice($unitPrice = 0, $discountPercent = 0, $fk_product
{
$buyPrice = $productFournisseur->fourn_price;
}
else
else if ($result < 0)
{
$this->error = $productFournisseur->error;
return -1;
$this->errors[] = $productFournisseur->error;
return -2;
}
}
}
Expand Down

0 comments on commit ecd3114

Please sign in to comment.