X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=sales%2Finquiry%2Fcustomer_inquiry.php;h=b2764d465595a2be828cda60e3f59921c316d165;hb=cb04035914c02ff40b6c1c8c34684663bec432b6;hp=5315aa2d988cfb02ff7cf3a4c7e59db6ba625af5;hpb=ec09689a87c0b0bac3c24e782ae4e5dfe7a6248e;p=fa-stable.git diff --git a/sales/inquiry/customer_inquiry.php b/sales/inquiry/customer_inquiry.php index 5315aa2d..b2764d46 100644 --- a/sales/inquiry/customer_inquiry.php +++ b/sales/inquiry/customer_inquiry.php @@ -23,7 +23,7 @@ if ($use_popup_windows) $js .= get_js_open_window(900, 500); if ($use_date_picker) $js .= get_js_date_picker(); -page(_("Customer Transactions"), false, false, "", $js); +page(_($help_context = "Customer Transactions"), false, false, "", $js); if (isset($_GET['customer_id'])) @@ -54,7 +54,7 @@ cust_allocations_list_cells(null, 'filterType', $_POST['filterType'], true); submit_cells('RefreshInquiry', _("Search"),'',_('Refresh Inquiry'), 'default'); end_row(); end_table(); -end_form(); + set_global_customer($_POST['customer_id']); //------------------------------------------------------------------------------------------------ @@ -216,6 +216,7 @@ 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, @@ -231,7 +232,7 @@ function check_overdue($row) AND trans.branch_code = branch.branch_code"; if ($_POST['customer_id'] != ALL_TEXT) - $sql .= " AND trans.debtor_no = '" . $_POST['customer_id'] . "'"; + $sql .= " AND trans.debtor_no = ".db_escape($_POST['customer_id']); if ($_POST['filterType'] != ALL_TEXT) { @@ -267,6 +268,7 @@ function check_overdue($row) } //------------------------------------------------------------------------------------------------ +db_query("set @bal:=0"); $cols = array( _("Type") => array('fun'=>'systype_name', 'ord'=>''), @@ -278,6 +280,7 @@ $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'), array('insert'=>true, 'fun'=>'gl_view'), @@ -297,7 +300,6 @@ $table->set_marker('check_overdue', _("Marked items are overdue.")); $table->width = "85%"; -start_form(); display_db_pager($table); end_form();