include_once($path_to_root . "/includes/date_functions.inc");
include_once($path_to_root . "/includes/data_checks.inc");
include_once($path_to_root . "/sales/includes/sales_db.inc");
+include_once($path_to_root . "/includes/db/crm_contacts_db.inc");
//----------------------------------------------------------------------------------------------------
FROM ".TB_PREF."debtor_trans
WHERE ".TB_PREF."debtor_trans.tran_date <= '$date' AND ".TB_PREF."debtor_trans.debtor_no = ".db_escape($debtorno)."
AND ".TB_PREF."debtor_trans.type <> ".ST_CUSTDELIVERY."
+ AND (".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
ORDER BY ".TB_PREF."debtor_trans.tran_date";
return db_query($sql,"No transactions were returned");
$rep->filename = "Statement" . $myrow['debtor_no'] . ".pdf";
$rep->Info($params, $cols, null, $aligns);
}
- $rep->SetCommonData($myrow, null, null, $baccount, ST_STATEMENT);
+ $contacts = get_customer_contacts($myrow['debtor_no'], 'invoice');
+ //= get_branch_contacts($branch['branch_code'], 'invoice', $branch['debtor_no']);
+ $rep->SetCommonData($myrow, null, null, $baccount, ST_STATEMENT, $contacts);
$rep->NewPage();
$rep->NewLine();
$linetype = true;
$doctype = ST_STATEMENT;
- if ($rep->currency != $myrow['curr_code'])
- {
- include($path_to_root . "/reporting/includes/doctext2.inc");
- }
- else
- {
- include($path_to_root . "/reporting/includes/doctext.inc");
- }
+ include($path_to_root . "/reporting/includes/doctext.inc");
$rep->fontSize += 2;
$rep->TextCol(0, 8, $doc_Outstanding);
$rep->fontSize -= 2;