Merging version 2.1 RC to main trunk.
[fa-stable.git] / gl / inquiry / bank_inquiry.php
index f6ffdba757a156d37ee6bb207f94a5ac2e18ff54..94ccef8d54988274004a2b52b9694fb9cd172d67 100644 (file)
@@ -1,5 +1,14 @@
 <?php
-
+/**********************************************************************
+    Copyright (C) FrontAccounting, LLC.
+       Released under the terms of the GNU General Public License, GPL, 
+       as published by the Free Software Foundation, either version 3 
+       of the License, or (at your option) any later version.
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+    See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
+***********************************************************************/
 $page_security = 8;
 $path_to_root="../..";
 include_once($path_to_root . "/includes/session.inc");
@@ -49,11 +58,10 @@ $date_after = date2sql($_POST['TransAfterDate']);
 $date_to = date2sql($_POST['TransToDate']);
 if (!isset($_POST['bank_account']))
        $_POST['bank_account'] = "";
-$sql = "SELECT ".TB_PREF."bank_trans.*,name AS BankTransType FROM ".TB_PREF."bank_trans, ".TB_PREF."bank_trans_types
+$sql = "SELECT ".TB_PREF."bank_trans.* FROM ".TB_PREF."bank_trans
        WHERE ".TB_PREF."bank_trans.bank_act = '" . $_POST['bank_account'] . "'
        AND trans_date >= '$date_after'
        AND trans_date <= '$date_to'
-       AND ".TB_PREF."bank_trans_types.id = ".TB_PREF."bank_trans.bank_trans_type_id
        ORDER BY trans_date,".TB_PREF."bank_trans.id";
 
 $result = db_query($sql,"The transactions for '" . $_POST['bank_account'] . "' could not be retrieved");
@@ -64,7 +72,7 @@ display_heading($act['bank_account_name']." - ".$act['bank_curr_code']);
 
 start_table($table_style);
 
-$th = array(_("Type"), _("#"), _("Reference"), _("Type"), _("Date"),
+$th = array(_("Type"), _("#"), _("Reference"), _("Date"),
        _("Debit"), _("Credit"), _("Balance"), _("Person/Item"), "");
 table_header($th);
 
@@ -73,11 +81,12 @@ $sql = "SELECT SUM(amount) FROM ".TB_PREF."bank_trans WHERE bank_act='" . $_POST
 $before_qty = db_query($sql, "The starting balance on hand could not be calculated");
 
 start_row("class='inquirybg'");
-label_cell("<b>"._("Opening Balance")." - ".$_POST['TransAfterDate']."</b>", "colspan=5");
+label_cell("<b>"._("Opening Balance")." - ".$_POST['TransAfterDate']."</b>", "colspan=4");
 $bfw_row = db_fetch_row($before_qty);
 $bfw = $bfw_row[0];
 display_debit_or_credit_cells($bfw);
 label_cell("");
+label_cell("", "colspan=2");
 
 end_row();
 $running_total = $bfw;
@@ -94,7 +103,6 @@ while ($myrow = db_fetch($result))
        label_cell(systypes::name($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($myrow["BankTransType"]);
        label_cell($trandate);
        display_debit_or_credit_cells($myrow["amount"]);
        amount_cell($running_total);
@@ -112,9 +120,10 @@ while ($myrow = db_fetch($result))
 //end of while loop
 
 start_row("class='inquirybg'");
-label_cell("<b>" . _("Ending Balance")." - ". $_POST['TransToDate']. "</b>", "colspan=5");
+label_cell("<b>" . _("Ending Balance")." - ". $_POST['TransToDate']. "</b>", "colspan=4");
 display_debit_or_credit_cells($running_total);
 label_cell("");
+label_cell("", "colspan=2");
 end_row();
 end_table(2);
 div_end();