From: Joe Hunt Date: Wed, 6 Apr 2011 23:02:58 +0000 (+0200) Subject: Rerun of Sales Summary Report X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=4f43d5d49aa02f3407328534491a119e5778f38b;p=textcart.git Rerun of Sales Summary Report --- diff --git a/reporting/rep114.php b/reporting/rep114.php index 96f743e..1173598 100644 --- a/reporting/rep114.php +++ b/reporting/rep114.php @@ -34,7 +34,7 @@ function getTaxTransactions($from, $to, $tax_id) $todate = date2sql($to); $sql = "SELECT d.debtor_no, d.name AS cust_name, d.tax_id, - CASE WHEN net_amount IS NULL THEN + CASE WHEN net_amount IS NULL OR amount=0 THEN SUM(CASE WHEN dt.type=".ST_CUSTCREDIT." THEN (ov_amount+ov_freight+ov_discount)*-1 ELSE (ov_amount+ov_freight+ov_discount) END *dt.rate) ELSE SUM(CASE WHEN dt.type=".ST_CUSTCREDIT." THEN -net_amount ELSE net_amount END *ex_rate) END AS total,