X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=gl%2Fmanage%2Fgl_account_classes.php;h=d90a952402b033d33a51f0d19eb68f2289a98aba;hb=0bf933423b9645bcb57390c478d4fdaf0c895049;hp=bc141c377828e0418ecef9d98f47ae7e04ec8e90;hpb=d2cc0860eccf02eaefcd90731ac3af141a841529;p=fa-stable.git diff --git a/gl/manage/gl_account_classes.php b/gl/manage/gl_account_classes.php index bc141c37..d90a9524 100644 --- a/gl/manage/gl_account_classes.php +++ b/gl/manage/gl_account_classes.php @@ -71,11 +71,7 @@ function can_delete($selected_id) { if ($selected_id == -1) return false; - $sql= "SELECT COUNT(*) FROM ".TB_PREF."chart_types - WHERE class_id=$selected_id"; - $result = db_query($sql, "could not query chart master"); - $myrow = db_fetch_row($result); - if ($myrow[0] > 0) + if (account_class_in_account_types($selected_id)) { display_error(_("Cannot delete this account class because GL account types have been created referring to it.")); return false;