Merged changes up to version 2.3.4 into unstable.
[fa-stable.git] / gl / manage / gl_accounts.php
index 8944d385f35a311682e97a83e49197f0a969d0e5..9e5106806385c271b52d174b466a0b3fd976aca2 100644 (file)
@@ -76,7 +76,11 @@ if (isset($_POST['add']) || isset($_POST['update']))
 
        if ($selected_account) 
                {
-               if (update_gl_account($_POST['account_code'], $_POST['account_name'], 
+                       if (check_value('inactive') && is_bank_account($_POST['account_code']))
+                       {
+                               display_error(_("The account belongs to a bank account and cannot be inactivated."));
+                       }
+               elseif (update_gl_account($_POST['account_code'], $_POST['account_name'], 
                                $_POST['account_type'], $_POST['account_code2'])) {
                                update_record_status($_POST['account_code'], $_POST['inactive'],
                                        'chart_master', 'account_code');