// Fixed #PSFV-521

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@13461 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
bMancone
2012-02-20 13:58:19 +00:00
parent 5bd4b07db0
commit 8fc5329fe9
+6 -2
View File
@@ -3960,12 +3960,16 @@ class ProductCore extends ObjectModel
*/
public function addStockMvt($quantity, $id_reason, $id_product_attribute = null, $id_order = null, $id_employee = null)
{
if (!$this->id)
return;
if (!$this->id || !$id_reason)
return false;
if ($id_product_attribute == null)
$id_product_attribute = 0;
$reason = new StockMvtReason((int)$id_reason);
if (!Validate::isLoadedObject($reason))
return false;
$quantity = abs((int)$quantity) * $reason->sign;
return StockAvailable::updateQuantity($this->id, $id_product_attribute, $quantity);