X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=sales%2Finquiry%2Fcustomer_inquiry.php;h=de745b5a1a86ff07ee19777f18da28b01af050ae;hb=cad609a6e50c409a5d49608dd08055dcf6278626;hp=b2764d465595a2be828cda60e3f59921c316d165;hpb=cb04035914c02ff40b6c1c8c34684663bec432b6;p=fa-stable.git 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."));