Skip to content

Commit 697bf01

Browse files
committed
Merge branch '19.0' of git@github.com:Dolibarr/dolibarr.git into 20.0
2 parents 1ae4bf4 + b0fe6a0 commit 697bf01

File tree

4 files changed

+47
-13
lines changed

4 files changed

+47
-13
lines changed

htdocs/comm/propal/class/propal.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3422,7 +3422,7 @@ public function load_board($user, $mode)
34223422
$response->label = $label;
34233423
$response->labelShort = $labelShort;
34243424
$response->url = DOL_URL_ROOT.'/comm/propal/list.php?search_status='.$status.'&mainmenu=commercial&leftmenu=propals';
3425-
$response->url_late = DOL_URL_ROOT.'/comm/propal/list.php?search_status='.$status.'&mainmenu=commercial&leftmenu=propals&sortfield=p.datep&sortorder=asc';
3425+
$response->url_late = DOL_URL_ROOT.'/comm/propal/list.php?search_option=late&mainmenu=commercial&leftmenu=propals&sortfield=p.datep&sortorder=asc';
34263426
$response->img = img_object('', "propal");
34273427

34283428
// This assignment in condition is not a bug. It allows walking the results.

htdocs/comm/propal/list.php

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
* Copyright (C) 2021-2024 Frédéric France <frederic.france@free.fr>
1919
* Copyright (C) 2022 Josep Lluís Amador <joseplluis@lliuretic.cat>
2020
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
21+
* Copyright (C) 2024 William Mead <william.mead@manchenumerique.fr>
2122
*
2223
* This program is free software; you can redistribute it and/or modify
2324
* it under the terms of the GNU General Public License as published by
@@ -146,6 +147,12 @@
146147
$search_status = GETPOST('search_status', 'alpha');
147148
$search_note_public = GETPOST('search_note_public', 'alpha');
148149

150+
$search_option = GETPOST('search_option', 'alpha');
151+
if ($search_option == 'late') {
152+
$search_status = '1';
153+
$object_statut = '1';
154+
}
155+
149156
// Pagination
150157
$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
151158
$sortfield = GETPOST('sortfield', 'aZ09comma');
@@ -257,11 +264,11 @@
257264

258265
// List of fields to search into when doing a "search in all"
259266
/*$fieldstosearchall = array();
260-
foreach ($object->fields as $key => $val) {
261-
if (!empty($val['searchall'])) {
262-
$fieldstosearchall['t.'.$key] = $val['label'];
263-
}
264-
}*/
267+
foreach ($object->fields as $key => $val) {
268+
if (!empty($val['searchall'])) {
269+
$fieldstosearchall['t.'.$key] = $val['label'];
270+
}
271+
}*/
265272

