diff --git a/htdocs/compta/sociales/index.php b/htdocs/compta/sociales/index.php index 022aaf14ff00d..b280fbdc2c2d2 100644 --- a/htdocs/compta/sociales/index.php +++ b/htdocs/compta/sociales/index.php @@ -36,6 +36,9 @@ if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'tax', '', '', 'charges'); +$search_ref = GETPOST('search_ref','int'); +$search_label = GETPOST('search_label','alpha'); +$search_amount = GETPOST('search_amount','alpha'); $sortfield = GETPOST("sortfield",'alpha'); $sortorder = GETPOST("sortorder",'alpha'); $page = GETPOST("page",'int'); @@ -65,6 +68,16 @@ $typeid=$_REQUEST['typeid']; } +if (GETPOST("button_removefilter")) +{ + $search_ref=""; + $search_label=""; + $search_amount=""; + $typeid=""; + $year=""; + $month=""; + $filtre=""; +} /* * View @@ -85,7 +98,11 @@ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementcharge as pc ON pc.fk_charge = cs.rowid"; $sql.= " WHERE cs.fk_type = c.id"; $sql.= " AND cs.entity = ".$conf->entity; -if (GETPOST("search_label")) $sql.=" AND cs.libelle LIKE '%".$db->escape(GETPOST("search_label"))."%'"; + +// Search criteria +if ($search_ref) $sql.=" AND cs.rowid=".$search_ref; +if ($search_label) $sql.=" AND cs.libelle LIKE '%".$db->escape($search_label)."%'"; +if ($search_amount) $sql.=" AND cs.amount='".$db->escape(price2num(trim($search_amount)))."'"; if ($year > 0) { $sql .= " AND ("; @@ -139,10 +156,8 @@ { print '