From 0d0c282d827127ea27af943ca398a2f4652168cb Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Fri, 3 Dec 2010 00:27:54 +0000 Subject: [PATCH] Changed so it is not possible to select a from date bigger than fiscal year end in trial balance. --- CHANGELOG.txt | 2 ++ gl/inquiry/gl_trial_balance.php | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index ccf88c08..3703cd33 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -22,6 +22,8 @@ $ -> Affected files 02-Dec-2010 Joe Hunt # When deleting a fiscal year, the open balances should share the same trans no. $ /admin/db/fiscalyear_db.inc +! Changed so it is not possible to select a from date bigger than fiscal year end in trial balance. +$ /gl/inquiry/gl_trial_balance.php 01-Dec-2010 Joe Hunt ! Better test for correct balance accounts when closing fiscal year. diff --git a/gl/inquiry/gl_trial_balance.php b/gl/inquiry/gl_trial_balance.php index 818fd1b5..580cefa3 100644 --- a/gl/inquiry/gl_trial_balance.php +++ b/gl/inquiry/gl_trial_balance.php @@ -15,6 +15,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 . "/admin/db/fiscalyears_db.inc"); include_once($path_to_root . "/includes/ui.inc"); include_once($path_to_root . "/includes/data_checks.inc"); @@ -62,6 +63,16 @@ function display_trial_balance() { global $path_to_root; + if (isset($_POST['TransFromDate'])) + { + $row = get_current_fiscalyear(); + if (date1_greater_date2($_POST['TransFromDate'], sql2date($row['end']))) + { + display_error(_("The from date cannot be bigger than the fiscal year end.")); + set_focus('TransFromDate'); + return; + } + } div_start('balance_tbl'); if (!isset($_POST['Dimension'])) $_POST['Dimension'] = 0; -- 2.30.2