Changed so it is not possible to select a from date bigger than fiscal year end in...
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Fri, 3 Dec 2010 00:27:54 +0000 (00:27 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Fri, 3 Dec 2010 00:27:54 +0000 (00:27 +0000)
CHANGELOG.txt
gl/inquiry/gl_trial_balance.php

index ccf88c08b529f992b21de9e3e9389bbbd5390d30..3703cd338e00c55a556f30b2b7bc7c663069e60f 100644 (file)
@@ -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.
index 818fd1b5de94e3ac3ec9bd7a2f20990be402c942..580cefa3372b1d7c7b11df38a6aec406800f7557 100644 (file)
@@ -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;