Fixes in sales reports to use debtor_trans.tax_included field instead of trans_tax_de...
[fa-stable.git] / gl / manage / close_period.php
index 76fc317f237eda874a4fd33dc1a491cc85b991fc..fc057c25827bb85c22e91ad5837dc3994ab7ddbb 100644 (file)
@@ -17,6 +17,7 @@ include_once($path_to_root . "/includes/session.inc");
 include_once($path_to_root . "/includes/date_functions.inc");
 include_once($path_to_root . "/includes/ui.inc");
 include_once($path_to_root . "/includes/banking.inc");
+include_once($path_to_root . "/admin/db/fiscalyears_db.inc");
 
 $js = "";
 if ($use_date_picker)
@@ -34,6 +35,12 @@ function check_data()
                set_focus('date');
                return false;
        }
+       if (!is_date_in_fiscalyears($_POST['date'], false))
+       {
+               display_error(_("Selected date is not in fiscal year or the year is closed."));
+               set_focus('date');
+               return false;
+       }
        if (date1_greater_date2(sql2date(get_company_pref('gl_closing_date')), $_POST['date']))
        {
                if (!$allow_gl_reopen) {