From 8143beb0b9260509cfd1e73acd3d29c965760763 Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Fri, 8 Jul 2016 08:49:19 +0200 Subject: [PATCH] Bug. is_date_closed() should be performed before is_date_in_fiscalyears(). --- admin/void_transaction.php | 2 +- includes/date_functions.inc | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/admin/void_transaction.php b/admin/void_transaction.php index 13f1e439..f490cb23 100644 --- a/admin/void_transaction.php +++ b/admin/void_transaction.php @@ -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; } diff --git a/includes/date_functions.inc b/includes/date_functions.inc index af054563..7aa16acc 100644 --- a/includes/date_functions.inc +++ b/includes/date_functions.inc @@ -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']); -- 2.30.2