NEW Can filter on the date of period for social contributions
This commit is contained in:
parent
cf058e7d3b
commit
76567b1d07
@ -27,10 +27,18 @@
|
|||||||
require '../../main.inc.php';
|
require '../../main.inc.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.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.formsocialcontrib.class.php';
|
||||||
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||||
|
|
||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array('compta', 'banks', 'bills'));
|
$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
|
// Security check
|
||||||
$socid = isset($_GET["socid"])?$_GET["socid"]:'';
|
$socid = isset($_GET["socid"])?$_GET["socid"]:'';
|
||||||
if ($user->societe_id) $socid=$user->societe_id;
|
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_label = GETPOST('search_label', 'alpha');
|
||||||
$search_amount = GETPOST('search_amount', 'alpha');
|
$search_amount = GETPOST('search_amount', 'alpha');
|
||||||
$search_status = GETPOST('search_status', 'int');
|
$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;
|
$limit = GETPOST('limit', 'int')?GETPOST('limit', 'int'):$conf->liste_limit;
|
||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
@ -78,7 +89,11 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
|
|||||||
$search_status='';
|
$search_status='';
|
||||||
$search_typeid="";
|
$search_typeid="";
|
||||||
$year="";
|
$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);
|
$form = new Form($db);
|
||||||
|
$formother = new FormOther($db);
|
||||||
$formsocialcontrib = new FormSocialContrib($db);
|
$formsocialcontrib = new FormSocialContrib($db);
|
||||||
$chargesociale_static=new ChargeSociales($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_label) $sql.=natural_search("cs.libelle", $search_label);
|
||||||
if ($search_amount) $sql.=natural_search("cs.amount", price2num(trim($search_amount)), 1);
|
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);
|
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)
|
if ($year > 0)
|
||||||
{
|
{
|
||||||
$sql .= " AND (";
|
$sql .= " AND (";
|
||||||
@ -192,19 +210,23 @@ if ($resql)
|
|||||||
print '<tr class="liste_titre_filter">';
|
print '<tr class="liste_titre_filter">';
|
||||||
// Ref
|
// Ref
|
||||||
print '<td class="liste_titre" align="left">';
|
print '<td class="liste_titre" align="left">';
|
||||||
print '<input class="flat" type="text" size="3" name="search_ref" value="'.dol_escape_htmltag($search_ref).'">';
|
print '<input class="flat maxwidth75" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
// Label
|
// Label
|
||||||
print '<td class="liste_titre"><input type="text" class="flat" size="8" name="search_label" value="'.dol_escape_htmltag($search_label).'"></td>';
|
print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="search_label" value="'.dol_escape_htmltag($search_label).'"></td>';
|
||||||
// Type
|
// Type
|
||||||
print '<td class="liste_titre" align="left">';
|
print '<td class="liste_titre" align="left">';
|
||||||
$formsocialcontrib->select_type_socialcontrib($search_typeid, 'search_typeid', 1, 0, 0, 'maxwidth100onsmartphone');
|
$formsocialcontrib->select_type_socialcontrib($search_typeid, 'search_typeid', 1, 0, 0, 'maxwidth100onsmartphone');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
// Period end date
|
// Period end date
|
||||||
print '<td class="liste_titre"> </td>';
|
print '<td class="liste_titre center">';
|
||||||
|
if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat valignmiddle" type="text" size="1" maxlength="2" name="search_day_lim" value="'.dol_escape_htmltag($search_day_lim).'">';
|
||||||
|
print '<input class="flat valignmiddle width25" type="text" size="1" maxlength="2" name="search_month_lim" value="'.dol_escape_htmltag($search_month_lim).'">';
|
||||||
|
$formother->select_year($search_year_lim?$search_year_lim:-1, 'search_year_lim', 1, 20, 5, 0, 0, '', 'widthauto valignmiddle');
|
||||||
|
print '</td>';
|
||||||
// Amount
|
// Amount
|
||||||
print '<td class="liste_titre right">';
|
print '<td class="liste_titre right">';
|
||||||
print '<input class="flat" type="text" size="6" name="search_amount" value="'.dol_escape_htmltag($search_amount).'">';
|
print '<input class="flat maxwidth75" type="text" name="search_amount" value="'.dol_escape_htmltag($search_amount).'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="liste_titre"> </td>';
|
print '<td class="liste_titre"> </td>';
|
||||||
// Status
|
// Status
|
||||||
|
|||||||
@ -311,6 +311,9 @@ hr { border: 0; border-top: 1px solid #ccc; }
|
|||||||
border: unset;
|
border: unset;
|
||||||
background-color: unset;
|
background-color: unset;
|
||||||
}
|
}
|
||||||
|
.button_search:hover, .button_removefilter:hover {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
form {
|
form {
|
||||||
padding:0px;
|
padding:0px;
|
||||||
margin:0px;
|
margin:0px;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user