X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=reporting%2Frep202.php;h=c3b1e87a41ec7c9f0323cb30ea437b845238fe94;hb=2e570d1c62dd7775213cfffe3cf1ab186b94117f;hp=6bbf6d92c02fb1f53f13d0a559bfe49a6b373b88;hpb=f30537908e67494d74831f50490df4b965e657ff;p=fa-stable.git diff --git a/reporting/rep202.php b/reporting/rep202.php index 6bbf6d92..c3b1e87a 100644 --- a/reporting/rep202.php +++ b/reporting/rep202.php @@ -47,9 +47,9 @@ function get_invoices($supplier_id, $to, $all=true) ".TB_PREF."supp_trans.reference, ".TB_PREF."supp_trans.tran_date, $value as Balance, - IF ((TO_DAYS('$todate') - TO_DAYS($due)) >= 0,$value,0) AS Due, - IF ((TO_DAYS('$todate') - TO_DAYS($due)) >= $PastDueDays1,$value,0) AS Overdue1, - IF ((TO_DAYS('$todate') - TO_DAYS($due)) >= $PastDueDays2,$value,0) AS Overdue2 + IF ((TO_DAYS('$todate') - TO_DAYS($due)) > 0,$value,0) AS Due, + IF ((TO_DAYS('$todate') - TO_DAYS($due)) > $PastDueDays1,$value,0) AS Overdue1, + IF ((TO_DAYS('$todate') - TO_DAYS($due)) > $PastDueDays2,$value,0) AS Overdue2 FROM ".TB_PREF."suppliers, ".TB_PREF."payment_terms, @@ -82,12 +82,14 @@ function print_aged_supplier_analysis() $no_zeros = $_POST['PARAM_5']; $graphics = $_POST['PARAM_6']; $comments = $_POST['PARAM_7']; - $destination = $_POST['PARAM_8']; + $orientation = $_POST['PARAM_8']; + $destination = $_POST['PARAM_9']; if ($destination) include_once($path_to_root . "/reporting/includes/excel_report.inc"); else include_once($path_to_root . "/reporting/includes/pdf_report.inc"); + $orientation = ($orientation ? 'L' : 'P'); if ($graphics) { include_once($path_to_root . "/reporting/includes/class.graphic.inc"); @@ -140,7 +142,9 @@ function print_aged_supplier_analysis() if ($convert) $headers[2] = _('currency'); - $rep = new FrontReport(_('Aged Supplier Analysis'), "AgedSupplierAnalysis", user_pagesize()); + $rep = new FrontReport(_('Aged Supplier Analysis'), "AgedSupplierAnalysis", user_pagesize(), 9, $orientation); + if ($orientation == 'L') + recalculate_cols($cols); $rep->Font(); $rep->Info($params, $cols, $headers, $aligns);