X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=reporting%2Frep102.php;h=0034d786654176b6add8c467cce7fffb7cf761ca;hb=2e570d1c62dd7775213cfffe3cf1ab186b94117f;hp=f4ec4a88ea4909e548d80329a1de208537143eae;hpb=f30537908e67494d74831f50490df4b965e657ff;p=fa-stable.git diff --git a/reporting/rep102.php b/reporting/rep102.php index f4ec4a88..0034d786 100644 --- a/reporting/rep102.php +++ b/reporting/rep102.php @@ -46,9 +46,9 @@ function get_invoices($customer_id, $to, $all=true) $sql = "SELECT ".TB_PREF."debtor_trans.type, ".TB_PREF."debtor_trans.reference, ".TB_PREF."debtor_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."debtors_master, ".TB_PREF."debtor_trans @@ -79,11 +79,13 @@ function print_aged_customer_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"); @@ -135,8 +137,10 @@ function print_aged_customer_analysis() if ($convert) $headers[2] = _('Currency'); - $rep = new FrontReport(_('Aged Customer Analysis'), "AgedCustomerAnalysis", user_pagesize()); - + $rep = new FrontReport(_('Aged Customer Analysis'), "AgedCustomerAnalysis", user_pagesize(), 9, $orientation); + if ($orientation == 'L') + recalculate_cols($cols); + $rep->Font(); $rep->Info($params, $cols, $headers, $aligns); $rep->NewPage();