// Introduct "PS_ADVANCED_STOCK_MANAGEMENT", the new stock management
This commit is contained in:
@@ -91,8 +91,10 @@ class OrderHistoryCore extends ObjectModel
|
||||
/* If becoming unlogable => removing sale */
|
||||
else if (!$newOS->logable AND ($oldOrderStatus AND $oldOrderStatus->logable))
|
||||
ProductSale::removeProductSale($product['id_product'], $product['cart_quantity']);
|
||||
// The product is removed from the physical stock. $id_warehouse is needed
|
||||
if ($newOS->shipped == 1 && $oldOrderStatus->shipped == 0)
|
||||
|
||||
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
|
||||
Stock::updateQuantity($product['id_product'], $product['id_product_attribute'], -$product['cart_quantity'], $id_warehouse, $id_order);
|
||||
// @todo If the old order states was "shipped" and the new is "not shipped" the stock is not decremented
|
||||
}
|
||||
|
||||
@@ -239,7 +239,8 @@ INSERT INTO `PREFIX_configuration` (`id_configuration`, `name`, `value`, `date_a
|
||||
(151, 'PS_SHOP_DEFAULT', '1', NOW(), NOW()),
|
||||
(152, 'PS_CARRIER_DEFAULT_SORT', '0', NOW(), NOW()),
|
||||
(153, 'PS_STOCK_MVT_INC_REASON_DEFAULT', '1', NOW(), NOW()),
|
||||
(154, 'PS_STOCK_MVT_DEC_REASON_DEFAULT', '2', NOW(), NOW());
|
||||
(154, 'PS_STOCK_MVT_DEC_REASON_DEFAULT', '2', NOW(), NOW()),
|
||||
(155, 'PS_ADVANCED_STOCK_MANAGEMENT', '1', NOW(), NOW());
|
||||
|
||||
INSERT INTO `PREFIX_configuration_lang` (`id_configuration`, `id_lang`, `value`, `date_upd`) VALUES
|
||||
(36, 1, 'IN', NOW()),(36, 2, 'FA', NOW()),(36, 3, 'CU', NOW()),(36, 4, 'FA', NOW()),(36, 5, 'FA', NOW()),
|
||||
|
||||
Reference in New Issue
Block a user