X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=gl%2Fmanage%2Fgl_account_types.php;h=fcea4dbfcc32611445e8cadf679ba780db94d78f;hb=9a98bb3bc7a94f1a8e47f8dab45a87c8b4212080;hp=b3e56aca8b1a82e0df8f46191bb709986f37fbd7;hpb=76ca9fef9bb510236a6a7740fa0f60eb7db384c9;p=fa-stable.git diff --git a/gl/manage/gl_account_types.php b/gl/manage/gl_account_types.php index b3e56aca..fcea4dbf 100644 --- a/gl/manage/gl_account_types.php +++ b/gl/manage/gl_account_types.php @@ -79,19 +79,18 @@ if ($Mode=='ADD_ITEM' || $Mode=='UPDATE_ITEM') //----------------------------------------------------------------------------------- -function can_delete($selected_id) +function can_delete($type) { - if ($selected_id == "") + if ($type == "") return false; - $type = db_escape($selected_id); - if (key_in_foreign_table($type, 'chart_master', 'account_type', true)) + if (key_in_foreign_table($type, 'chart_master', 'account_type')) { display_error(_("Cannot delete this account group because GL accounts have been created referring to it.")); return false; } - if (key_in_foreign_table($type, 'chart_types', 'parent', true)) + if (key_in_foreign_table($type, 'chart_types', 'parent')) { display_error(_("Cannot delete this account group because GL account groups have been created referring to it.")); return false;