// StockManager: updated getProductRealQuantities(). StockAvailable: fixed.

This commit is contained in:
bMancone
2011-11-16 17:55:39 +00:00
parent e4b4548349
commit 76e5b363ea
3 changed files with 57 additions and 47 deletions
+2 -1
View File
@@ -453,7 +453,6 @@ class StockManagerCore implements StockManagerInterface
$ids_warehouse = array();
// Gets client_orders_qty
// @TODO: Add the warehouse the order will be shipped from
$query = new DbQuery();
$query->select('SUM(od.product_quantity)');
$query->from('order_detail od');
@@ -463,6 +462,8 @@ class StockManagerCore implements StockManagerInterface
$query->where('od.product_attribute_id = '.(int)$id_product_attribute);
$query->where('o.delivery_number = 0');
$query->where('o.valid = 1');
// @FIXME: Once part-shipping is done, remove the comment on the line below.
// $query->where('o.id_warehouse IN (0, '.implode(', ', $ids_warehouse).')');
$client_orders_qty = (int)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($query);
// Gets supply_orders_qty