From 95eccf8370d0e5786fbf19bb1a225225981f0df8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 20 Sep 2010 22:54:33 +0000 Subject: [PATCH] New: Can filter on label in social contributions list --- htdocs/compta/sociales/index.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/sociales/index.php b/htdocs/compta/sociales/index.php index 5850e2a0a61..2b3fb933323 100644 --- a/htdocs/compta/sociales/index.php +++ b/htdocs/compta/sociales/index.php @@ -83,13 +83,14 @@ $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; $sql.= ", ".MAIN_DB_PREFIX."chargesociales as s"; $sql.= " WHERE s.fk_type = c.id"; $sql.= " AND s.entity = ".$conf->entity; +if (GETPOST("search_label")) $sql.=" AND s.libelle like '%".GETPOST("search_label")."%'"; if ($year > 0) { $sql .= " AND ("; // Si period renseignee on l'utilise comme critere de date, sinon on prend date echeance, // ceci afin d'etre compatible avec les cas ou la periode n'etait pas obligatoire - $sql .= " (s.periode is not null and date_format(s.periode, '%Y') = $year) "; - $sql .= "or (s.periode is null and date_format(s.date_ech, '%Y') = $year)"; + $sql .= " (s.periode is not null and date_format(s.periode, '%Y') = ".$year.") "; + $sql .= "or (s.periode is null and date_format(s.date_ech, '%Y') = ".$year.")"; $sql .= ")"; } if ($filtre) { @@ -158,7 +159,7 @@ if ($resql) print ''; print ' '; - print ' '; + print ''; // Type print ''; $html->select_type_socialcontrib($typeid,'typeid',1,16,0);