function get_invoices($supplier_id, $to, $all=true)
{
$todate = date2sql($to);
- $PastDueDays1 = get_company_pref('past_due_days');
- $PastDueDays2 = 2 * $PastDueDays1;
+ $current = 1;
+ $PastDueDays1 = get_company_pref('past_due_days') + $current;
+ $PastDueDays2 = 2 * $PastDueDays1 + $current;
// Revomed allocated from sql
if ($all)
".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)) >= $current,$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
$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");
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);