From a99653fce122d27ae72793df0b42b9f3c573677d Mon Sep 17 00:00:00 2001 From: dSevere Date: Mon, 10 Oct 2011 16:31:47 +0000 Subject: [PATCH] // update getProductRealQuantities method --- classes/stock/StockManager.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/classes/stock/StockManager.php b/classes/stock/StockManager.php index 366009496..cbc9c64bf 100644 --- a/classes/stock/StockManager.php +++ b/classes/stock/StockManager.php @@ -415,12 +415,14 @@ class StockManagerCore implements StockManagerInterface $query->leftjoin('orders o ON o.id_order = od.id_order'); $query->where('od.product_id = '.(int)$id_product.' AND od.product_attribute_id = '.(int)$id_product_attribute); $query->where('o.delivery_number = 0'); + $query->where('o.valid = 1'); $clients_orders_qty = (int)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($query); // Gets {physical OR usable}_qty $qty = $this->getProductPhysicalQuantities($id_product, $id_product_attribute, $warehouses_id, $usable); // Returns real_qty = qty - clients_orders_qty + // @TODO include suplliers orders in the calcul when they will be implemented return ($qty - $clients_orders_qty); }