From: Joe Hunt Date: Sat, 13 Jun 2020 07:17:55 +0000 (+0200) Subject: Delivery Against Sales Order Inquiry View, Wrong Remainder Value. Fixed. X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=406b264c2ff690cdfcd797aea92ba137baee8c8f;p=fa-stable.git Delivery Against Sales Order Inquiry View, Wrong Remainder Value. Fixed. --- diff --git a/sales/includes/db/sales_order_db.inc b/sales/includes/db/sales_order_db.inc index efbf7ae0..a6bb878c 100644 --- a/sales/includes/db/sales_order_db.inc +++ b/sales/includes/db/sales_order_db.inc @@ -464,6 +464,10 @@ function get_branch_to_order($customer_id, $branch_id) { function get_sql_for_sales_orders_view($trans_type, $trans_no, $filter, $stock_item='', $from='', $to='', $ref='', $location=ALL_TEXT, $customer_id=ALL_TEXT) { + if ($filter=='OutstandingOnly') + $order_value = 'Sum(line.unit_price*(line.quantity-line.qty_sent)*(1-line.discount_percent))+freight_cost'; + else + $order_value = 'Sum(line.unit_price*line.quantity*(1-line.discount_percent))+freight_cost'; $sql = "SELECT sorder.order_no, @@ -476,7 +480,7 @@ function get_sql_for_sales_orders_view($trans_type, $trans_no, $filter, ."sorder.ord_date, sorder.delivery_date, sorder.deliver_to, - Sum(line.unit_price*line.quantity*(1-line.discount_percent))+freight_cost AS OrderValue, + $order_value AS OrderValue, sorder.type, debtor.curr_code, Sum(line.qty_sent) AS TotDelivered,