X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=reporting%2Frep202.php;h=3f68bb5adcbe094115247a67361dd382baeef146;hb=3a722558dc5a513ee403628604a6f44e8bd44e7a;hp=ba15545c846e4b3e6a63dff9e95afd627b630cd1;hpb=902f1015d874c33bd7946b17de2ad80b4f2144b6;p=fa-stable.git diff --git a/reporting/rep202.php b/reporting/rep202.php index ba15545c..3f68bb5a 100644 --- a/reporting/rep202.php +++ b/reporting/rep202.php @@ -37,7 +37,7 @@ function get_invoices($supplier_id, $to) // 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, @@ -65,7 +65,7 @@ function get_invoices($supplier_id, $to) 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']; @@ -84,7 +84,7 @@ function print_aged_supplier_analysis() $pg = new graph(); } - if ($fromsupp == reserved_words::get_all_numeric()) + if ($fromsupp == ALL_NUMERIC) $from = _('All'); else $from = get_supplier_name($fromsupp); @@ -94,7 +94,7 @@ function print_aged_supplier_analysis() $summary = _('Summary Only'); else $summary = _('Detailed Report'); - if ($currency == reserved_words::get_all()) + if ($currency == ALL_TEXT) { $convert = true; $currency = _('Balances in Home Currency'); @@ -137,10 +137,10 @@ function print_aged_supplier_analysis() $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)) @@ -182,7 +182,7 @@ function print_aged_supplier_analysis() 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)