From f9a5e41b07e0692301a89b475b6e1fce680e0c8d Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Fri, 4 Jul 2008 21:35:44 +0000 Subject: [PATCH] Removed unused GL account settings --- admin/db/company_db.inc | 12 +++------- gl/manage/gl_accounts.php | 49 +++++++++++++++++++++------------------ 2 files changed, 29 insertions(+), 32 deletions(-) diff --git a/admin/db/company_db.inc b/admin/db/company_db.inc index 5108f3aa..e288e1aa 100644 --- a/admin/db/company_db.inc +++ b/admin/db/company_db.inc @@ -1,9 +1,8 @@ activate('_page_body'); + } + } } @@ -87,10 +95,6 @@ function can_delete($selected_account) $sql= "SELECT COUNT(*) FROM ".TB_PREF."company WHERE debtors_act='$selected_account' OR pyt_discount_act='$selected_account' OR creditors_act='$selected_account' - OR grn_act='$selected_account' - OR exchange_diff_act='$selected_account' - OR purch_exchange_diff_act='$selected_account' - OR retained_earnings_act='$selected_account' OR freight_act='$selected_account' OR default_sales_act='$selected_account' OR default_sales_discount_act='$selected_account' @@ -99,8 +103,7 @@ function can_delete($selected_account) OR default_cogs_act='$selected_account' OR default_adj_act='$selected_account' OR default_inv_sales_act='$selected_account' - OR default_assembly_act='$selected_account' - OR payroll_act='$selected_account'"; + OR default_assembly_act='$selected_account'"; $result = db_query($sql,"Couldn't test for default company GL codes"); $myrow = db_fetch_row($result); @@ -182,7 +185,9 @@ if (isset($_POST['delete'])) if (can_delete($selected_account)) { delete_gl_account($selected_account); - meta_forward($_SERVER['PHP_SELF']); + $selected_account = $_POST['account_code'] = $_POST['AccountList'] = ''; + display_notification("Selected account has been deleted"); + $Ajax->activate('_page_body'); } } @@ -194,15 +199,12 @@ if (db_has_gl_accounts()) { echo "
"; echo _("Select an Account:") . " "; - gl_all_accounts_list('AccountList', null); - echo " "; - submit('Select', _("Edit Account")); + gl_all_accounts_list('AccountList', null, false, false, false, + _('New account'), true); echo "
"; -} +} -hyperlink_no_params($_SERVER['PHP_SELF'], _("New Account")); br(1); - start_table($table_style2); if ($selected_account != "") @@ -217,12 +219,14 @@ if ($selected_account != "") $_POST['tax_code'] = $myrow["tax_code"]; hidden('account_code', $_POST['account_code']); - hidden('selected_account', $_POST['selected_account']); + hidden('selected_account', $selected_account); label_row(_("Account Code:"), $_POST['account_code']); } else { + $_POST['account_code'] = $_POST['account_code2'] = ''; + $_POST['account_name'] = $_POST['account_type'] = $_POST['tax_code'] = ''; text_row_ex(_("Account Code:"), 'account_code', 11); } @@ -238,14 +242,13 @@ end_table(1); if ($selected_account == "") { - submit_center('add', _("Add Account")); + submit_center('add', _("Add Account"), true, '', true); } else { - submit_center_first('update', _("Update Account")); - submit_center_last('delete', _("Delete account")); + submit_center_first('update', _("Update Account"), '', true); + submit_center_last('delete', _("Delete account"), '',true); } - end_form(); end_page(); -- 2.30.2