Bug in presenting ST_JOURNAL in AR/AP Reports.
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Fri, 22 Sep 2017 21:36:38 +0000 (23:36 +0200)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Fri, 22 Sep 2017 21:36:38 +0000 (23:36 +0200)
reporting/rep108.php
sales/includes/db/customers_db.inc

index b47995418ed70f2ec718226f293d6dd0d3cf4470..2f20bb6394d7de623eba46d9ef0b682006e84f8b 100644 (file)
@@ -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);
index 3b6ac6315cd0f86fce9f4fe26413520e8318f040..bc1dcbd90f4cf93214570a9bce83f4176773fb4d 100644 (file)
@@ -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