// StockManager : bugs fix + improvement of StockManager utilisation in fucntion of global configuration

This commit is contained in:
dSevere
2011-12-02 15:23:01 +00:00
parent 5259d4e64e
commit 6fddfce5e7
6 changed files with 53 additions and 41 deletions
+4 -1
View File
@@ -94,7 +94,10 @@ class OrderHistoryCore extends ObjectModel
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']);
else if ($newOS->shipped == 1 && $oldOrderStatus->shipped == 0) // The product is removed from the physical stock. $id_warehouse is needed
// 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
else if ($newOS->shipped == 1 && $oldOrderStatus->shipped == 0 && Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT'))
{
$manager = StockManagerFactory::getManager();
$warehouse = new Warehouse($id_warehouse);