From 8feb695afa47e4e2fa7aa5477be06551ae522432 Mon Sep 17 00:00:00 2001 From: Maxime Bourget Date: Sun, 16 Jun 2013 12:29:21 +0100 Subject: [PATCH] Show picked item as available even if quantity override. --- includes/order_lines.inc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/includes/order_lines.inc b/includes/order_lines.inc index d961b89..fbda028 100644 --- a/includes/order_lines.inc +++ b/includes/order_lines.inc @@ -245,7 +245,9 @@ function get_order_details_extra($customer_id, $location, $item_like, $order_id) , so.order_no , stk_code , sod.quantity - qty_sent quantity - , GREATEST(0, LEAST(qoh.quantity - quantity_before - COALESCE(tp.quantity,0) + COALESCE(p.quantity, 0) , sod.quantity - qty_sent)) AS available + , GREATEST(0 + , LEAST(qoh.quantity - quantity_before - COALESCE(tp.quantity,0) + COALESCE(p.quantity, 0) , sod.quantity - qty_sent) + , COALESCE(p.quantity, 0)) AS available , quantity_before , qoh.quantity AS qoh , p.quantity AS quantity_to_pick @@ -297,7 +299,9 @@ function get_order_summary($location) { , GROUP_CONCAT(distinct comments separator ';') AS order_comment , GROUP_CONCAT(distinct comment separator ';') AS detail_comment , MAX(quantity_before) AS quantity_before - , @available := GREATEST(LEAST(d.quantity, COALESCE(qoh.quantity,0) - COALESCE(tp.quantity,0) + COALESCE(p.quantity,0) - quantity_before), 0) + , @available := GREATEST(LEAST(d.quantity, COALESCE(qoh.quantity,0) - COALESCE(tp.quantity,0) + COALESCE(p.quantity,0) - quantity_before) + , 0 + , COALESCE(p.quantity, 0) ) , SUM(IF($held_condition, @available , 0)) AS quantity_held , SUM(IF($held_condition, 0, @available)) AS available_quantity , SUM(IF($held_condition, 0, @available*unit_price*(1-discount_percent/100))) AS available_amount -- 2.30.2