// 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:
@@ -93,10 +93,14 @@ class OrderHistoryCore extends ObjectModel
|
|||||||
}
|
}
|
||||||
/* 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']);
|
||||||
|
// @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'))
|
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 order is shipped for the first time and
|
||||||
// if we use advanced stock management system, decrement stock preperly.
|
// if we use advanced stock management system, decrement stock preperly.
|
||||||
// The product is removed from the physical stock. $id_warehouse is needed
|
// The product is removed from the physical stock. $id_warehouse is needed
|
||||||
@@ -134,6 +138,7 @@ class OrderHistoryCore extends ObjectModel
|
|||||||
true
|
true
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
StockAvailable::synchronize($product['id_product']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
* @since 1.5.0
|
||||||
* @param int $id_order
|
* @param int $id_order
|
||||||
|
|||||||
Reference in New Issue
Block a user