From: Joe Hunt Date: Fri, 22 Sep 2017 21:36:38 +0000 (+0200) Subject: Bug in presenting ST_JOURNAL in AR/AP Reports. X-Git-Tag: v2.4.3~37 X-Git-Url: https://delta.frontaccounting.com/gitweb/?p=fa-stable.git;a=commitdiff_plain;h=d8ebbcd57414b1b57f6f422f00516646b21ada53 Bug in presenting ST_JOURNAL in AR/AP Reports. --- diff --git a/reporting/rep108.php b/reporting/rep108.php index b4799541..2f20bb63 100644 --- a/reporting/rep108.php +++ b/reporting/rep108.php @@ -137,7 +137,8 @@ function print_statements() $rep->TextCol(2, 3, sql2date($myrow2['tran_date']), -2); if ($myrow2['type'] == ST_SALESINVOICE) $rep->TextCol(3, 4, sql2date($myrow2['due_date']), -2); - if ($myrow2['type'] == ST_SALESINVOICE || $myrow2['type'] == ST_BANKPAYMENT) + if ($myrow2['type'] == ST_SALESINVOICE || $myrow2['type'] == ST_BANKPAYMENT || + ($myrow2['type'] == ST_JOURNAL && $myrow2["TotalAmount"] > 0.0)) $rep->TextCol(4, 5, $DisplayTotal, -2); else $rep->TextCol(5, 6, $DisplayTotal, -2); diff --git a/sales/includes/db/customers_db.inc b/sales/includes/db/customers_db.inc index 3b6ac631..bc1dcbd9 100644 --- a/sales/includes/db/customers_db.inc +++ b/sales/includes/db/customers_db.inc @@ -70,7 +70,7 @@ function get_customer_details($customer_id, $to=null, $all=true) $past1 = get_company_pref('past_due_days'); $past2 = 2 * $past1; // removed - debtor_trans.alloc from all summations - $sign = "IF(`type` IN(".implode(',', array(ST_CUSTCREDIT,ST_CUSTPAYMENT,ST_BANKDEPOSIT,ST_JOURNAL))."), -1, 1)"; + $sign = "IF(`type` IN(".implode(',', array(ST_CUSTCREDIT,ST_CUSTPAYMENT,ST_BANKDEPOSIT))."), -1, 1)"; if ($all) $value = "IFNULL($sign*(trans.ov_amount + trans.ov_gst + trans.ov_freight + trans.ov_freight_tax + trans.ov_discount),0)"; else