From: Joe Hunt Date: Fri, 8 Jul 2016 06:49:19 +0000 (+0200) Subject: Bug. is_date_closed() should be performed before is_date_in_fiscalyears(). X-Git-Tag: v2.4.2~19^2~43 X-Git-Url: https://delta.frontaccounting.com/gitweb/?p=fa-stable.git;a=commitdiff_plain;h=8143beb0b9260509cfd1e73acd3d29c965760763 Bug. is_date_closed() should be performed before is_date_in_fiscalyears(). --- 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']);