From 8b107b65e85db3dd1503598d8378a51f29371001 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 21 Feb 2012 18:08:21 +0800 Subject: [PATCH] Fix: compatibility with multi-company shared --- htdocs/core/modules/societe/mod_codeclient_monkey.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/societe/mod_codeclient_monkey.php b/htdocs/core/modules/societe/mod_codeclient_monkey.php index f2e59ee7e0c..07c451d6eba 100644 --- a/htdocs/core/modules/societe/mod_codeclient_monkey.php +++ b/htdocs/core/modules/societe/mod_codeclient_monkey.php @@ -117,7 +117,7 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode $sql = "SELECT MAX(SUBSTRING(".$field." FROM ".$posindice.")) as max"; // This is standard SQL $sql.= " FROM ".MAIN_DB_PREFIX."societe"; $sql.= " WHERE ".$field." LIKE '".$prefix."____-%'"; - $sql.= " AND entity = ".getEntity('societe'); + $sql.= " AND entity IN (".getEntity('societe', 1).")"; $resql=$db->query($sql); if ($resql) @@ -216,7 +216,7 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode $sql = "SELECT code_client FROM ".MAIN_DB_PREFIX."societe"; $sql.= " WHERE code_client = '".$code."'"; - $sql.= " AND entity = ".getEntity('societe'); + $sql.= " AND entity IN (".getEntity('societe', 1).")"; if ($soc->id > 0) $sql.= " AND rowid != ".$soc->id; dol_syslog(get_class($this)."::verif_dispo sql=".$sql, LOG_DEBUG);