From: Joe Hunt Date: Wed, 1 Dec 2010 10:14:39 +0000 (+0000) Subject: Better test for correct balance accounts when closing fiscal year. X-Git-Tag: v2.4.2~19^2~443 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=af781e43e60e9cbaea7f7466678a28ca5d67d56c;p=fa-stable.git Better test for correct balance accounts when closing fiscal year. --- diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 21738177..4b413994 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -19,6 +19,10 @@ Legend: ! -> Note $ -> Affected files +01-Dec-2010 Joe Hunt +! Better test for correct balance accounts when closing fiscal year. +$ /admin/db/fiscalyear_db.inc + 29-Nov-2010 Janusz Dobrowolski # [0000290] Fixed side bug after last changes (can't upload file). $ /admin/backups.php diff --git a/admin/db/fiscalyears_db.inc b/admin/db/fiscalyears_db.inc index 669e8c3c..ff4e4bcd 100644 --- a/admin/db/fiscalyears_db.inc +++ b/admin/db/fiscalyears_db.inc @@ -124,6 +124,12 @@ function close_year($year) 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; + } + begin_transaction(); $myrow = get_fiscalyear($year);