Trivial errors in not set bank charge account, retained earnings or profit/loss year...
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Wed, 30 Sep 2009 13:27:06 +0000 (13:27 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Wed, 30 Sep 2009 13:27:06 +0000 (13:27 +0000)
CHANGELOG.txt
admin/fiscalyears.php
purchasing/supplier_payment.php
sales/customer_payments.php

index 5eb0a17bb93262b3127717102317f443f7b6e6d3..18790d6b98ac86ade5febea65ed08047dec1e24c 100644 (file)
@@ -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
index cbfdd80e754a12dd9cb2c998ea3d4701f2f8bb55..7a4b2a36c4104141affa3f0f665e6963facf148c 100644 (file)
@@ -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;
index 713d0122ffda7fc292716b9cf3a767bf1fea960e..d78ee47edb95a09d99fa0d1325bc8a29adb6cb62 100644 (file)
@@ -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))
index 1dcce02d3f6411535da166cefaa7a279f6cea83f..afc30fa0a1cd66bc4511d490b16b62a6778e3c2b 100644 (file)
@@ -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))