FIX deletion of bank tag

This commit is contained in:
Laurent Destailleur 2017-02-27 12:06:45 +01:00
parent 10838983b5
commit 1be389fd3e

View File

@ -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)
{