// Stock decrementation

This commit is contained in:
mDeflotte committed 2011-12-09 13:09:32 +00:00
1 parent 7a11664ad1
commit e6c523a2b1
1 file changed
+3
+3
View File
@@ -87,7 +87,10 @@ class OrderHistoryCore extends ObjectModel
{ {
/* If becoming logable => adding sale */ /* If becoming logable => adding sale */
if ($newOS->logable AND (!$oldOrderStatus OR !$oldOrderStatus->logable)) if ($newOS->logable AND (!$oldOrderStatus OR !$oldOrderStatus->logable))
{
ProductSale::addProductSale($product['id_product'], $product['cart_quantity']); ProductSale::addProductSale($product['id_product'], $product['cart_quantity']);
StockAvailable::updateQuantity($product['id_product'], $product['id_product_attribute'], -(int)$product['cart_quantity']);
}
/* If becoming unlogable => removing sale */ /* If becoming unlogable => removing sale */
elseif (!$newOS->logable AND ($oldOrderStatus AND $oldOrderStatus->logable)) elseif (!$newOS->logable AND ($oldOrderStatus AND $oldOrderStatus->logable))
ProductSale::removeProductSale($product['id_product'], $product['cart_quantity']); ProductSale::removeProductSale($product['id_product'], $product['cart_quantity']);