Merge pull request #9860 from atm-gauthier/7.0_fix_nb_occurrences_contrat

FIX : wrong occurence number of contract on contact card, we must only count externals
This commit is contained in:
Laurent Destailleur 2018-10-24 12:24:57 +02:00 committed by GitHub
commit 7a14a1716d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -860,6 +860,7 @@ class Contact extends CommonObject
$sql.=" FROM ".MAIN_DB_PREFIX."element_contact as ec, ".MAIN_DB_PREFIX."c_type_contact as tc";
$sql.=" WHERE ec.fk_c_type_contact = tc.rowid";
$sql.=" AND fk_socpeople = ". $this->id;
$sql.=" AND tc.source = 'external'";
$sql.=" GROUP BY tc.element";
dol_syslog(get_class($this)."::load_ref_elements", LOG_DEBUG);