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_SUPPLIERANALYTIC';
// ----------------------------------------------------------------
// $ Revision: 2.0 $
// Creator: Joe Hunt
// Revomed allocated from sql
$value = "(".TB_PREF."supp_trans.ov_amount + ".TB_PREF."supp_trans.ov_gst + ".TB_PREF."supp_trans.ov_discount)";
- $due = "IF (".TB_PREF."supp_trans.type=20 OR ".TB_PREF."supp_trans.type=21,".TB_PREF."supp_trans.due_date,".TB_PREF."supp_trans.tran_date)";
+ $due = "IF (".TB_PREF."supp_trans.type=".ST_SUPPINVOICE." OR ".TB_PREF."supp_trans.type=".ST_SUPPCREDIT.",".TB_PREF."supp_trans.due_date,".TB_PREF."supp_trans.tran_date)";
$sql = "SELECT ".TB_PREF."supp_trans.type,
".TB_PREF."supp_trans.reference,
".TB_PREF."supp_trans.tran_date,
function print_aged_supplier_analysis()
{
- global $comp_path, $path_to_root;
+ global $comp_path, $path_to_root, $systypes_array;
$to = $_POST['PARAM_0'];
$fromsupp = $_POST['PARAM_1'];
$pg = new graph();
}
- if ($fromsupp == reserved_words::get_all_numeric())
+ if ($fromsupp == ALL_NUMERIC)
$from = _('All');
else
$from = get_supplier_name($fromsupp);
$summary = _('Summary Only');
else
$summary = _('Detailed Report');
- if ($currency == reserved_words::get_all())
+ if ($currency == ALL_TEXT)
{
$convert = true;
$currency = _('Balances in Home Currency');
$pastdue1 = $PastDueDays1 + 1 . "-" . $PastDueDays2 . " " . _('Days');
$pastdue2 = _('Over') . " " . $PastDueDays2 . " " . _('Days');
- $sql = "SELECT supplier_id, supp_name AS name, curr_code FROM ".TB_PREF."suppliers ";
- if ($fromsupp != reserved_words::get_all_numeric())
- $sql .= "WHERE supplier_id=$fromsupp ";
- $sql .= "ORDER BY supp_name";
+ $sql = "SELECT supplier_id, supp_name AS name, curr_code FROM ".TB_PREF."suppliers";
+ if ($fromsupp != ALL_NUMERIC)
+ $sql .= " WHERE supplier_id=".db_escape($fromsupp);
+ $sql .= " ORDER BY supp_name";
$result = db_query($sql, "The suppliers could not be retrieved");
while ($myrow=db_fetch($result))
while ($trans=db_fetch($res))
{
$rep->NewLine(1, 2);
- $rep->TextCol(0, 1, systypes::name($trans['type']), -2);
+ $rep->TextCol(0, 1, $systypes_array[$trans['type']], -2);
$rep->TextCol(1, 2, $trans['reference'], -2);
$rep->TextCol(2, 3, sql2date($trans['tran_date']), -2);
foreach ($trans as $i => $value)