diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 31de0f24b20..9af346b35e3 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -14,6 +14,7 @@ * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2017 Rui Strecht * Copyright (C) 2018 Philippe Grand + * Copyright (C) 2019 Josep Lluís Amador * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1278,7 +1279,7 @@ class Societe extends CommonObject $sql .= ' WHERE s.entity IN ('.getEntity($this->element).')'; if ($rowid) $sql .= ' AND s.rowid = '.$rowid; if ($ref) $sql .= " AND s.nom = '".$this->db->escape($ref)."'"; - if ($ref_alias) $sql .= " AND s.nom_alias = '".$this->db->escape($ref_alias)."'"; + if ($ref_alias) $sql .= " AND s.name_alias = '".$this->db->escape($ref_alias)."'"; if ($ref_ext) $sql .= " AND s.ref_ext = '".$this->db->escape($ref_ext)."'"; if ($ref_int) $sql .= " AND s.ref_int = '".$this->db->escape($ref_int)."'"; if ($idprof1) $sql .= " AND s.siren = '".$this->db->escape($idprof1)."'";