diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index a3bb701a259..11f29f79089 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1375,7 +1375,6 @@ class Societe extends CommonObject { $sql = "DELETE FROM ".MAIN_DB_PREFIX."socpeople"; $sql.= " WHERE fk_soc = " . $id; - dol_syslog(get_class($this)."::delete", LOG_DEBUG); if (! $this->db->query($sql)) { $error++; @@ -1388,7 +1387,6 @@ class Societe extends CommonObject { $sql = "UPDATE ".MAIN_DB_PREFIX."adherent"; $sql.= " SET fk_soc = NULL WHERE fk_soc = " . $id; - dol_syslog(get_class($this)."::delete", LOG_DEBUG); if (! $this->db->query($sql)) { $error++; @@ -1402,7 +1400,18 @@ class Societe extends CommonObject { $sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_rib"; $sql.= " WHERE fk_soc = " . $id; - dol_syslog(get_class($this)."::Delete", LOG_DEBUG); + if (! $this->db->query($sql)) + { + $error++; + $this->error = $this->db->lasterror(); + } + } + + // Remove societe_remise_except + if (! $error) + { + $sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_remise_except"; + $sql.= " WHERE fk_soc = " . $id; if (! $this->db->query($sql)) { $error++; @@ -1415,7 +1424,6 @@ class Societe extends CommonObject { $sql = "DELETE FROM ".MAIN_DB_PREFIX."societe_commerciaux"; $sql.= " WHERE fk_soc = " . $id; - dol_syslog(get_class($this)."::Delete", LOG_DEBUG); if (! $this->db->query($sql)) { $error++;