Merged bugfixes upto [0000072] (version 2.0.3).
[fa-stable.git] / gl / inquiry / bank_inquiry.php
index 9407a07e2ec17fe3815f8f14f60c435f8cd0aa65..f6ffdba757a156d37ee6bb207f94a5ac2e18ff54 100644 (file)
@@ -20,10 +20,16 @@ page(_("Bank Statement"), false, false, "", $js);
 
 check_db_has_bank_accounts(_("There are no bank accounts defined in the system."));
 
+//-----------------------------------------------------------------------------------
+// Ajax updates
+//
+if (get_post('Show'))
+{
+       $Ajax->activate('trans_tbl');
+}
 //------------------------------------------------------------------------------------------------
 
 start_form();
-
 start_table("class='tablestyle_noborder'");
 start_row();
 bank_accounts_list_cells(_("Account:"), 'bank_account', null);
@@ -31,7 +37,7 @@ bank_accounts_list_cells(_("Account:"), 'bank_account', null);
 date_cells(_("From:"), 'TransAfterDate', '', null, -30);
 date_cells(_("To:"), 'TransToDate');
 
-submit_cells('Show',_("Show"));
+submit_cells('Show',_("Show"),'','', true);
 end_row();
 end_table();
 end_form();
@@ -52,6 +58,7 @@ $sql = "SELECT ".TB_PREF."bank_trans.*,name AS BankTransType FROM ".TB_PREF."ban
 
 $result = db_query($sql,"The transactions for '" . $_POST['bank_account'] . "' could not be retrieved");
 
+div_start('trans_tbl');
 $act = get_bank_account($_POST["bank_account"]);
 display_heading($act['bank_account_name']." - ".$act['bank_curr_code']);
 
@@ -59,7 +66,7 @@ start_table($table_style);
 
 $th = array(_("Type"), _("#"), _("Reference"), _("Type"), _("Date"),
        _("Debit"), _("Credit"), _("Balance"), _("Person/Item"), "");
-table_header($th);     
+table_header($th);
 
 $sql = "SELECT SUM(amount) FROM ".TB_PREF."bank_trans WHERE bank_act='" . $_POST['bank_account'] . "'
        AND trans_date < '$date_after'";
@@ -76,7 +83,7 @@ end_row();
 $running_total = $bfw;
 $j = 1;
 $k = 0; //row colour counter
-while ($myrow = db_fetch($result)) 
+while ($myrow = db_fetch($result))
 {
 
        alt_table_row_color($k);
@@ -98,7 +105,7 @@ while ($myrow = db_fetch($result))
        if ($j == 12)
        {
                $j = 1;
-               table_header($th);      
+               table_header($th);
        }
        $j++;
 }
@@ -110,7 +117,7 @@ display_debit_or_credit_cells($running_total);
 label_cell("");
 end_row();
 end_table(2);
-
+div_end();
 //------------------------------------------------------------------------------------------------
 
 end_page();