Fixed Logical Bug in Customer Balances Report.
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 29 Aug 2017 15:01:23 +0000 (17:01 +0200)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 29 Aug 2017 15:01:23 +0000 (17:01 +0200)
reporting/rep101.php

index 634b2d69bf78c1f1c926c3ba50a416671be05c01..7b8e8f20ecdc70029112e3d0008f88f42c686310 100644 (file)
@@ -203,7 +203,13 @@ function print_customer_balances()
                }
                while ($trans = db_fetch($res))
                {
-                       if ($no_zeros && floatcmp($trans['TotalAmount'], $trans['Allocated']) == 0) continue;
+            if ($no_zeros) {
+                if ($show_balance) {
+                    if ($trans['TotalAmount'] == 0) continue;
+                } else {
+                    if (floatcmp($trans['TotalAmount'], $trans['Allocated']) == 0) continue;
+                }
+            }
                        $rep->NewLine(1, 2);
                        $rep->TextCol(0, 1, $systypes_array[$trans['type']]);
                        $rep->TextCol(1, 2,     $trans['reference']);