diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index c820acd6e6c4f..dce7ec132b042 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -13,6 +13,7 @@ * Copyright (C) 2016-2022 Ferran Marcet * Copyright (C) 2021-2023 Frédéric France * Copyright (C) 2022 Gauthier VERDOL + * Copyright (C) 2024 William Mead * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -3614,6 +3615,7 @@ public function load_board($user) $response->label = $langs->trans("OrdersToProcess"); $response->labelShort = $langs->trans("Opened"); $response->url = DOL_URL_ROOT.'/commande/list.php?search_status=-3&mainmenu=commercial&leftmenu=orders'; + $response->url_late = DOL_URL_ROOT.'/commande/list.php?search_option=late&mainmenu=commercial&leftmenu=orders'; $response->img = img_object('', "order"); $generic_commande = new Commande($this->db); diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index a71212a517cb7..d9ad4ee2c561d 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -12,6 +12,7 @@ * Copyright (C) 2016-2023 Ferran Marcet * Copyright (C) 2018 Charlene Benke * Copyright (C) 2021 Anthony Berton + * Copyright (C) 2024 William Mead * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -118,6 +119,10 @@ $search_fk_shipping_method = GETPOST('search_fk_shipping_method', 'int'); $search_fk_mode_reglement = GETPOST('search_fk_mode_reglement', 'int'); $search_fk_input_reason = GETPOST('search_fk_input_reason', 'int'); +$search_option = GETPOST('search_option', 'alpha'); +if ($search_option == 'late') { + $search_status = '-2'; +} $diroutputmassaction = $conf->commande->multidir_output[$conf->entity].'/temp/massgeneration/'.$user->id; @@ -293,6 +298,7 @@ $search_fk_shipping_method = ''; $search_fk_mode_reglement = ''; $search_fk_input_reason = ''; + $search_option = ''; } 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')) { @@ -601,6 +607,9 @@ if ($search_status != '') { $param .= '&search_status='.urlencode($search_status); } + if ($search_option) { + $param .= "&search_option=".urlencode($search_option); + } if ($search_orderday) { $param .= '&search_orderday='.urlencode($search_orderday); } @@ -915,7 +924,9 @@ $sql .= ' AND (c.fk_statut IN (1,2))'; // validated, in process } } - +if ($search_option == 'late') { + $sql .= " AND c.date_commande < '".$db->idate(dol_now() - $conf->commande->client->warning_delay)."'"; +} if ($search_datecloture_start) { $sql .= " AND c.date_cloture >= '".$db->idate($search_datecloture_start)."'"; } @@ -1169,6 +1180,9 @@ if ($search_status != '') { $param .= '&search_status='.urlencode($search_status); } +if ($search_option) { + $param .= "&search_option=".urlencode($search_option); +} if ($search_datecloture_start) { $param .= '&search_datecloture_startday='.dol_print_date($search_datecloture_start, '%d').'&search_datecloture_startmonth='.dol_print_date($search_datecloture_start, '%m').'&search_datecloture_startyear='.dol_print_date($search_datecloture_start, '%Y'); } @@ -1466,6 +1480,7 @@ $moreforfilter .= img_picto($tmptitle, 'stock', 'class="pictofixedwidth"').$formproduct->selectWarehouses($search_warehouse, 'search_warehouse', '', 1, 0, 0, $tmptitle, 0, 0, array(), 'maxwidth250 widthcentpercentminusx'); $moreforfilter .= ''; } + $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if (empty($reshook)) {