fix use delivery date (#34830)
This commit is contained in:
parent
7f173724ef
commit
3fdc9de178
1 changed files with 6 additions and 1 deletions
|
|
@ -1057,7 +1057,12 @@ if ($search_status != '') {
|
|||
}
|
||||
}
|
||||
if ($search_option == 'late') {
|
||||
$sql .= " AND c.date_commande < '".$db->idate(dol_now() - $conf->order->client->warning_delay)."'";
|
||||
// Use delivery date if set and not disabled, otherwise use order date.
|
||||
if (!getDolGlobalString('ORDER_DISABLE_DELIVERY_DATE')) {
|
||||
$sql .= " AND ((c.date_livraison IS NOT NULL AND c.date_livraison < '".$db->idate(dol_now() - $conf->order->client->warning_delay)."') OR (c.date_livraison IS NULL AND c.date_commande < '".$db->idate(dol_now() - $conf->order->client->warning_delay)."'))";
|
||||
} else {
|
||||
$sql .= " AND c.date_commande < '".$db->idate(dol_now() - $conf->order->client->warning_delay)."'";
|
||||
}
|
||||
}
|
||||
if ($search_datecloture_start) {
|
||||
$sql .= " AND c.date_cloture >= '".$db->idate($search_datecloture_start)."'";
|
||||
|
|
|
|||
Loading…
Reference in a new issue