update sql

This commit is contained in:
GregM 2022-08-30 16:53:14 +02:00
parent f40ab59b37
commit 8cc9d72b37

View File

@ -1777,12 +1777,11 @@ class Contact extends CommonObject
$sql .= " FROM ".MAIN_DB_PREFIX."c_type_contact tc";
$sql .= ", ".MAIN_DB_PREFIX."societe_contacts sc";
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."socpeople sp";
$sql .= " ON sc.fk_socpeople = sp.rowid";
$sql .= " ON sc.fk_socpeople = sp.rowid AND sp.statut = 1";
$sql .= " WHERE sc.fk_soc =".((int) $this->socid);
$sql .= " AND sc.fk_c_type_contact=tc.rowid";
$sql .= " AND tc.element = '".$this->db->escape($element)."'";
$sql .= " AND tc.active = 1";
$sql .= " AND sp.statut = 1";
dol_syslog(__METHOD__, LOG_DEBUG);
$resql = $this->db->query($sql);