4859: The Outstanding in Customer Balance is Not Ok with Journal Entry. Fixed by...
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Fri, 22 Feb 2019 22:30:45 +0000 (23:30 +0100)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Fri, 22 Feb 2019 22:30:45 +0000 (23:30 +0100)
reporting/rep101.php

index dc81dd5a4e4590ffcabe5ca6e24974032e42821b..900678ad7a9f6d62ad358c51a58bd43502ee0c3e 100644 (file)
@@ -239,7 +239,7 @@ function print_customer_balances()
                                $item[2] = round2($trans['Allocated'] * $rate, $dec) * -1;
                        }
                        $rep->AmountCol(6, 7, $item[2], $dec);
-                       if ($trans['type'] == ST_JOURNAL || $trans['type'] == ST_SALESINVOICE || $trans['type'] == ST_BANKPAYMENT)
+                       if (($trans['type'] == ST_JOURNAL && $item[0]) || $trans['type'] == ST_SALESINVOICE || $trans['type'] == ST_BANKPAYMENT)
                                $item[3] = $item[0] - $item[2];
                        else    
                                $item[3] = -$item[1] - $item[2];