Merge pull request #21528 from atm-GregM/FIX_dolibarr_15.0_disabled_contacts_not_returned_create_invoice

FIX contacts disabled are not returned on create invoice
This commit is contained in:
Laurent Destailleur 2023-01-13 12:17:40 +01:00 committed by GitHub
commit efa9b4da33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1789,6 +1789,8 @@ 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 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)."'";