X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=admin%2Ffiscalyears.php;h=4e62ad720ba9e4f0430186d0b85abe09e5166c91;hb=d4678f33fdafbdd8a0d97c9188bca0ec03f3bef8;hp=9bbf4040579ac14c45f0a948c0675593b8251e55;hpb=c09be0dad6b05131e240349a375af7a4b7bf3444;p=fa-stable.git diff --git a/admin/fiscalyears.php b/admin/fiscalyears.php index 9bbf4040..4e62ad72 100644 --- a/admin/fiscalyears.php +++ b/admin/fiscalyears.php @@ -1,5 +1,14 @@ . +***********************************************************************/ $page_security = 9; $path_to_root=".."; include_once($path_to_root . "/includes/session.inc"); @@ -52,16 +61,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')); } @@ -142,7 +150,7 @@ function display_fiscalyears() label_cell($closed_text); edit_button_cell("Edit".$myrow['id'], _("Edit")); if ($myrow["id"] != $company_year) - edit_button_cell("Delete".$myrow['id'], _("Delete")); + delete_button_cell("Delete".$myrow['id'], _("Delete")); else label_cell(''); end_row();