Bug [0000112] It shows invoices as overdue still (in red), even though its been payed...
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Thu, 22 Jan 2009 01:17:24 +0000 (01:17 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Thu, 22 Jan 2009 01:17:24 +0000 (01:17 +0000)
CHANGELOG.txt
sales/inquiry/customer_inquiry.php

index 1fc3b204f8a680662a9507f5a341174882690da7..c4df5ea77aeea6881aff636be3e196bf18b828f3 100644 (file)
@@ -19,6 +19,10 @@ Legend:
 ! -> Note
 $ -> Affected files
 
+22-Jan-2009 Joe Hunt
+# Bug [0000112] It shows invoices as overdue still (in red), even though its been payed and allocated. 
+$ /sales/inquiry/customer_inquiry.php
+
 13-Jan-2009 Joe Hunt
 # Bug [0000111] Accounts on Credit Hold can still process delivery notes on sales order and invoicing.
 $ /sales/customer_delivery.php
index ebd55aeac424127a454b89d6c0c779854aed2250..89d7735307a4e4e81d116ae50a737b25f0d66817 100644 (file)
@@ -90,7 +90,8 @@ function get_transactions()
 {
     $date_after = date2sql($_POST['TransAfterDate']);
     $date_to = date2sql($_POST['TransToDate']);
-
+       $dec = user_price_dec();
+       
     $sql = "SELECT ".TB_PREF."debtor_trans.*,
                ".TB_PREF."debtors_master.name AS CustName, ".TB_PREF."debtors_master.curr_code AS CustCurrCode,
                (".TB_PREF."debtor_trans.ov_amount + ".TB_PREF."debtor_trans.ov_gst + "
@@ -98,9 +99,9 @@ function get_transactions()
                AS TotalAmount, ".TB_PREF."debtor_trans.alloc AS Allocated,
                ((".TB_PREF."debtor_trans.type = 10)
                        AND (".TB_PREF."debtor_trans.due_date < '" . date2sql(Today()) . "')
-                       AND ((".TB_PREF."debtor_trans.ov_amount + "
-                         .TB_PREF."debtor_trans.ov_gst + "
-                         .TB_PREF."debtor_trans.ov_freight )>".TB_PREF."debtor_trans.alloc
+                       AND ((".TB_PREF."debtor_trans.ov_amount + 
+                               ROUND(".TB_PREF."debtor_trans.ov_gst,$dec) + "
+                         .TB_PREF."debtor_trans.ov_freight + ".TB_PREF."debtor_trans.ov_freight_tax)>".TB_PREF."debtor_trans.alloc
                )) AS OverDue
                FROM ".TB_PREF."debtor_trans, ".TB_PREF."debtors_master
                WHERE ".TB_PREF."debtors_master.debtor_no = ".TB_PREF."debtor_trans.debtor_no