// OrderHistory : fixed r11441
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11471 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -81,14 +81,16 @@ class OrderHistoryCore extends ObjectModel
|
|||||||
{
|
{
|
||||||
/* If becoming logable => adding sale */
|
/* If becoming logable => adding sale */
|
||||||
if ($newOS->logable
|
if ($newOS->logable
|
||||||
&& $oldOrderStatus instanceof OrderHistory
|
&& !($oldOrderStatus instanceof OrderState
|
||||||
&& $oldOrderStatus->logable)
|
&& $oldOrderStatus->logable))
|
||||||
{
|
{
|
||||||
ProductSale::addProductSale($product['product_id'], $product['product_quantity']);
|
ProductSale::addProductSale($product['product_id'], $product['product_quantity']);
|
||||||
|
// @since 1.5.0
|
||||||
|
StockAvailable::updateQuantity($product['product_id'], $product['product_attribute_id'], -(int)$product['product_quantity'], $order->id_shop);
|
||||||
}
|
}
|
||||||
/* If becoming unlogable => removing sale */
|
/* If becoming unlogable => removing sale */
|
||||||
else if (!$newOS->logable
|
else if (!$newOS->logable
|
||||||
&& $oldOrderStatus instanceof OrderHistory
|
&& $oldOrderStatus instanceof OrderState
|
||||||
&& $oldOrderStatus->logable)
|
&& $oldOrderStatus->logable)
|
||||||
{
|
{
|
||||||
ProductSale::removeProductSale($product['product_id'], $product['product_quantity']);
|
ProductSale::removeProductSale($product['product_id'], $product['product_quantity']);
|
||||||
@@ -99,7 +101,7 @@ class OrderHistoryCore extends ObjectModel
|
|||||||
if ((!Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') || (int)$product['advanced_stock_management'] != 1)
|
if ((!Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') || (int)$product['advanced_stock_management'] != 1)
|
||||||
&& !$isValidated
|
&& !$isValidated
|
||||||
&& $newOS->logable
|
&& $newOS->logable
|
||||||
&& $oldOrderStatus instanceof OrderHistory
|
&& $oldOrderStatus instanceof OrderState
|
||||||
&& $oldOrderStatus->id == Configuration::get('PS_OS_ERROR')
|
&& $oldOrderStatus->id == Configuration::get('PS_OS_ERROR')
|
||||||
)
|
)
|
||||||
StockAvailable::updateQuantity($product['product_id'], $product['product_attribute_id'], (int)$product['product_quantity'], $order->id_shop);
|
StockAvailable::updateQuantity($product['product_id'], $product['product_attribute_id'], (int)$product['product_quantity'], $order->id_shop);
|
||||||
@@ -108,7 +110,7 @@ class OrderHistoryCore extends ObjectModel
|
|||||||
// The product is removed from the physical stock. $id_warehouse is needed
|
// The product is removed from the physical stock. $id_warehouse is needed
|
||||||
// @TODO Checks $id_warehouse
|
// @TODO Checks $id_warehouse
|
||||||
else if ($newOS->shipped == 1
|
else if ($newOS->shipped == 1
|
||||||
&& $oldOrderStatus instanceof OrderHistory
|
&& $oldOrderStatus instanceof OrderState
|
||||||
&& $oldOrderStatus->shipped == 0
|
&& $oldOrderStatus->shipped == 0
|
||||||
&& Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')
|
&& Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')
|
||||||
&& (int)$product['advanced_stock_management'] == 1
|
&& (int)$product['advanced_stock_management'] == 1
|
||||||
@@ -133,7 +135,7 @@ class OrderHistoryCore extends ObjectModel
|
|||||||
StockAvailable::updateQuantity($product['product_id'], $product['product_attribute_id'], -(int)$product['product_quantity'], $order->id_shop);
|
StockAvailable::updateQuantity($product['product_id'], $product['product_attribute_id'], -(int)$product['product_quantity'], $order->id_shop);
|
||||||
}
|
}
|
||||||
else if ($newOS->shipped == 0
|
else if ($newOS->shipped == 0
|
||||||
&& $oldOrderStatus instanceof OrderHistory
|
&& $oldOrderStatus instanceof OrderState
|
||||||
&& $oldOrderStatus->shipped == 1
|
&& $oldOrderStatus->shipped == 1
|
||||||
&& Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')
|
&& Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')
|
||||||
&& (int)$product['advanced_stock_management'] == 1
|
&& (int)$product['advanced_stock_management'] == 1
|
||||||
|
|||||||
Reference in New Issue
Block a user