[0000225] Supplier Payment Report showing paid invoices (rounding problem)
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 4 May 2010 09:10:47 +0000 (09:10 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 4 May 2010 09:10:47 +0000 (09:10 +0000)
CHANGELOG.txt
reporting/rep203.php

index f732a28c613c529f6785ec0d4460c22435e01c78..e6cdb59b9180565bb2728bf71d0638b20084eb27 100644 (file)
@@ -19,10 +19,14 @@ Legend:
 ! -> Note
 $ -> Affected files
 
+04-May-2010 Joe Hunt
+# [0000225] Supplier Payment Report showing paid invoices (rounding problem)
+$ /reporting/rep203.php
+
 26-Apr-2010 Joe Hunt
 ! Allowing the Tax Report to be printed to Excel/OO Calc
 $ /reporting/rep709.php
-  /reports_main.php
+  /reporting/reports_main.php
   /reporting/includes/excel_report.inc
   
 21-Apr-2010 Joe Hunt
index 27eef02b5dd538a10c2975d8f47bdf98dbe7b6e0..7c9072746b1392e46cba2b8dd9aecd22504561f5 100644 (file)
@@ -30,6 +30,7 @@ print_payment_report();
 function getTransactions($supplier, $date)
 {
        $date = date2sql($date);
+       $dec = user_price_dec();
 
        $sql = "SELECT ".TB_PREF."supp_trans.supp_reference,
                        ".TB_PREF."supp_trans.tran_date,
@@ -41,7 +42,8 @@ function getTransactions($supplier, $date)
                        (ABS(".TB_PREF."supp_trans.ov_amount) + ABS(".TB_PREF."supp_trans.ov_gst) ) AS TranTotal
                FROM ".TB_PREF."supp_trans
                WHERE ".TB_PREF."supp_trans.supplier_id = '" . $supplier . "'
-               AND ABS(".TB_PREF."supp_trans.ov_amount) + ABS(".TB_PREF."supp_trans.ov_gst) - ".TB_PREF."supp_trans.alloc != 0
+               AND ROUND(ABS(".TB_PREF."supp_trans.ov_amount),$dec) + ROUND(ABS(".TB_PREF."supp_trans.ov_gst),$dec) - 
+               ROUND(".TB_PREF."supp_trans.alloc,$dec) != 0
                AND ".TB_PREF."supp_trans.tran_date <='" . $date . "'
                ORDER BY ".TB_PREF."supp_trans.type,
                        ".TB_PREF."supp_trans.trans_no";