diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index bd7feb9414d1b..3eb96cf7e6ff5 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -1102,8 +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.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");