266273
// Definition of array of fields for columns
267274
/*$arrayfields = array();
@@ -375,6 +382,7 @@
375382
$search_date_delivery_start = '';
376383
$search_date_delivery_end = '';
377384
$search_availability = '';
385+
$search_option = '';
378386
$search_status = '';
379387
$search_categ_cus = 0;
380388
$search_fk_cond_reglement = '';
@@ -800,6 +808,9 @@
800808
}
801809
}
802810
}
811+
if ($search_option == 'late') {
812+
$sql .= " AND p.fin_validite < '".$db->idate(dol_now() - $conf->propal->cloture->warning_delay)."'";
813+
}
803814
// Add where from extra fields
804815
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
805816
//print $sql;
@@ -1703,10 +1714,11 @@
17031714
|| !empty($arrayfields['total_margin']['checked'])
17041715
|| !empty($arrayfields['total_margin_rate']['checked'])
17051716
|| !empty($arrayfields['total_mark_rate']['checked'])
1706-
)
1707-
) {
1708-
$with_margin_info = true;
1717+
)
1718+
) {
1719+
$with_margin_info = true;
17091720
}
1721+
17101722
$total_ht = 0;
17111723
$total_margin = 0;
17121724

@@ -1720,6 +1732,9 @@
17201732
if (empty($obj)) {
17211733
break; // Should not happen
17221734
}
1735+
if ($search_option) {
1736+
$param .= "&search_option=".urlencode($search_option);
1737+
}
17231738

17241739
$objectstatic->id = $obj->rowid;
17251740
$objectstatic->ref = $obj->ref;

htdocs/commande/class/commande.class.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
1212
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
1313
* Copyright (C) 2016-2022 Ferran Marcet <fmarcet@2byte.es>
14-
* Copyright (C) 2021-2024 Frédéric France <frederic.france@free.fr>
15-
* Copyright (C) 2022 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
16-
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
14+
* Copyright (C) 2021-2024 Frédéric France <frederic.france@free.fr>
15+
* Copyright (C) 2022 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
16+
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
17+
* Copyright (C) 2024 William Mead <william.mead@manchenumerique.fr>
1718
*
1819
* This program is free software; you can redistribute it and/or modify
1920
* it under the terms of the GNU General Public License as published by
@@ -3595,10 +3596,12 @@ public function load_board($user, $mode)
35953596
}
35963597

35973598
$response = new WorkboardResponse();
3599+
35983600
$response->warning_delay = $delay_warning;
35993601
$response->label = $label;
36003602
$response->labelShort = $labelShort;
36013603
$response->url = $url;
3604+
$response->url_late = DOL_URL_ROOT.'/commande/list.php?search_option=late&mainmenu=commercial&leftmenu=orders';
36023605
$response->img = img_object('', "order");
36033606

36043607
$generic_commande = new Commande($this->db);

htdocs/commande/list.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* Copyright (C) 2024 Noé Cendrier <noe.cendrier@altairis.fr>
1717
* Copyright (C) 2024 Benjamin Falière <benjamin.faliere@altairis.fr>
1818
* Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
19+
* Copyright (C) 2024 William Mead <william.mead@manchenumerique.fr>
1920
*
2021
* This program is free software; you can redistribute it and/or modify
2122
* it under the terms of the GNU General Public License as published by
@@ -126,6 +127,11 @@
126127
$search_fk_mode_reglement = GETPOST('search_fk_mode_reglement', 'intcomma');
127128
$search_fk_input_reason = GETPOST('search_fk_input_reason', 'intcomma');
128129

130+
$search_option = GETPOST('search_option', 'alpha');
131+
if ($search_option == 'late') {
132+
$search_status = '-2';
133+
}
134+
129135
$diroutputmassaction = $conf->commande->multidir_output[$conf->entity].'/temp/massgeneration/'.$user->id;
130136

131137
// Load variable for pagination
@@ -316,6 +322,7 @@
316322
$search_fk_shipping_method = '';
317323
$search_fk_mode_reglement = '';
318324
$search_fk_input_reason = '';
325+
$search_option = '';
319326
}
320327
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')
321328
|| GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) {
@@ -642,6 +649,9 @@
642649
if ($search_status != '') {
643650
$param .= '&search_status='.urlencode($search_status);
644651
}
652+
if ($search_option) {
653+
$param .= "&search_option=".urlencode($search_option);
654+
}
645655
if ($search_orderday) {
646656
$param .= '&search_orderday='.urlencode($search_orderday);
647657
}
@@ -939,7 +949,9 @@
939949
$sql .= ' AND (c.fk_statut IN (1,2,3))'; // validated, in process or closed
940950
}
941951
}
942-
952+
if ($search_option == 'late') {
953+
$sql .= " AND c.date_commande < '".$db->idate(dol_now() - $conf->commande->client->warning_delay)."'";
954+
}
943955
if ($search_datecloture_start) {
944956
$sql .= " AND c.date_cloture >= '".$db->idate($search_datecloture_start)."'";
945957
}
@@ -1229,6 +1241,9 @@
12291241
if ($search_status != '') {
12301242
$param .= '&search_status='.urlencode($search_status);
12311243
}
1244+
if ($search_option) {
1245+
$param .= "&search_option=".urlencode($search_option);
1246+
}
12321247
if ($search_datecloture_start) {
12331248
$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');
12341249
}
@@ -1530,6 +1545,7 @@
15301545
$moreforfilter .= img_picto($tmptitle, 'stock', 'class="pictofixedwidth"').$formproduct->selectWarehouses($search_warehouse, 'search_warehouse', '', 1, 0, 0, $tmptitle, 0, 0, array(), 'maxwidth250 widthcentpercentminusx');
15311546
$moreforfilter .= '</div>';
15321547
}
1548+
15331549
$parameters = array();
15341550
$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
15351551
if (empty($reshook)) {

0 commit comments

Comments
 (0)