From: Maxime Bourget Date: Tue, 11 Jun 2013 21:33:57 +0000 (+0100) Subject: Fix Available quantity and help quantity in summary. X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=dbb33a5d4bd7256adcea4a14fcf1c576ec3fe06a;p=order_line_extra.git Fix Available quantity and help quantity in summary. --- 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