Moved all SQL statements from PHP files into relevant *_db.inc files.
[fa-stable.git] / gl / manage / gl_account_classes.php
index bc141c377828e0418ecef9d98f47ae7e04ec8e90..d90a952402b033d33a51f0d19eb68f2289a98aba 100644 (file)
@@ -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;