if (get_post('inactive') == 1 && is_bank_account($_POST['account_code']))
{
display_error(_("The account belongs to a bank account and cannot be inactivated."));
if (get_post('inactive') == 1 && 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'],
elseif (update_gl_account($_POST['account_code'], $_POST['account_name'],
$_POST['account_type'], $_POST['account_code2'])) {
update_record_status($_POST['account_code'], $_POST['inactive'],
display_notification(_("New account has been added."));
$selected_account = $_POST['AccountList'] = $_POST['account_code'];
}
display_notification(_("New account has been added."));
$selected_account = $_POST['AccountList'] = $_POST['account_code'];
}
- if (key_in_foreign_table($selected_account, 'gl_trans', 'account', true))
+ if (key_in_foreign_table($selected_account, 'gl_trans', 'account'))
- if (key_in_foreign_table($selected_account, 'bank_accounts', 'account_code', true))
+ if (key_in_foreign_table($selected_account, 'bank_accounts', 'account_code'))
if (gl_account_in_stock_category($selected_account))
{
display_error(_("Cannot delete this account because it is used by one or more Item Categories."));
return false;
if (gl_account_in_stock_category($selected_account))
{
display_error(_("Cannot delete this account because it is used by one or more Item Categories."));
return false;
if (gl_account_in_stock_master($selected_account))
{
display_error(_("Cannot delete this account because it is used by one or more Items."));
return false;
if (gl_account_in_stock_master($selected_account))
{
display_error(_("Cannot delete this account because it is used by one or more Items."));
return false;
if (gl_account_in_tax_types($selected_account))
{
display_error(_("Cannot delete this account because it is used by one or more Taxes."));
return false;
if (gl_account_in_tax_types($selected_account))
{
display_error(_("Cannot delete this account because it is used by one or more Taxes."));
return false;
if (gl_account_in_cust_branch($selected_account))
{
display_error(_("Cannot delete this account because it is used by one or more Customer Branches."));
return false;
if (gl_account_in_cust_branch($selected_account))
{
display_error(_("Cannot delete this account because it is used by one or more Customer Branches."));
return false;
if (gl_account_in_suppliers($selected_account))
{
display_error(_("Cannot delete this account because it is used by one or more suppliers."));
if (gl_account_in_suppliers($selected_account))
{
display_error(_("Cannot delete this account because it is used by one or more suppliers."));