MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
-$page_security = 2;
+$page_security = 'SA_SUPPPAYMREP';
// ----------------------------------------------------------------
// $ Revision: 2.0 $
// Creator: Joe Hunt
function print_payment_report()
{
- global $path_to_root;
+ global $path_to_root, $systypes_array;
$to = $_POST['PARAM_0'];
$fromsupp = $_POST['PARAM_1'];
else
include_once($path_to_root . "/reporting/includes/pdf_report.inc");
- if ($fromsupp == reserved_words::get_all_numeric())
+ if ($fromsupp == ALL_NUMERIC)
$from = _('All');
else
$from = get_supplier_name($fromsupp);
$dec = user_price_dec();
- if ($currency == reserved_words::get_all())
+ if ($currency == ALL_TEXT)
{
$convert = true;
$currency = _('Balances in Home Currency');
$sql = "SELECT supplier_id, supp_name AS name, curr_code, ".TB_PREF."payment_terms.terms FROM ".TB_PREF."suppliers, ".TB_PREF."payment_terms
WHERE ";
- if ($fromsupp != reserved_words::get_all_numeric())
- $sql .= "supplier_id=$fromsupp AND ";
+ if ($fromsupp != ALL_NUMERIC)
+ $sql .= "supplier_id=".db_escape($fromsupp)." AND ";
$sql .= "".TB_PREF."suppliers.payment_terms = ".TB_PREF."payment_terms.terms_indicator
ORDER BY supp_name";
$result = db_query($sql, "The customers could not be retrieved");
else
$rate = 1.0;
$rep->NewLine(1, 2);
- $rep->TextCol(0, 1, systypes::name($trans['type']));
+ $rep->TextCol(0, 1, $systypes_array[$trans['type']]);
$rep->TextCol(1, 2, $trans['supp_reference']);
- if ($trans['type'] == 20)
+ if ($trans['type'] == ST_SUPPINVOICE)
$rep->DateCol(2, 3, $trans['due_date'], true);
else
$rep->DateCol(2, 3, $trans['tran_date'], true);
- if ($trans['type'] != 20)
+ if ($trans['type'] != ST_SUPPINVOICE)
{
$trans['TranTotal'] = -$trans['TranTotal'];
$trans['Balance'] = -$trans['Balance'];