Merge pull request #9451 from hregis/7.0_price

FIX better compatibility with multicompany
This commit is contained in:
Laurent Destailleur 2018-09-12 18:27:50 +02:00 committed by GitHub
commit 58ba1c3496
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1064,7 +1064,7 @@ abstract class CommonObject
$sql.= " ".MAIN_DB_PREFIX."c_type_contact as tc";
$sql.= " WHERE ec.element_id = ".$id;
$sql.= " AND ec.fk_socpeople = c.rowid";
if ($source == 'internal') $sql.= " AND c.entity IN (0,".$conf->entity.")";
if ($source == 'internal') $sql.= " AND c.entity IN (".getEntity('user').")";
if ($source == 'external') $sql.= " AND c.entity IN (".getEntity('societe').")";
$sql.= " AND ec.fk_c_type_contact = tc.rowid";
$sql.= " AND tc.element = '".$element."'";