FIX contacts disabled are not returned on create invoice

This commit is contained in:
GregM 2022-07-19 16:08:38 +02:00
parent e3a4b5f12e
commit f40ab59b37

View File

@ -1776,10 +1776,13 @@ class Contact extends CommonObject
$sql = "SELECT sc.fk_socpeople as id, sc.fk_c_type_contact";
$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 .= " 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);