From 44f3e64df207f87edc704b9aae267ea31b141ca6 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Wed, 19 Nov 2014 09:28:11 +0100 Subject: [PATCH] Update html.formcontract.class.php bad filtering on contract list (same sql rule as project) --- htdocs/core/class/html.formcontract.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formcontract.class.php b/htdocs/core/class/html.formcontract.class.php index e0d550b4205..0eb2d4d4b26 100644 --- a/htdocs/core/class/html.formcontract.class.php +++ b/htdocs/core/class/html.formcontract.class.php @@ -65,7 +65,7 @@ class FormContract $sql.= " WHERE c.entity = ".$conf->entity; //if ($contratListId) $sql.= " AND c.rowid IN (".$contratListId.")"; if ($socid == 0) $sql.= " AND (c.fk_soc = 0 OR c.fk_soc IS NULL)"; - else $sql.= " AND c.fk_soc = ".$socid; + if ($socid > 0) $sql.= " AND (c.fk_soc=".$socid." OR c.fk_soc IS NULL)"; dol_syslog(get_class($this)."::select_contract", LOG_DEBUG); $resql=$db->query($sql);