From 3f361f69940fa9c2e0ff68657c6345ca0f14256f Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Wed, 30 Sep 2009 13:27:06 +0000 Subject: [PATCH] Trivial errors in not set bank charge account, retained earnings or profit/loss year account --- CHANGELOG.txt | 7 +++++++ admin/fiscalyears.php | 2 +- purchasing/supplier_payment.php | 11 +++++++---- sales/customer_payments.php | 12 +++++++----- 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 5eb0a17b..18790d6b 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -23,6 +23,13 @@ $ -> Affected files 30-Sep-2009 Joe Hunt ! Release 2.2 Beta $ config.php +# Errors in the 2 last user variables in userprefs and parse error in alter2.2.php +$ /includes/prefs/userprefs.inc + /sql/alter2.2.php +# Trivial errors in not set bank charge account, retained earnings or profit/loss year account +$ /admin/fiscalyears.php + /purchasing/supplier_payment.php + /sales/customer_payments.php 30-Sep-2009 Janusz Dobrowolski ! Single quotes also encoded before database data insert diff --git a/admin/fiscalyears.php b/admin/fiscalyears.php index cbfdd80e..7a4b2a36 100644 --- a/admin/fiscalyears.php +++ b/admin/fiscalyears.php @@ -86,7 +86,7 @@ function check_data() function close_year($year) { $co = get_company_prefs(); - if ($co['retained_earnings_act'] == '' || $co['profit_loss_year_act'] == '') + 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; diff --git a/purchasing/supplier_payment.php b/purchasing/supplier_payment.php index 713d0122..d78ee47e 100644 --- a/purchasing/supplier_payment.php +++ b/purchasing/supplier_payment.php @@ -102,10 +102,13 @@ function check_inputs() return false; } - if (isset($_POST['charge']) && input_num('charge') > 0 && get_company_pref('bank_charge_act') == '') { - display_error(_("The Bank Charge Account has not been set in System and General GL Setup.")); - set_focus('charge'); - return false; + if (isset($_POST['charge']) && input_num('charge') > 0) { + $charge_acct = get_company_pref('bank_charge_act'); + if (get_gl_account($charge_acct) == false) { + display_error(_("The Bank Charge Account has not been set in System and General GL Setup.")); + set_focus('charge'); + return false; + } } if (isset($_POST['_ex_rate']) && !check_num('_ex_rate', 0.000001)) diff --git a/sales/customer_payments.php b/sales/customer_payments.php index 1dcce02d..afc30fa0 100644 --- a/sales/customer_payments.php +++ b/sales/customer_payments.php @@ -109,11 +109,13 @@ function can_process() set_focus('charge'); return false; } - - if (isset($_POST['charge']) && input_num('charge') > 0 && get_company_pref('bank_charge_act') == '') { - display_error(_("The Bank Charge Account has not been set in System and General GL Setup.")); - set_focus('charge'); - return false; + if (isset($_POST['charge']) && input_num('charge') > 0) { + $charge_acct = get_company_pref('bank_charge_act'); + if (get_gl_account($charge_acct) == false) { + display_error(_("The Bank Charge Account has not been set in System and General GL Setup.")); + set_focus('charge'); + return false; + } } if (isset($_POST['_ex_rate']) && !check_num('_ex_rate', 0.000001)) -- 2.30.2