From 102b698c76c49bf7222fd69d9378671346389d52 Mon Sep 17 00:00:00 2001 From: atm-ph Date: Fri, 31 Aug 2018 11:38:45 +0200 Subject: [PATCH 1/2] Fix search company by code --- htdocs/core/class/html.form.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index bd7feb9414d1b..50f8d1f96793d 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1103,7 +1103,8 @@ function select_thirdparty_list($selected='',$htmlname='socid',$filter='',$showe if (! empty($conf->barcode->enabled)) { $sql .= " OR s.barcode LIKE '".$this->db->escape($filterkey)."%'"; - } + } + $sql.= " OR s.code_client LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.code_fournisseur LIKE '".$this->db->escape($prefix.$filterkey)."%'"; $sql.=")"; } $sql.=$this->db->order("nom","ASC"); From 945e92539929f5129d9f38b74b54056d2d5ea956 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 1 Sep 2018 14:41:44 +0200 Subject: [PATCH 2/2] Update html.form.class.php --- htdocs/core/class/html.form.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 50f8d1f96793d..3eb96cf7e6ff5 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1102,9 +1102,9 @@ function select_thirdparty_list($selected='',$htmlname='socid',$filter='',$showe if (count($scrit) > 1) $sql.=")"; if (! empty($conf->barcode->enabled)) { - $sql .= " OR s.barcode LIKE '".$this->db->escape($filterkey)."%'"; - } - $sql.= " OR s.code_client LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.code_fournisseur LIKE '".$this->db->escape($prefix.$filterkey)."%'"; + $sql .= " OR s.barcode LIKE '".$this->db->escape($prefix.$filterkey)."%'"; + } + $sql.= " OR s.code_client LIKE '".$this->db->escape($prefix.$filterkey)."%' OR s.code_fournisseur LIKE '".$this->db->escape($prefix.$filterkey)."%'"; $sql.=")"; } $sql.=$this->db->order("nom","ASC");