From 036f70860e6440c3177439f6878de05ab2fefaff Mon Sep 17 00:00:00 2001 From: gauthier Date: Wed, 24 Oct 2018 10:17:21 +0200 Subject: [PATCH] FIX : wrong occurence number of contract on contact card, we must only count externals --- htdocs/contact/class/contact.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 036ee75a43d..bea6843de5f 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -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);