X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=admin%2Ffiscalyears.php;h=8dfe4a8f5197d6c084d6558e07f0c9ab45896337;hb=14542a514b498def3c48dd27031f2f77fd2db967;hp=1c9af0dc2257cb463088a571d98759532fb22074;hpb=89fc1800fdcffea2af2f11c66a977bba6065aa8d;p=fa-stable.git diff --git a/admin/fiscalyears.php b/admin/fiscalyears.php index 1c9af0dc..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')); } @@ -94,12 +93,11 @@ function handle_delete() { global $selected_id, $Mode; - if (!check_can_delete($selected_id)) - return; + if (check_can_delete($selected_id)) { //only delete if used in neither customer or supplier, comp prefs, bank trans accounts - - delete_fiscalyear($selected_id); - display_notification(_('Selected fiscal year has been deleted')); + delete_fiscalyear($selected_id); + display_notification(_('Selected fiscal year has been deleted')); + } $Mode = 'RESET'; }