projects
/
fa-stable.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed PayPal link url on sales invoice.
[fa-stable.git]
/
reporting
/
rep102.php
diff --git
a/reporting/rep102.php
b/reporting/rep102.php
index 2d00c063f1573e637498bb2e094892f1aa6ed8ac..beea87bcae78a995e0d93ec27de278231c2318b2 100644
(file)
--- a/
reporting/rep102.php
+++ b/
reporting/rep102.php
@@
-51,17
+51,15
@@
function get_invoices($customer_id, $to, $all=true)
IF ((TO_DAYS('$todate') - TO_DAYS($due)) >= $PastDueDays2,$value,0) AS Overdue2
FROM ".TB_PREF."debtors_master,
IF ((TO_DAYS('$todate') - TO_DAYS($due)) >= $PastDueDays2,$value,0) AS Overdue2
FROM ".TB_PREF."debtors_master,
- ".TB_PREF."payment_terms,
".TB_PREF."debtor_trans
WHERE ".TB_PREF."debtor_trans.type <> ".ST_CUSTDELIVERY."
".TB_PREF."debtor_trans
WHERE ".TB_PREF."debtor_trans.type <> ".ST_CUSTDELIVERY."
- AND ".TB_PREF."debtor_trans.payment_terms = ".TB_PREF."payment_terms.terms_indicator
AND ".TB_PREF."debtors_master.debtor_no = ".TB_PREF."debtor_trans.debtor_no
AND ".TB_PREF."debtor_trans.debtor_no = $customer_id
AND ".TB_PREF."debtor_trans.tran_date <= '$todate'
AND ".TB_PREF."debtors_master.debtor_no = ".TB_PREF."debtor_trans.debtor_no
AND ".TB_PREF."debtor_trans.debtor_no = $customer_id
AND ".TB_PREF."debtor_trans.tran_date <= '$todate'
- AND ABS(".TB_PREF."debtor_trans.ov_amount + ".TB_PREF."debtor_trans.ov_gst + ".TB_PREF."debtor_trans.ov_freight + ".TB_PREF."debtor_trans.ov_freight_tax + ".TB_PREF."debtor_trans.ov_discount) >
0.004
";
+ AND ABS(".TB_PREF."debtor_trans.ov_amount + ".TB_PREF."debtor_trans.ov_gst + ".TB_PREF."debtor_trans.ov_freight + ".TB_PREF."debtor_trans.ov_freight_tax + ".TB_PREF."debtor_trans.ov_discount) >
".FLOAT_COMP_DELTA."
";
if (!$all)
if (!$all)
- $sql .= "AND ABS(".TB_PREF."debtor_trans.ov_amount + ".TB_PREF."debtor_trans.ov_gst + ".TB_PREF."debtor_trans.ov_freight + ".TB_PREF."debtor_trans.ov_freight_tax + ".TB_PREF."debtor_trans.ov_discount - ".TB_PREF."debtor_trans.alloc) >
0.004
";
+ $sql .= "AND ABS(".TB_PREF."debtor_trans.ov_amount + ".TB_PREF."debtor_trans.ov_gst + ".TB_PREF."debtor_trans.ov_freight + ".TB_PREF."debtor_trans.ov_freight_tax + ".TB_PREF."debtor_trans.ov_discount - ".TB_PREF."debtor_trans.alloc) >
".FLOAT_COMP_DELTA."
";
$sql .= "ORDER BY ".TB_PREF."debtor_trans.tran_date";
return db_query($sql, "The customer details could not be retrieved");
$sql .= "ORDER BY ".TB_PREF."debtor_trans.tran_date";
return db_query($sql, "The customer details could not be retrieved");
@@
-81,11
+79,13
@@
function print_aged_customer_analysis()
$no_zeros = $_POST['PARAM_5'];
$graphics = $_POST['PARAM_6'];
$comments = $_POST['PARAM_7'];
$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");
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 ($graphics)
{
include_once($path_to_root . "/reporting/includes/class.graphic.inc");
@@
-137,8
+137,10
@@
function print_aged_customer_analysis()
if ($convert)
$headers[2] = _('Currency');
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();
$rep->Font();
$rep->Info($params, $cols, $headers, $aligns);
$rep->NewPage();
@@
-170,7
+172,7
@@
function print_aged_customer_analysis()
$custrec["Overdue1"]-$custrec["Overdue2"],
$custrec["Overdue2"],
$custrec["Balance"]);
$custrec["Overdue1"]-$custrec["Overdue2"],
$custrec["Overdue2"],
$custrec["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']);
$rep->fontSize += 2;
$rep->TextCol(0, 2, $myrow['name']);