1. By design, the Bank GL Inquiry report is cluttered with GL entries. If you do not want the GL entries, then use the built-in Bank Inquiry report. Indeed, I don't use the GL report personally, but was requested by accounting staff.
2. The report relies on additional core change to gl_bank.php for this function to work. It might work if you add something like
if isset($_GET['bank_account'])
$_POST['bank_account'] = $_GET['bank_account'];
All the core changes to that file are:
diff --git a/core/gl/gl_bank.php b/core/gl/gl_bank.php
index 71e2c04..0897a1b 100644
--- a/core/gl/gl_bank.php
+++ b/core/gl/gl_bank.php
@@ -30,6 +30,8 @@ if ($SysPrefs->use_popup_windows)
if (user_use_date_picker())
$js .= get_js_date_picker();
+set_posts(array("bank_account"));
+
if (isset($_GET['NewPayment'])) {
$_SESSION['page_title'] = _($help_context = "Bank Account Payment Entry");
create_cart(ST_BANKPAYMENT, 0);
@@ -43,6 +45,15 @@ if (isset($_GET['NewPayment'])) {
$_SESSION['page_title'] = _($help_context = "Modify Bank Deposit Entry")." #".$_GET['trans_no'];
create_cart(ST_BANKDEPOSIT, $_GET['trans_no']);
}
+
+if (isset($_SERVER['HTTP_REFERER'])) {
+ $referer=parse_url($_SERVER['HTTP_REFERER'], PHP_URL_PATH);
+ if (basename($referer) == "index.php")
+ unset($_SESSION['HTTP_REFERER']);
+ else if ($referer != $_SERVER['PHP_SELF'])
+ $_SESSION['HTTP_REFERER'] = $_SERVER['HTTP_REFERER'];
+}
+
page($_SESSION['page_title'], false, false, '', $js);
//-----------------------------------------------------------------------------------------------
@@ -78,9 +89,9 @@ if (isset($_GET['AddedID']))
display_note(get_gl_view_str($trans_type, $trans_no, _("&View the GL Postings for this Payment")));
- hyperlink_params($_SERVER['PHP_SELF'], _("Enter Another &Payment"), "NewPayment=yes");
+ hyperlink_params($_SERVER['PHP_SELF'], _("Enter Another &Payment"), "NewPayment=yes&date_=".$_GET['date_']."&bank_account=".$_POST['bank_account']);
- hyperlink_params($_SERVER['PHP_SELF'], _("Enter A &Deposit"), "NewDeposit=yes");
+ hyperlink_params($_SERVER['PHP_SELF'], _("Enter A &Deposit"), "NewDeposit=yes&date_=".$_GET['date_']."&bank_account=".$_POST['bank_account']);
hyperlink_params("$path_to_root/admin/attachments.php", _("Add an Attachment"), "filterType=$trans_type&trans_no=$trans_no");
@@ -112,9 +123,9 @@ if (isset($_GET['AddedDep']))
display_note(get_gl_view_str($trans_type, $trans_no, _("View the GL Postings for this Deposit")));
- hyperlink_params($_SERVER['PHP_SELF'], _("Enter Another Deposit"), "NewDeposit=yes");
+ hyperlink_params($_SERVER['PHP_SELF'], _("Enter Another Deposit"), "NewDeposit=yes&date_=".$_GET['date_']."&bank_account=".$_POST['bank_account']);
- hyperlink_params($_SERVER['PHP_SELF'], _("Enter A Payment"), "NewPayment=yes");
+ hyperlink_params($_SERVER['PHP_SELF'], _("Enter A Payment"), "NewPayment=yes&date_=".$_GET['date_']."&bank_account=".$_POST['bank_account']);
display_footer_exit();
}
@@ -197,7 +208,10 @@ function create_cart($type, $trans_no)
} else {
$cart->reference = $Refs->get_next($cart->trans_type, null, $cart->tran_date);
- $cart->tran_date = new_doc_date();
+ if (isset($_GET['date_']))
+ $cart->tran_date = $_GET['date_'];
+ else
+ $cart->tran_date = new_doc_date();
if (!is_date_in_fiscalyear($cart->tran_date))
$cart->tran_date = end_fiscalyear();
}
@@ -300,6 +314,16 @@ if (isset($_POST['Process']) && !check_trans())
$trans_type = $trans[0];
$trans_no = $trans[1];
+
+ // retain the reconciled status if desired by user
+ if (isset($_POST['reconciled'])
+ && $_POST['reconciled'] == 1) {
+ $sql = "UPDATE ".TB_PREF."bank_trans SET reconciled=".db_escape($_POST['reconciled_date'])
+ ." WHERE type=" . $trans_type . " AND trans_no=".db_escape($trans_no);
+
+ db_query($sql, "Can't change reconciliation status");
+ }
+
new_doc_date($_POST['date_']);
$_SESSION['pay_items']->clear_items();
@@ -307,12 +331,27 @@ if (isset($_POST['Process']) && !check_trans())
commit_transaction();
- if ($new)
- meta_forward($_SERVER['PHP_SELF'], $trans_type==ST_BANKPAYMENT ?
- "AddedID=$trans_no" : "AddedDep=$trans_no");
- else
- meta_forward($_SERVER['PHP_SELF'], $trans_type==ST_BANKPAYMENT ?
- "UpdatedID=$trans_no" : "UpdatedDep=$trans_no");
+ $params = "";
+ $referer = "";
+ if (!isset($_SESSION['HTTP_REFERER'])) {
+ $referer=$_SERVER['PHP_SELF'];
+ if ($new) {
+ $params .= ($trans_type==ST_BANKPAYMENT ? "AddedID=" : "AddedDep=");
+ $params .= "$trans_no&date_=".$_POST['date_']."&bank_account=".$_POST['bank_account'];
+ } else
+ $params .= ($trans_type==ST_BANKPAYMENT ?
+ "UpdatedID=$trans_no" : "UpdatedDep=$trans_no");
+ } else {
+ $referer=parse_url($_SESSION['HTTP_REFERER'], PHP_URL_PATH);
+ $params = parse_url(htmlspecialchars_decode($_SESSION['HTTP_REFERER']), PHP_URL_QUERY);
+ $params = preg_replace('/[&]*message.*/', '', $params);
+ if (!empty($params))
+ $params .= "&";
+ $params .= "message=";
+ $params .= ($trans_type==ST_BANKPAYMENT ? "Payment" : "Deposit");
+ $params .= " Completed";
+ }
+ meta_forward($referer, $params);
}