From f9b3cead84d43e5b4a563120d320c2912fef0884 Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Thu, 3 Mar 2011 13:00:11 +0100 Subject: [PATCH] Don't allow inactivating of bank accounts. --- gl/manage/gl_accounts.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gl/manage/gl_accounts.php b/gl/manage/gl_accounts.php index 8944d385..097eddeb 100644 --- a/gl/manage/gl_accounts.php +++ b/gl/manage/gl_accounts.php @@ -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'); -- 2.30.2