From 46a859550ab29eab842e9319500e74f27d2a1c24 Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Thu, 22 Jan 2009 01:17:24 +0000 Subject: [PATCH] Bug [0000112] It shows invoices as overdue still (in red), even though its been payed and allocated. --- CHANGELOG.txt | 4 ++++ sales/inquiry/customer_inquiry.php | 9 +++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 1fc3b204..c4df5ea7 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -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 diff --git a/sales/inquiry/customer_inquiry.php b/sales/inquiry/customer_inquiry.php index ebd55aea..89d77353 100644 --- a/sales/inquiry/customer_inquiry.php +++ b/sales/inquiry/customer_inquiry.php @@ -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 -- 2.30.2