$BP = $type_shortcuts[ST_BANKPAYMENT];
$SP = $type_shortcuts[ST_SUPPAYMENT];
$CN = $type_shortcuts[ST_SUPPCREDIT];
- $ref = ($print_invoice_no == 1 ? "trans_no" : "reference");
+ $ref = ($SysPrefs->print_invoice_no() == 1 ? "trans_no" : "reference");
$sql = "SELECT concat(".TB_PREF."supp_trans.trans_no, '-',
".TB_PREF."supp_trans.type) AS TNO, concat(".TB_PREF."supp_trans.$ref, if (type=".ST_BANKPAYMENT.", ' $BP ', if (type=".ST_SUPPAYMENT.", ' $SP ', ' $CN ')), ".TB_PREF."suppliers.supp_name) as IName
FROM ".TB_PREF."suppliers, ".TB_PREF."supp_trans WHERE (type=".ST_BANKPAYMENT." OR type=".ST_SUPPAYMENT." OR type=".ST_SUPPCREDIT.") AND ".TB_PREF."suppliers.supplier_id=".TB_PREF."supp_trans.supplier_id ORDER BY ".TB_PREF."supp_trans.trans_no DESC";