Rerun of Aged Supplier List.
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Thu, 28 Apr 2011 19:52:26 +0000 (21:52 +0200)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Thu, 28 Apr 2011 19:52:26 +0000 (21:52 +0200)
purchasing/includes/db/suppliers_db.inc
reporting/rep202.php

index 17bd33f2e46765cb4d3ee65e0857c34b50d0db00..6630dd2a991de2bde0f3d3d12c8ad930173ab443 100644 (file)
@@ -109,7 +109,7 @@ function get_supplier_details($supplier_id, $to=null, $all=true)
                         supp.payment_terms = ".TB_PREF."payment_terms.terms_indicator
                         AND supp.supplier_id = $supplier_id ";
        if (!$all)
-               $sql .= "AND ABS(trans.ov_amount + trans.ov_gst + trans.ov_discount - trans.alloc) > 0.004 ";  
+               $sql .= "AND ABS(trans.ov_amount + trans.ov_gst + trans.ov_discount) - trans.alloc > 0.004 ";  
        $sql .= "GROUP BY
                          supp.supp_name,
                          ".TB_PREF."payment_terms.terms,
index 761186f02c66ac8165aee093b041c6d5f1be9d37..4cf9809560c55f0002a3ae25f580ab3f8d8b7cd5 100644 (file)
@@ -56,7 +56,7 @@ function get_invoices($supplier_id, $to, $all=true)
                        AND ".TB_PREF."supp_trans.tran_date <= '$todate'
                        AND ABS(".TB_PREF."supp_trans.ov_amount + ".TB_PREF."supp_trans.ov_gst + ".TB_PREF."supp_trans.ov_discount) > 0.004 ";
        if (!$all)
-               $sql .= "AND ABS(".TB_PREF."supp_trans.ov_amount + ".TB_PREF."supp_trans.ov_gst + ".TB_PREF."supp_trans.ov_discount - ".TB_PREF."supp_trans.alloc) > 0.004 ";  
+               $sql .= "AND ABS(".TB_PREF."supp_trans.ov_amount + ".TB_PREF."supp_trans.ov_gst + ".TB_PREF."supp_trans.ov_discount) - ".TB_PREF."supp_trans.alloc > 0.004 ";  
        $sql .= "ORDER BY ".TB_PREF."supp_trans.tran_date";