Changed context help organization to enable use of central, multilanguage wiki.
[fa-stable.git] / gl / inquiry / bank_inquiry.php
index 9c627670b8e5a3681888936413fa3863a66d7cbc..b9dcf28eaa2ac93151a7eb978bb61e2b95d4fb6e 100644 (file)
@@ -9,7 +9,7 @@
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
     See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
 ***********************************************************************/
-$page_security = 8;
+$page_security = 'SA_BANKTRANSVIEW';
 $path_to_root="../..";
 include_once($path_to_root . "/includes/session.inc");
 
@@ -25,7 +25,7 @@ if ($use_popup_windows)
        $js .= get_js_open_window(800, 500);
 if ($use_date_picker)
        $js .= get_js_date_picker();
-page(_("Bank Statement"), false, false, "", $js);
+page(_($help_context = "Bank Statement"), false, false, "", $js);
 
 check_db_has_bank_accounts(_("There are no bank accounts defined in the system."));
 
@@ -59,7 +59,7 @@ $date_to = date2sql($_POST['TransToDate']);
 if (!isset($_POST['bank_account']))
        $_POST['bank_account'] = "";
 $sql = "SELECT ".TB_PREF."bank_trans.* FROM ".TB_PREF."bank_trans
-       WHERE ".TB_PREF."bank_trans.bank_act = '" . $_POST['bank_account'] . "'
+       WHERE ".TB_PREF."bank_trans.bank_act = ".db_escape($_POST['bank_account']) . "
        AND trans_date >= '$date_after'
        AND trans_date <= '$date_to'
        ORDER BY trans_date,".TB_PREF."bank_trans.id";
@@ -76,7 +76,8 @@ $th = array(_("Type"), _("#"), _("Reference"), _("Date"),
        _("Debit"), _("Credit"), _("Balance"), _("Person/Item"), "");
 table_header($th);
 
-$sql = "SELECT SUM(amount) FROM ".TB_PREF."bank_trans WHERE bank_act='" . $_POST['bank_account'] . "'
+$sql = "SELECT SUM(amount) FROM ".TB_PREF."bank_trans WHERE bank_act="
+       .db_escape($_POST['bank_account']) . "
        AND trans_date < '$date_after'";
 $before_qty = db_query($sql, "The starting balance on hand could not be calculated");
 
@@ -100,13 +101,13 @@ while ($myrow = db_fetch($result))
        $running_total += $myrow["amount"];
 
        $trandate = sql2date($myrow["trans_date"]);
-       label_cell(systypes::name($myrow["type"]));
+       label_cell($systypes_array[$myrow["type"]]);
        label_cell(get_trans_view_str($myrow["type"],$myrow["trans_no"]));
        label_cell(get_trans_view_str($myrow["type"],$myrow["trans_no"],$myrow['ref']));
        label_cell($trandate);
        display_debit_or_credit_cells($myrow["amount"]);
        amount_cell($running_total);
-       label_cell(payment_person_types::person_name($myrow["person_type_id"],$myrow["person_id"]));
+       label_cell(payment_person_name($myrow["person_type_id"],$myrow["person_id"]));
        label_cell(get_gl_view_str($myrow["type"], $myrow["trans_no"]));
        end_row();