return false;
$acc = db_escape($selected_account);
- if (gl_account_in_transactions($acc))
+ if (key_in_foreign_table($acc, 'gl_trans', 'account', true))
{
display_error(_("Cannot delete this account because transactions have been created using this account."));
return false;
display_error(_("Cannot delete this account because it is used as one of the company default GL accounts."));
return false;
}
-
- if (gl_account_in_bank_accounts($acc))
+
+ if (key_in_foreign_table($acc, 'bank_accounts', 'account_code', true))
{
display_error(_("Cannot delete this account because it is used by a bank account."));
return false;
if (db_has_gl_accounts())
{
- start_table("class = 'tablestyle_noborder'");
+ start_table(TABLESTYLE_NOBORDER);
start_row();
gl_all_accounts_list_cells(null, 'AccountList', null, false, false,
_('New account'), true, check_value('show_inactive'));
}
br(1);
-start_table($table_style2);
+start_table(TABLESTYLE2);
if ($selected_account != "")
{
$_POST['account_name'] = $_POST['account_type'] = '';
$_POST['inactive'] = 0;
}
- text_row_ex(_("Account Code:"), 'account_code', 11);
+ text_row_ex(_("Account Code:"), 'account_code', 15);
}
-text_row_ex(_("Account Code 2:"), 'account_code2', 11);
+text_row_ex(_("Account Code 2:"), 'account_code2', 15);
text_row_ex(_("Account Name:"), 'account_name', 60);