X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=admin%2Fgl_setup.php;h=79cda9b9911aaabbdc52770a66f8f1ef9c65dcda;hb=1571869d54be48452fdbe08f25130972ff0a7b5a;hp=670ee1a17c6093c94a5d8839e74bf08c9c2162c0;hpb=7e830126b96477e969fe3b48d9fc0e78f6c1fe00;p=fa-stable.git diff --git a/admin/gl_setup.php b/admin/gl_setup.php index 670ee1a1..79cda9b9 100644 --- a/admin/gl_setup.php +++ b/admin/gl_setup.php @@ -47,13 +47,18 @@ function can_process() } $grn_act = get_company_pref('grn_clearing_act'); - if ((get_post('grn_clearing_act',0) != $grn_act) && db_num_rows(get_grn_items(0, '', true))) + if ((get_post('grn_clearing_act') != $grn_act) && db_num_rows(get_grn_items(0, '', true))) { display_error(_("Before GRN Clearing Account can be changed all GRNs have to be invoiced")); $_POST['grn_clearing_act'] = $grn_act; set_focus('grn_clearing_account'); return false; } + if (!is_account_balancesheet(get_post('retained_earnings_act')) || is_account_balancesheet(get_post('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; + } return true; } @@ -83,7 +88,8 @@ start_form(); start_outer_table(TABLESTYLE2); table_section(1); -if (get_company_pref('grn_clearing_act') === null) { // available form 2.3.1, can be not defined on pre-2.4 installations + +if (get_company_pref('grn_clearing_act') === null) { // available from 2.3.1, can be not defined on pre-2.4 installations set_company_pref('grn_clearing_act', 'glsetup.purchase', 'varchar', 15, 0); refresh_sys_prefs(); }