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
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;
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))
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))