diff --git a/htdocs/societe.php b/htdocs/societe.php
index f39286e9c7a..a428d68bbc0 100644
--- a/htdocs/societe.php
+++ b/htdocs/societe.php
@@ -135,7 +135,8 @@ if ($_GET['delsoc']) print '
'.$langs->trans("CompanyDeleted
$title=$langs->trans("ListOfThirdParties");
$sql = "SELECT s.rowid, s.nom, s.ville, ".$db->pdate("s.datec")." as datec, ".$db->pdate("s.datea")." as datea";
-$sql.= ", st.libelle as stcomm, s.prefix_comm, s.client, s.fournisseur, s.siren";
+$sql.= ", st.libelle as stcomm, s.prefix_comm, s.client, s.fournisseur,";
+$sql.= " s.siren as idprof1, s.siret as idprof2, ape as idprof3, idprof4 as idprof4";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql.= ", ".MAIN_DB_PREFIX."c_stcomm as st";
@@ -173,10 +174,21 @@ if ($search_ville)
{
$sql .= " AND s.ville LIKE '%".addslashes($search_ville)."%'";
}
-
-if ($_POST["search_siren"])
+if ($_POST["search_idprof1"])
{
- $sql .= " AND s.siren LIKE '%".$_POST["search_siren"]."%'";
+ $sql .= " AND s.siren LIKE '%".$_POST["search_idprof1"]."%'";
+}
+if ($_POST["search_idprof2"])
+{
+ $sql .= " AND s.siret LIKE '%".$_POST["search_idprof2"]."%'";
+}
+if ($_POST["search_idprof3"])
+{
+ $sql .= " AND s.ape LIKE '%".$_POST["search_idprof3"]."%'";
+}
+if ($_POST["search_idprof4"])
+{
+ $sql .= " AND s.idprof4 LIKE '%".$_POST["search_idprof4"]."%'";
}
// Count total nb of records
@@ -204,7 +216,10 @@ if ($result)
print '