From 880384dccddd5d27039ce5f19bc0edeb95149c7c Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Mon, 18 Sep 2023 10:54:45 +0200 Subject: [PATCH 1/2] NEW start and end date for due date filter on invoice list --- htdocs/compta/facture/list.php | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index b1fe18462b1..5c3a6ba923a 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -145,8 +145,8 @@ $search_fac_rec_source_title = GETPOST("search_fac_rec_source_title", 'alpha'); $search_btn = GETPOST('button_search', 'alpha'); $search_remove_btn = GETPOST('button_removefilter', 'alpha'); -$option = GETPOST('search_option'); -if ($option == 'late') { +$search_late = GETPOST('search_late'); +if ($search_late == 'late') { $search_status = '1'; } $filtre = GETPOST('filtre', 'alpha'); @@ -376,7 +376,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', $toselect = array(); $search_array_options = array(); $search_categ_cus = 0; - $option = ''; + $search_late = ''; $socid = 0; } @@ -815,7 +815,7 @@ if ($search_datelimit_start) { if ($search_datelimit_end) { $sql .= " AND f.date_lim_reglement <= '".$db->idate($search_datelimit_end)."'"; } -if ($option == 'late') { +if ($search_late == 'late') { $sql .= " AND f.date_lim_reglement < '".$db->idate(dol_now() - $conf->facture->client->warning_delay)."'"; } if ($search_sale > 0) { @@ -1153,8 +1153,8 @@ if ($resql) { if ($show_files) { $param .= '&show_files='.urlencode($show_files); } - if ($option) { - $param .= "&search_option=".urlencode($option); + if ($search_late) { + $param .= "&search_option=".urlencode($search_late); } if ($optioncss != '') { $param .= '&optioncss='.urlencode($optioncss); @@ -1291,6 +1291,11 @@ if ($resql) { $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$formother->select_categories('customer', $search_categ_cus, 'search_categ_cus', 1, $tmptitle); $moreforfilter .= ''; } + // alert on due date + $moreforfilter .= '
'; + $moreforfilter .= $langs->trans('Alert').' '; + $moreforfilter .= '
'; + $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if (empty($reshook)) { @@ -1386,14 +1391,10 @@ if ($resql) { if (!empty($arrayfields['f.date_lim_reglement']['checked'])) { print ''; print '
'; - /* - print $langs->trans('From').' '; - print $form->selectDate($search_datelimit_start ? $search_datelimit_start : -1, 'search_datelimit_start', 0, 0, 1); - print '
'; - print '
'; - print $langs->trans('to').' ';*/ - print $form->selectDate($search_datelimit_end ? $search_datelimit_end : -1, 'search_datelimit_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("Before")); - print '
'.$langs->trans("Alert"); + print $form->selectDate($search_datelimit_start ? $search_datelimit_start : -1, 'search_datelimit_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From')); + print '
'; + print '
'; + print $form->selectDate($search_datelimit_end ? $search_datelimit_end : -1, 'search_datelimit_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to')); print '
'; print ''; } From f53eae38f732c006343c542b5a53077a9c4cb3f0 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Mon, 18 Sep 2023 11:52:07 +0200 Subject: [PATCH 2/2] Fix rename search option --- htdocs/compta/facture/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 5c3a6ba923a..c0fd5d133b5 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -1154,7 +1154,7 @@ if ($resql) { $param .= '&show_files='.urlencode($show_files); } if ($search_late) { - $param .= "&search_option=".urlencode($search_late); + $param .= "&search_late=".urlencode($search_late); } if ($optioncss != '') { $param .= '&optioncss='.urlencode($optioncss);