From cad609a6e50c409a5d49608dd08055dcf6278626 Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Sun, 8 Nov 2009 14:29:58 +0000 Subject: [PATCH] Changed the Running Balance column in Customer Transaction to only show when the type is selected. The order is not good before sorting in date order --- CHANGELOG.txt | 4 ++++ sales/inquiry/customer_inquiry.php | 18 +++++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 9a60ee64..810cc8f7 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -26,6 +26,10 @@ $ /sales/inquiry/sales_orders_view.php $ /purchasing/includes/ui/invoice_ui.inc /purchasing/view/view_po.php /sales/view/view_sales_order.php +! Changed the Running Balance column in Customer Transaction + to only show when the type is selected. The order is not + good before sorting in date order +$ /sales/inquiry/customer_inquiry.php 07-Nov-2009 Janusz Dobrowolski # Added missing help_context diff --git a/sales/inquiry/customer_inquiry.php b/sales/inquiry/customer_inquiry.php index b2764d46..de745b5a 100644 --- a/sales/inquiry/customer_inquiry.php +++ b/sales/inquiry/customer_inquiry.php @@ -216,10 +216,16 @@ function check_overdue($row) debtor.name, branch.br_name, debtor.curr_code, - @bal := @bal+trans.ov_amount, (trans.ov_amount + trans.ov_gst + trans.ov_freight - + trans.ov_freight_tax + trans.ov_discount) AS TotalAmount, - trans.alloc AS Allocated, + + trans.ov_freight_tax + trans.ov_discount) AS TotalAmount, "; + if ($_POST['filterType'] != ALL_TEXT) + $sql .= "@bal := @bal+(trans.ov_amount + trans.ov_gst + trans.ov_freight + trans.ov_freight_tax + trans.ov_discount), "; + +// else +// $sql .= "IF(trans.type=".ST_CUSTDELIVERY.",'', IF(trans.type=".ST_SALESINVOICE." OR trans.type=".ST_BANKPAYMENT.",@bal := @bal+ +// (trans.ov_amount + trans.ov_gst + trans.ov_freight + trans.ov_freight_tax + trans.ov_discount), @bal := @bal- +// (trans.ov_amount + trans.ov_gst + trans.ov_freight + trans.ov_freight_tax + trans.ov_discount))) , "; + $sql .= "trans.alloc AS Allocated, ((trans.type = ".ST_SALESINVOICE.") AND trans.due_date < '" . date2sql(Today()) . "') AS OverDue FROM " @@ -280,20 +286,22 @@ $cols = array( _("Customer") => array('ord'=>''), _("Branch") => array('ord'=>''), _("Currency") => array('align'=>'center'), - _("RB"), _("Debit") => array('align'=>'right', 'fun'=>'fmt_debit'), _("Credit") => array('align'=>'right','insert'=>true, 'fun'=>'fmt_credit'), + _("RB") => array('align'=>'right', 'type'=>'amount'), array('insert'=>true, 'fun'=>'gl_view'), array('insert'=>true, 'fun'=>'credit_link'), array('insert'=>true, 'fun'=>'edit_link'), array('insert'=>true, 'fun'=>'prt_link') ); + if ($_POST['customer_id'] != ALL_TEXT) { $cols[_("Customer")] = 'skip'; $cols[_("Currency")] = 'skip'; } - +if ($_POST['filterType'] == ALL_TEXT) + $cols[_("RB")] = 'skip'; $table =& new_db_pager('trans_tbl', $sql, $cols); $table->set_marker('check_overdue', _("Marked items are overdue.")); -- 2.30.2