X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=reporting%2Frep203.php;h=6fe008d410bceeeb8f3493c0d32d97baea34fb46;hb=29e68a1b8dcbe7c7ecb797396945e0cccf2d6cd8;hp=91fdfde62b5356cc9f1a287ef13532ecf0a132b2;hpb=ddadb47f2620ce6902ad4694ce6512568862ba05;p=fa-stable.git diff --git a/reporting/rep203.php b/reporting/rep203.php index 91fdfde6..6fe008d4 100644 --- a/reporting/rep203.php +++ b/reporting/rep203.php @@ -30,6 +30,7 @@ print_payment_report(); function getTransactions($supplier, $date) { $date = date2sql($date); + $dec = user_price_dec(); $sql = "SELECT ".TB_PREF."supp_trans.supp_reference, ".TB_PREF."supp_trans.tran_date, @@ -41,7 +42,8 @@ function getTransactions($supplier, $date) (ABS(".TB_PREF."supp_trans.ov_amount) + ABS(".TB_PREF."supp_trans.ov_gst) ) AS TranTotal FROM ".TB_PREF."supp_trans WHERE ".TB_PREF."supp_trans.supplier_id = '" . $supplier . "' - AND ABS(".TB_PREF."supp_trans.ov_amount) + ABS(".TB_PREF."supp_trans.ov_gst) - ".TB_PREF."supp_trans.alloc != 0 + AND ROUND(ABS(".TB_PREF."supp_trans.ov_amount),$dec) + ROUND(ABS(".TB_PREF."supp_trans.ov_gst),$dec) - + ROUND(".TB_PREF."supp_trans.alloc,$dec) != 0 AND ".TB_PREF."supp_trans.tran_date <='" . $date . "' ORDER BY ".TB_PREF."supp_trans.type, ".TB_PREF."supp_trans.trans_no"; @@ -96,7 +98,7 @@ function print_payment_report() $rep->Font(); $rep->Info($params, $cols, $headers, $aligns); - $rep->Header(); + $rep->NewPage(); $total = array(); $grandtotal = array(0,0); @@ -104,7 +106,7 @@ function print_payment_report() $sql = "SELECT supplier_id, supp_name AS name, curr_code, ".TB_PREF."payment_terms.terms FROM ".TB_PREF."suppliers, ".TB_PREF."payment_terms WHERE "; if ($fromsupp != ALL_NUMERIC) - $sql .= "supplier_id=$fromsupp AND "; + $sql .= "supplier_id=".db_escape($fromsupp)." AND "; $sql .= "".TB_PREF."suppliers.payment_terms = ".TB_PREF."payment_terms.terms_indicator ORDER BY supp_name"; $result = db_query($sql, "The customers could not be retrieved");