X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=gl%2Finquiry%2Fbank_inquiry.php;h=e273099db7fa6dc721723df38cc0b9b2493050ad;hb=52f4ea3f7360e1284b1cf1cd39b2efda6ff0606f;hp=dddc9b47d808e36c570d73bad34e22e5f8acfd23;hpb=d9b4de9d7e9d3ba77f6ece752fd6cc988effd8f1;p=fa-stable.git
diff --git a/gl/inquiry/bank_inquiry.php b/gl/inquiry/bank_inquiry.php
index dddc9b47..e273099d 100644
--- a/gl/inquiry/bank_inquiry.php
+++ b/gl/inquiry/bank_inquiry.php
@@ -14,6 +14,7 @@ $path_to_root="../..";
include_once($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/includes/date_functions.inc");
+include_once($path_to_root . "/includes/db_pager.inc");
include_once($path_to_root . "/includes/ui.inc");
include_once($path_to_root . "/includes/data_checks.inc");
@@ -21,11 +22,11 @@ include_once($path_to_root . "/gl/includes/gl_db.inc");
include_once($path_to_root . "/includes/banking.inc");
$js = "";
-if ($use_popup_windows)
+if ($SysPrefs->use_popup_windows)
$js .= get_js_open_window(800, 500);
-if ($use_date_picker)
+if (user_use_date_picker())
$js .= get_js_date_picker();
-page(_($help_context = "Bank Statement"), false, false, "", $js);
+page(_($help_context = "Bank Account Inquiry"), isset($_GET['bank_account']) && !isset($_GET['TransAfterDate']), false, "", $js, false, "", true);
check_db_has_bank_accounts(_("There are no bank accounts defined in the system."));
@@ -38,12 +39,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, -user_transaction_days());
date_cells(_("To:"), 'TransToDate');
submit_cells('Show',_("Show"),'','', 'default');
@@ -65,19 +69,24 @@ display_heading($act['bank_account_name']." - ".$act['bank_curr_code']);
start_table(TABLESTYLE);
$th = array(_("Type"), _("#"), _("Reference"), _("Date"),
- _("Debit"), _("Credit"), _("Balance"), _("Person/Item"), "");
+ _("Debit"), _("Credit"), _("Balance"), _("Person/Item"), _("Memo"), "", "");
table_header($th);
$bfw = get_balance_before_for_bank_account($_POST['bank_account'], $_POST['TransAfterDate']);
-start_row("class='inquirybg'");
-label_cell(""._("Opening Balance")." - ".$_POST['TransAfterDate']."", "colspan=4");
+$credit = $debit = 0;
+start_row("class='inquirybg' style='font-weight:bold'");
+label_cell(_("Opening Balance")." - ".$_POST['TransAfterDate'], "colspan=4");
display_debit_or_credit_cells($bfw);
label_cell("");
-label_cell("", "colspan=2");
+label_cell("", "colspan=4");
end_row();
$running_total = $bfw;
+if ($bfw > 0 )
+ $debit += $bfw;
+else
+ $credit += $bfw;
$j = 1;
$k = 0; //row colour counter
while ($myrow = db_fetch($result))
@@ -94,9 +103,19 @@ 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_comments_string($myrow["type"], $myrow["trans_no"]));
label_cell(get_gl_view_str($myrow["type"], $myrow["trans_no"]));
+
+ label_cell(trans_editor_link($myrow["type"], $myrow["trans_no"]));
+
end_row();
+ if ($myrow["amount"] > 0 )
+ $debit += $myrow["amount"];
+ else
+ $credit += $myrow["amount"];
if ($j == 12)
{
@@ -107,11 +126,13 @@ while ($myrow = db_fetch($result))
}
//end of while loop
-start_row("class='inquirybg'");
-label_cell("" . _("Ending Balance")." - ". $_POST['TransToDate']. "", "colspan=4");
-display_debit_or_credit_cells($running_total);
-label_cell("");
-label_cell("", "colspan=2");
+start_row("class='inquirybg' style='font-weight:bold'");
+label_cell(_("Ending Balance")." - ". $_POST['TransToDate'], "colspan=4");
+amount_cell($debit);
+amount_cell(-$credit);
+//display_debit_or_credit_cells($running_total);
+amount_cell($debit+$credit);
+label_cell("", "colspan=4");
end_row();
end_table(2);
div_end();
@@ -119,4 +140,3 @@ div_end();
end_page();
-?>