From 76567b1d07defb860d934d99e04d94cdd12ffa4d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 12 Apr 2019 12:51:48 +0200 Subject: [PATCH] NEW Can filter on the date of period for social contributions --- htdocs/compta/sociales/list.php | 32 +++++++++++++++++++++++++++----- htdocs/theme/eldy/global.inc.php | 3 +++ 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/htdocs/compta/sociales/list.php b/htdocs/compta/sociales/list.php index f5e88c7fb29..8893447ebf3 100644 --- a/htdocs/compta/sociales/list.php +++ b/htdocs/compta/sociales/list.php @@ -27,10 +27,18 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsocialcontrib.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; // Load translation files required by the page $langs->loadLangs(array('compta', 'banks', 'bills')); +$action=GETPOST('action', 'alpha'); +$massaction=GETPOST('massaction', 'alpha'); +$show_files=GETPOST('show_files', 'int'); +$confirm=GETPOST('confirm', 'alpha'); +$toselect = GETPOST('toselect', 'array'); +$contextpage=GETPOST('contextpage', 'aZ')?GETPOST('contextpage', 'aZ'):'sclist'; + // Security check $socid = isset($_GET["socid"])?$_GET["socid"]:''; if ($user->societe_id) $socid=$user->societe_id; @@ -40,6 +48,9 @@ $search_ref = GETPOST('search_ref', 'int'); $search_label = GETPOST('search_label', 'alpha'); $search_amount = GETPOST('search_amount', 'alpha'); $search_status = GETPOST('search_status', 'int'); +$search_day_lim = GETPOST('search_day_lim', 'int'); +$search_month_lim = GETPOST('search_month_lim', 'int'); +$search_year_lim = GETPOST('search_year_lim', 'int'); $limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit; $sortfield = GETPOST("sortfield", 'alpha'); @@ -78,7 +89,11 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' $search_status=''; $search_typeid=""; $year=""; - $month=""; + $search_day_lim=''; + $search_year_lim=''; + $search_month_lim=''; + $toselect=''; + $search_array_options=array(); } @@ -87,6 +102,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' */ $form = new Form($db); +$formother = new FormOther($db); $formsocialcontrib = new FormSocialContrib($db); $chargesociale_static=new ChargeSociales($db); @@ -106,6 +122,8 @@ if ($search_ref) $sql.=" AND cs.rowid=".$db->escape($search_ref); if ($search_label) $sql.=natural_search("cs.libelle", $search_label); if ($search_amount) $sql.=natural_search("cs.amount", price2num(trim($search_amount)), 1); if ($search_status != '' && $search_status >= 0) $sql.=" AND cs.paye = ".$db->escape($search_status); +$sql.= dolSqlDateFilter("cs.periode", $search_day_lim, $search_month_lim, $search_year_lim); +//$sql.= dolSqlDateFilter("cs.periode", 0, 0, $year); if ($year > 0) { $sql .= " AND ("; @@ -192,19 +210,23 @@ if ($resql) print ''; // Ref print ''; - print ''; + print ''; print ''; // Label - print ''; + print ''; // Type print ''; $formsocialcontrib->select_type_socialcontrib($search_typeid, 'search_typeid', 1, 0, 0, 'maxwidth100onsmartphone'); print ''; // Period end date - print ' '; + print ''; + if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print ''; + print ''; + $formother->select_year($search_year_lim?$search_year_lim:-1, 'search_year_lim', 1, 20, 5, 0, 0, '', 'widthauto valignmiddle'); + print ''; // Amount print ''; - print ''; + print ''; print ''; print ' '; // Status diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index e04c414628f..df0259ce290 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -311,6 +311,9 @@ hr { border: 0; border-top: 1px solid #ccc; } border: unset; background-color: unset; } +.button_search:hover, .button_removefilter:hover { + cursor: pointer; +} form { padding:0px; margin:0px;