X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=admin%2Ffiscalyears.php;h=d886608f92cd4feba91ba2a0f00db3e7a0baea0e;hb=7ce9ff6a73214a39ff495f04b330563212b43acb;hp=6f3071648c879be0f5cf58ca1f7771a3ab57148a;hpb=d9b4de9d7e9d3ba77f6ece752fd6cc988effd8f1;p=fa-stable.git diff --git a/admin/fiscalyears.php b/admin/fiscalyears.php index 6f307164..d886608f 100644 --- a/admin/fiscalyears.php +++ b/admin/fiscalyears.php @@ -29,7 +29,7 @@ simple_page_mode(true); function check_data() { - if (!is_date($_POST['from_date']) || is_date_in_fiscalyears($_POST['from_date']) || is_bad_begin_date($_POST['from_date'])) + if (!is_date($_POST['from_date']) || is_date_in_fiscalyears($_POST['from_date'])) { display_error( _("Invalid BEGIN date in fiscal year.")); set_focus('from_date'); @@ -41,6 +41,12 @@ function check_data() set_focus('to_date'); return false; } + if (!check_begin_end_date($_POST['from_date'], $_POST['to_date'])) + { + display_error( _("Invalid BEGIN or END date in fiscal year.")); + set_focus('from_date'); + return false; + } if (date1_greater_date2($_POST['from_date'], $_POST['to_date'])) { display_error( _("BEGIN date bigger than END date.")); @@ -126,7 +132,7 @@ function display_fiscalyears() start_form(); display_note(_("Warning: Deleting a fiscal year all transactions are removed and converted into relevant balances. This process is irreversible!"), - 0, 0, "class='currentfg'"); + 0, 1, "class='currentfg'"); start_table(TABLESTYLE); $th = array(_("Fiscal Year Begin"), _("Fiscal Year End"), _("Closed"), "", ""); @@ -196,6 +202,12 @@ function display_fiscalyear_edit($selected_id) } else { + $begin = next_begin_date(); + if ($begin && $Mode != 'ADD_ITEM') + { + $_POST['from_date'] = $begin; + $_POST['to_date'] = end_month(add_months($begin, 11)); + } date_row(_("Fiscal Year Begin:"), 'from_date', '', null, 0, 0, 1001); date_row(_("Fiscal Year End:"), 'to_date', '', null, 0, 0, 1001); }