diff --git a/htdocs/compta/bank/class/bankcateg.class.php b/htdocs/compta/bank/class/bankcateg.class.php index 02d80d7429cf273d8f1d95f203c6a772408b8756..6ceca9405712c378da69b19d6bd53b6b968b2ee2 100644 --- a/htdocs/compta/bank/class/bankcateg.class.php +++ b/htdocs/compta/bank/class/bankcateg.class.php @@ -202,7 +202,6 @@ class BankCateg // extends CommonObject // Delete link between tag and bank account if (! $error) { - //$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_class"; // No more used $sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_account"; $sql.= " WHERE fk_categorie = ".$this->id; @@ -214,6 +213,20 @@ class BankCateg // extends CommonObject } } + // Delete link between tag and bank lines + if (! $error) + { + $sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_class"; // No more used + $sql.= " WHERE fk_categ = ".$this->id; + + $resql = $this->db->query($sql); + if (!$resql) + { + $error++; + $this->errors[] = "Error ".$this->db->lasterror(); + } + } + // Delete bank categ if (! $error) {