diff --git a/htdocs/comm/list.php b/htdocs/comm/list.php index eebb066beed..7f461282359 100755 --- a/htdocs/comm/list.php +++ b/htdocs/comm/list.php @@ -47,6 +47,7 @@ if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="s.nom"; $search_nom=GETPOST("search_nom"); +$search_zipcode=GETPOST("search_zipcode"); $search_ville=GETPOST("search_ville"); $search_code=GETPOST("search_code"); $search_compta=GETPOST("search_compta"); @@ -77,6 +78,7 @@ if (GETPOST("button_removefilter_x")) $search_sale=''; $socname=""; $search_nom=""; + $search_zipcode=""; $search_ville=""; $search_idprof1=''; $search_idprof2=''; @@ -96,7 +98,7 @@ $thirdpartystatic=new Societe($db); $help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas'; llxHeader('',$langs->trans("ThirdParty"),$help_url); -$sql = "SELECT s.rowid, s.nom as name, s.client, s.ville, st.libelle as stcomm, s.prefix_comm, s.code_client, s.code_compta, s.status as status,"; +$sql = "SELECT s.rowid, s.nom as name, s.client, s.cp as zip, s.ville, st.libelle as stcomm, s.prefix_comm, s.code_client, s.code_compta, s.status as status,"; $sql.= " s.datec, s.datea, s.canvas"; // We'll need these fields in order to filter by sale (including the case where the user can only see his prospects) if ($search_sale) $sql .= ", sc.fk_soc, sc.fk_user"; @@ -116,6 +118,7 @@ if ($catid == -2) $sql.= " AND cs.fk_categorie IS NULL"; if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$search_categ; if ($search_categ == -2) $sql.= " AND cs.fk_categorie IS NULL"; if ($search_nom) $sql.= " AND s.nom LIKE '%".$db->escape(strtolower($search_nom))."%'"; +if ($search_zipcode) $sql.= " AND s.cp LIKE '%".$db->escape(strtolower($search_zipcode))."%'"; if ($search_ville) $sql.= " AND s.ville LIKE '%".$db->escape(strtolower($search_ville))."%'"; if ($search_code) $sql.= " AND s.code_client LIKE '%".$db->escape(strtolower($search_code))."%'"; if ($search_compta) $sql.= " AND s.code_compta LIKE '%".$db->escape($search_compta)."%'"; @@ -149,7 +152,7 @@ if ($result) $i = 0; - print '