diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index ad422a8b930..ab284c4af8c 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -55,6 +55,10 @@ $confirm = GETPOST('confirm', 'alpha'); $toselect = GETPOST('toselect', 'array'); $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'orderlist'; +$search_datecloture_start = GETPOST('search_datecloture_start', 'int'); +if(empty($search_datecloture_start)) $search_datecloture_start = dol_mktime(0, 0, 0, GETPOST('search_datecloture_startmonth', 'int'), GETPOST('search_datecloture_startday', 'int'), GETPOST('search_datecloture_startyear', 'int')); +$search_datecloture_end = GETPOST('search_datecloture_end', 'int'); +if(empty($search_datecloture_end)) $search_datecloture_end = dol_mktime(23, 59, 59, GETPOST('search_datecloture_endmonth', 'int'), GETPOST('search_datecloture_endday', 'int'), GETPOST('search_datecloture_endyear', 'int')); $search_dateorder_start = dol_mktime(0, 0, 0, GETPOST('search_dateorder_startmonth', 'int'), GETPOST('search_dateorder_startday', 'int'), GETPOST('search_dateorder_startyear', 'int')); $search_dateorder_end = dol_mktime(23, 59, 59, GETPOST('search_dateorder_endmonth', 'int'), GETPOST('search_dateorder_endday', 'int'), GETPOST('search_dateorder_endyear', 'int')); $search_datedelivery_start = dol_mktime(0, 0, 0, GETPOST('search_datedelivery_startmonth', 'int'), GETPOST('search_datedelivery_startday', 'int'), GETPOST('search_datedelivery_startyear', 'int')); @@ -230,6 +234,8 @@ if (empty($reshook)) $toselect = ''; $search_array_options = array(); $search_categ_cus = 0; + $search_datecloture_start = ''; + $search_datecloture_end = ''; } if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha') || GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) @@ -336,6 +342,8 @@ if ($search_status <> '') } } +if ($search_datecloture_start) $sql .= " AND c.date_cloture >= '".$db->idate($search_datecloture_start)."'"; +if ($search_datecloture_end) $sql .= " AND c.date_cloture <= '".$db->idate($search_datecloture_end)."'"; if ($search_dateorder_start) $sql .= " AND c.date_commande >= '".$db->idate($search_dateorder_start)."'"; if ($search_dateorder_end) $sql .= " AND c.date_commande <= '".$db->idate($search_dateorder_end)."'"; if ($search_datedelivery_start) $sql .= " AND c.date_livraison >= '".$db->idate($search_datedelivery_start)."'"; @@ -439,6 +447,8 @@ if ($resql) if ($sall) $param .= '&sall='.urlencode($sall); if ($socid > 0) $param .= '&socid='.urlencode($socid); if ($search_status != '') $param .= '&search_status='.urlencode($search_status); + if ($search_datecloture_start) $param .= '&search_datecloture_start='.urlencode($search_datecloture_start); + if ($search_datecloture_end) $param .= '&search_datecloture_end='.urlencode($search_datecloture_end); if ($search_dateorder_start) $param .= '&search_dateorder_start='.urlencode($search_dateorder_start); if ($search_dateorder_end) $param .= '&search_dateorder_end='.urlencode($search_dateorder_end); if ($search_datedelivery_start) $param .= '&search_datedelivery_start='.urlencode($search_datedelivery_start); @@ -801,7 +811,15 @@ if ($resql) // Date cloture if (!empty($arrayfields['c.date_cloture']['checked'])) { - print '