From: Joe Hunt Date: Thu, 13 Dec 2007 23:03:21 +0000 (+0000) Subject: Still bugs in trial balances and account inquiry on screen when selecting non balance... X-Git-Tag: 2.3-final~1513 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=11e9442de571f17b91078e2af73594c0806ead5a;p=fa-stable.git Still bugs in trial balances and account inquiry on screen when selecting non balance accounts. Fixed. --- diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 405fe842..05243b00 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -19,6 +19,11 @@ Legend: ! -> Note $ -> Affected files +13-Dec-2007 Joe Hunt + # Still bugs in trial balances and account inquiry on screen when selecting non balance accounts. Fixed. + $ /gl/inquiry/gl_trial_balance.php + /gl/inquiry/gl_account_inquiry.php + 13-Dec-2007 Joe Hunt # Fixed a bug when voiding a transaction (Journal Entry). An eventually underlying bank transfer was not voided. $ /admin/db/voiding_db.inc diff --git a/gl/inquiry/gl_account_inquiry.php b/gl/inquiry/gl_account_inquiry.php index db669563..6fedc61e 100644 --- a/gl/inquiry/gl_account_inquiry.php +++ b/gl/inquiry/gl_account_inquiry.php @@ -81,11 +81,6 @@ function show_results() $result = get_gl_transactions($_POST['TransFromDate'], $_POST['TransToDate'], -1, $_POST["account"], $_POST['Dimension'], $_POST['Dimension2']); - if (db_num_rows($result) == 0) - { - display_note(_("No general ledger transactions have been created for this account on the selected dates."), 0, 1); - return; - } $colspan = ($dim == 2 ? "6" : ($dim == 1 ? "5" : "4")); //echo "\nDimension =". $_POST['Dimension']; display_heading($_POST["account"]. "   ".$act_name); @@ -101,14 +96,14 @@ function show_results() $th = array(_("Type"), _("#"), _("Date"), _("Person/Item"), _("Debit"), _("Credit"), _("Balance"), _("Memo")); table_header($th); - if (is_account_balancesheet($account["account_code"])) + if (is_account_balancesheet($_POST["account"])) $begin = ""; else { - if ($from < $begin) - $begin = add_days($_POST['TransFromDate'], -1); - else - $begin = add_days(begin_fiscalyear(), -1); + $begin = begin_fiscalyear(); + if ($_POST['TransFromDate'] < $begin) + $begin = $_POST['TransFromDate']; + $begin = add_days($begin, -1); } $bfw = get_gl_balance_from_to($begin, $_POST['TransFromDate'], $_POST["account"], $_POST['Dimension'], $_POST['Dimension2']); @@ -161,6 +156,8 @@ function show_results() end_row(); end_table(2); + if (db_num_rows($result) == 0) + display_note(_("No general ledger transactions have been created for this account on the selected dates."), 0, 1); } //---------------------------------------------------------------------------------------------------- diff --git a/gl/inquiry/gl_trial_balance.php b/gl/inquiry/gl_trial_balance.php index 4ab7a465..8a6ba2f9 100644 --- a/gl/inquiry/gl_trial_balance.php +++ b/gl/inquiry/gl_trial_balance.php @@ -100,10 +100,10 @@ function display_trial_balance() $begin = null; else { - if ($from < $begin) - $begin = add_days($_POST['TransFromDate'], -1); - else - $begin = add_days(begin_fiscalyear(), -1); + $begin = begin_fiscalyear(); + if ($_POST['TransFromDate'] < $begin) + $begin = $_POST['TransFromDate']; + $begin = add_days($begin, -1); } $prev_balance = get_balance($account["account_code"], $begin, $_POST['TransFromDate'], false, false);