// Updated re-stock

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11139 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
bMancone
2011-12-12 15:25:51 +00:00
parent 415299a7aa
commit 6f80da5b2b
2 changed files with 7 additions and 2 deletions

View File

@@ -93,10 +93,14 @@ class OrderHistoryCore extends ObjectModel
}
/* If becoming unlogable => removing sale */
elseif (!$newOS->logable AND ($oldOrderStatus AND $oldOrderStatus->logable))
{
ProductSale::removeProductSale($product['id_product'], $product['cart_quantity']);
// @since 1.5.0
StockAvailable::updateQuantity($product['id_product'], $product['id_product_attribute'], (int)$product['cart_quantity'], $order->id_shop);
}
if (!Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') && !$isValidated AND $newOS->logable AND isset($oldOrderStatus) AND $oldOrderStatus AND $oldOrderStatus->id == Configuration::get('PS_OS_ERROR'))
StockAvailable::updateQuantity($product['id_product'], $product['id_product_attribute'], (int)$product['cart_quantity']);
StockAvailable::updateQuantity($product['id_product'], $product['id_product_attribute'], (int)$product['cart_quantity'], $order->id_shop);
// If order is shipped for the first time and
// if we use advanced stock management system, decrement stock preperly.
// The product is removed from the physical stock. $id_warehouse is needed
@@ -134,6 +138,7 @@ class OrderHistoryCore extends ObjectModel
true
);
}
StockAvailable::synchronize($product['id_product']);
}
}

View File

@@ -196,7 +196,7 @@ class StockMvtCore extends ObjectModel
}
/**
* Gets the negative stock mvts that corresponds to the given order, for the given product, in the given quantity
* Gets the negative stock mvts that correspond to the given order, for the given product, in the given quantity
*
* @since 1.5.0
* @param int $id_order