diff --git a/htdocs/societe.php b/htdocs/societe.php index b53b9f3bbf7..f95d3594b26 100644 --- a/htdocs/societe.php +++ b/htdocs/societe.php @@ -118,7 +118,10 @@ if ($_POST["button_removefilter"] == $langs->trans("RemoveFilter")) { $title=$langs->trans("ListOfCompanies"); $sql = "SELECT s.idp, s.nom, s.ville, ".$db->pdate("s.datec")." as datec, ".$db->pdate("s.datea")." as datea, st.libelle as stcomm, s.prefix_comm, s.client, s.fournisseur"; -$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."c_stcomm as st WHERE s.fk_stcomm = st.id"; +$sql .= ", s.siren"; +$sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; +$sql .= ", ".MAIN_DB_PREFIX."c_stcomm as st"; +$sql .= " WHERE s.fk_stcomm = st.id"; if ($user->societe_id > 0) { @@ -142,6 +145,10 @@ if ($search_ville) { $sql .= " AND s.ville LIKE '%".$search_ville."%'"; } +if ($_POST["search_siren"]) { + $sql .= " AND s.siren LIKE '%".$_POST["search_siren"]."%'"; +} + $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset); $result = $db->query($sql); @@ -158,7 +165,10 @@ if ($result) print '
| '; print " | ||||||||
| '; print ''; - print ' | '; - print ''; + print ' | '; print ''; + print ' | '; + print ''; + + print ' | '; print ''; print ' '; @@ -190,6 +203,7 @@ if ($result) print img_object($langs->trans("ShowCompany"),"company"); print " idp\">".stripslashes($obj->nom)." | \n"; print "".$obj->ville." | \n"; + print "".$obj->siren." | \n"; print ''; if ($obj->client==1) { | |