From dbb33a5d4bd7256adcea4a14fcf1c576ec3fe06a Mon Sep 17 00:00:00 2001 From: Maxime Bourget Date: Tue, 11 Jun 2013 22:33:57 +0100 Subject: [PATCH] Fix Available quantity and help quantity in summary. --- includes/order_lines.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/order_lines.inc b/includes/order_lines.inc index 6ab910c..0e5a83f 100644 --- a/includes/order_lines.inc +++ b/includes/order_lines.inc @@ -283,8 +283,8 @@ function get_order_summary($location) { , `min(delivery_date)` as delivery_date , sum(sub.quantity) as quantity , sum(sub.amount) as amount - , sum(greatest(least(sub.quantity, qoh.quantity - quantity_before - quantity_held), 0)) - , sum(sub.amount*greatest(least(sub.quantity, qoh.quantity - quantity_before - quantity_held), 0)/sub.quantity) + , sum(greatest(least(sub.quantity -quantity_held, qoh.quantity - quantity_before), 0)) + , sum(sub.amount*greatest(least(sub.quantity -quantity_held, qoh.quantity - quantity_before), 0)/sub.quantity) , sum(quantity_held) as quantity_help , min(`min(required_date)`) as required_date , group_concat(distinct order_comment separator ';') as order_comment -- 2.30.2