X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=admin%2Ffiscalyears.php;h=8874ea7de99dd0a848a5151dd243cdadc111ad89;hb=7618d9d62ee39a932f56565a4ce25d965bf53462;hp=5db546b1aef3f09245dcd7efaf97d7b098a8495e;hpb=1571869d54be48452fdbe08f25130972ff0a7b5a;p=fa-stable.git diff --git a/admin/fiscalyears.php b/admin/fiscalyears.php index 5db546b1..8874ea7d 100644 --- a/admin/fiscalyears.php +++ b/admin/fiscalyears.php @@ -20,7 +20,7 @@ include_once($path_to_root . "/includes/ui.inc"); include_once($path_to_root . "/sales/includes/db/cust_trans_db.inc"); include_once($path_to_root . "/admin/db/maintenance_db.inc"); $js = ""; -if ($use_date_picker) +if (user_use_date_picker()) $js .= get_js_date_picker(); page(_($help_context = "Fiscal Years"), false, false, "", $js); @@ -71,6 +71,18 @@ function handle_submit() set_focus('closed'); return false; } + $co = get_company_prefs(); + if (get_gl_account($co['retained_earnings_act']) == false || get_gl_account($co['profit_loss_year_act']) == false) + { + display_error(_("The Retained Earnings Account or the Profit and Loss Year Account has not been set in System and General GL Setup")); + return false; + } + if (!is_account_balancesheet($co['retained_earnings_act']) || is_account_balancesheet($co['profit_loss_year_act'])) + { + display_error(_("The Retained Earnings Account should be a Balance Account or the Profit and Loss Year Account should be an Expense Account (preferred the last one in the Expense Class)")); + return false; + } + $ok = close_year($selected_id); } else @@ -253,4 +265,3 @@ display_fiscalyear_edit($selected_id); end_page(); -?>