X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=reporting%2Frep202.php;h=c3b1e87a41ec7c9f0323cb30ea437b845238fe94;hb=fc24ee893402902fc58632dabb5d7c2594e191d0;hp=f18abaec1b83da9634f048373b3257481bc6d80d;hpb=a82e9b552d49b11dad1c726a23bfa958463a5154;p=fa-stable.git diff --git a/reporting/rep202.php b/reporting/rep202.php index f18abaec..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, @@ -59,9 +59,9 @@ function get_invoices($supplier_id, $to, $all=true) AND ".TB_PREF."suppliers.supplier_id = ".TB_PREF."supp_trans.supplier_id AND ".TB_PREF."supp_trans.supplier_id = $supplier_id AND ".TB_PREF."supp_trans.tran_date <= '$todate' - AND ABS(".TB_PREF."supp_trans.ov_amount + ".TB_PREF."supp_trans.ov_gst + ".TB_PREF."supp_trans.ov_discount) > 0.004 "; + AND ABS(".TB_PREF."supp_trans.ov_amount + ".TB_PREF."supp_trans.ov_gst + ".TB_PREF."supp_trans.ov_discount) > ".FLOAT_COMP_DELTA." "; if (!$all) - $sql .= "AND ABS(".TB_PREF."supp_trans.ov_amount + ".TB_PREF."supp_trans.ov_gst + ".TB_PREF."supp_trans.ov_discount) - ".TB_PREF."supp_trans.alloc > 0.004 "; + $sql .= "AND ABS(".TB_PREF."supp_trans.ov_amount + ".TB_PREF."supp_trans.ov_gst + ".TB_PREF."supp_trans.ov_discount) - ".TB_PREF."supp_trans.alloc > ".FLOAT_COMP_DELTA." "; $sql .= "ORDER BY ".TB_PREF."supp_trans.tran_date"; @@ -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); @@ -182,7 +186,7 @@ function print_aged_supplier_analysis() $supprec["Overdue2"], $supprec["Balance"]); - if ($no_zeros && array_sum($str) == 0) continue; + if ($no_zeros && floatcmp(array_sum($str), 0) == 0) continue; $rep->fontSize += 2; $rep->TextCol(0, 2, $myrow['name']);