Fix deletion of bank category/tag

This commit is contained in:
Laurent Destailleur 2017-02-27 12:14:32 +01:00
parent d5dc88d66b
commit 9a9887f482

View File

@ -526,7 +526,17 @@ class Categorie extends CommonObject
}
if (! $error)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_project";
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_contact";
$sql .= " WHERE fk_categorie = ".$this->id;
if (!$this->db->query($sql))
{
$this->error=$this->db->lasterror();
$error++;
}
}
if (! $error)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_account";
$sql .= " WHERE fk_categorie = ".$this->id;
if (!$this->db->query($sql))
{
@ -535,7 +545,18 @@ class Categorie extends CommonObject
$error++;
}
}
if (! $error)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."bank_class";
$sql .= " WHERE fk_categ = ".$this->id;
if (!$this->db->query($sql))
{
$this->error=$this->db->lasterror();
dol_syslog("Error sql=".$sql." ".$this->error, LOG_ERR);
$error++;
}
}
if (! $error)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_lang";