Changed hardcoded trans days in inquiries (30) to be a user preference.
[fa-stable.git] / gl / inquiry / bank_inquiry.php
index 65a691fd84ad511b9ce880ab57d4729b1fbecaf8..4330a2ade68f54fd6de21a716c05fc9df2fcdc48 100644 (file)
@@ -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(_($help_context = "Bank Statement"), false, false, "", $js);
+page(_($help_context = "Bank Statement"), isset($_GET['bank_account']), false, "", $js);
 
 check_db_has_bank_accounts(_("There are no bank accounts defined in the system."));
 
@@ -38,12 +38,15 @@ if (get_post('Show'))
 }
 //------------------------------------------------------------------------------------------------
 
+if (isset($_GET['bank_account']))
+       $_POST['bank_account'] = $_GET['bank_account'];
+
 start_form();
 start_table(TABLESTYLE_NOBORDER);
 start_row();
 bank_accounts_list_cells(_("Account:"), 'bank_account', null);
 
-date_cells(_("From:"), 'TransAfterDate', '', null, -30);
+date_cells(_("From:"), 'TransAfterDate', '', null, -$_SESSION["wa_current_user"]->prefs->transaction_days());
 date_cells(_("To:"), 'TransToDate');
 
 submit_cells('Show',_("Show"),'','', 'default');
@@ -99,7 +102,7 @@ while ($myrow = db_fetch($result))
        label_cell($trandate);
        display_debit_or_credit_cells($myrow["amount"]);
        amount_cell($running_total);
-       label_cell(payment_person_name($myrow["person_type_id"],$myrow["person_id"]));
+       label_cell(get_counterparty_name($myrow["type"], $myrow["trans_no"]));
        label_cell(get_gl_view_str($myrow["type"], $myrow["trans_no"]));
        end_row();
        if ($myrow["amount"] > 0 )