Bug. is_date_closed() should be performed before is_date_in_fiscalyears().
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Fri, 8 Jul 2016 06:49:19 +0000 (08:49 +0200)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Fri, 8 Jul 2016 06:49:19 +0000 (08:49 +0200)
admin/void_transaction.php
includes/date_functions.inc

index 13f1e439df8f7b7b2712dd007f61846a1fef6310..f490cb237fe8b195e6073e39e3b927bdd0ab19a1 100644 (file)
@@ -250,7 +250,7 @@ function check_valid_entries()
        }
        if (!is_date_in_fiscalyear($_POST['date_']))
        {
-               display_error(_("The entered date is not in fiscal year."));
+               display_error(_("The entered date is out of fiscal year or is closed for further data entry."));
                set_focus('date_');
                return false;
        }
index af05456353a76e126a61e83c3f89ec49bf97ebcf..7aa16acc738823019b9a29d01ef6d79ced22d9d1 100644 (file)
@@ -199,11 +199,12 @@ function is_date_in_fiscalyear($date, $convert=false)
        else
                $date2 = $date;
 
+       if (is_date_closed($date2))
+               return 0;
+
        if (user_check_access('SA_MULTIFISCALYEARS')) // allow all open years for this one
                return is_date_in_fiscalyears($date2, false);
 
-       if (is_date_closed($date2))
-               return 0;
        $myrow = get_current_fiscalyear();
        $begin = sql2date($myrow['begin']);
        $end = sql2date($myrow['end']);