X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=admin%2Ffiscalyears.php;h=8dfe4a8f5197d6c084d6558e07f0c9ab45896337;hb=14542a514b498def3c48dd27031f2f77fd2db967;hp=9bbf4040579ac14c45f0a948c0675593b8251e55;hpb=e82fa1f01d7f0d7706b9d3e2efaa9a31cc0777f6;p=fa-stable.git diff --git a/admin/fiscalyears.php b/admin/fiscalyears.php index 9bbf4040..8dfe4a8f 100644 --- a/admin/fiscalyears.php +++ b/admin/fiscalyears.php @@ -52,16 +52,15 @@ function handle_submit() { global $selected_id, $Mode; - if (!check_data()) - return false; - if ($selected_id != -1) { - update_fiscalyear($_POST['from_date'], $_POST['closed']); + update_fiscalyear($selected_id, $_POST['closed']); display_notification(_('Selected fiscal year has been updated')); } else { + if (!check_data()) + return false; add_fiscalyear($_POST['from_date'], $_POST['to_date'], $_POST['closed']); display_notification(_('New fiscal year has been added')); }