$ /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
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 "
_("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."));