From a93a86b51ea4375cf84da71ddaf3e24264f652c9 Mon Sep 17 00:00:00 2001 From: bMancone Date: Mon, 27 Feb 2012 16:15:50 +0000 Subject: [PATCH] // Improved Supply Orders threshold when creating a template --- controllers/admin/AdminSupplyOrdersController.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/controllers/admin/AdminSupplyOrdersController.php b/controllers/admin/AdminSupplyOrdersController.php index c6af5b13f..862a9f639 100644 --- a/controllers/admin/AdminSupplyOrdersController.php +++ b/controllers/admin/AdminSupplyOrdersController.php @@ -2024,8 +2024,14 @@ class AdminSupplyOrdersControllerCore extends AdminController $manager = StockManagerFactory::getManager(); foreach ($items as $item) { - $real_quantity = (int)$manager->getProductRealQuantities($item['id_product'], $item['id_product_attribute'], $supply_order->id_warehouse, true); - $diff = (int)$threshold - (int)$real_quantity; + if ($supply_order->is_template != 0) + { + $real_quantity = (int)$manager->getProductRealQuantities($item['id_product'], $item['id_product_attribute'], $supply_order->id_warehouse, true); + $diff = (int)$threshold - (int)$real_quantity; + } + else + $diff = (int)$threshold; + if ($diff > 0) { // sets supply_order_detail