diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 83e83c9bc5d43244ab186208931b2be5f3e15114..8a493f73adc0daaaa2b93c3e5a24bc5127b4e787 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -1931,7 +1931,7 @@ if ($action == 'create' && $user->rights->commande->creer) /* * Commande - */ + */ $nbrow = 9; if (! empty($conf->projet->enabled)) $nbrow ++; @@ -2050,6 +2050,9 @@ if ($action == 'create' && $user->rights->commande->creer) print '</form>'; } else { print $object->date ? dol_print_date($object->date, 'daytext') : ' '; + if ($object->hasDelay() && empty($object->date_livraison)) { + print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning"); + } } print '</td>'; print '</tr>'; @@ -2072,6 +2075,9 @@ if ($action == 'create' && $user->rights->commande->creer) print '</form>'; } else { print $object->date_livraison ? dol_print_date($object->date_livraison, 'daytext') : ' '; + if ($object->hasDelay() && ! empty($object->date_livraison)) { + print ' '.img_picto($langs->trans("Late").' : '.$object->showDelay(), "warning"); + } } print '</td>'; print '</tr>'; diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index ed1947ec3ca4c4ae817eec02ed1d833d02ce9e75..394b4887a6f4479f760f6a9b03c8155ce52762c8 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3436,6 +3436,22 @@ class Commande extends CommonOrder return max($this->date_commande, $this->date_livraison) < ($now - $conf->commande->client->warning_delay); } + + /** + * Show the customer delayed info + * + * @return string Show delayed information + */ + public function showDelay() + { + global $conf, $langs; + + if (empty($this->date_livraison)) $text=$langs->trans("OrderDate").' '.dol_print_date($this->date_commande, 'day'); + else $text=$text=$langs->trans("DeliveryDate").' '.dol_print_date($this->date_livraison, 'day'); + $text.=' '.($conf->commande->client->warning_delay>0?'+':'-').' '.round(abs($conf->commande->client->warning_delay)/3600/24,1).' '.$langs->trans("days").' < '.$langs->trans("Today"); + + return $text; + } } diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index e5f8a62acb55da174b2b83adcde2766ce5eb72c0..91a602c31a6060856493712aa8765a2185d3cbdf 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -554,7 +554,7 @@ if ($resql) // Warning late icon print '<td class="nobordernopadding nowrap">'; if ($generic_commande->hasDelay()) { - print img_picto($langs->trans("Late"), "warning"); + print img_picto($langs->trans("Late").' : '.$generic_commande->showDelay(), "warning"); } if(!empty($objp->note_private)) { diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index c7de7ee207aea353988ad63b6f3cc704514fa139..66f9582cfc0ab84a262dd5609477d28ba51a6e43 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -265,7 +265,12 @@ if ($id > 0 || ! empty($ref)) // Date print '<tr><td>'.$langs->trans('Date').'</td>'; - print '<td colspan="2">'.dol_print_date($commande->date,'daytext').'</td>'; + print '<td colspan="2">'; + print dol_print_date($commande->date,'daytext'); + if ($commande->hasDelay() && empty($commande->date_livraison)) { + print ' '.img_picto($langs->trans("Late").' : '.$commande->showDelay(), "warning"); + } + print '</td>'; print '</tr>'; // Delivery date planned @@ -289,6 +294,9 @@ if ($id > 0 || ! empty($ref)) else { print dol_print_date($commande->date_livraison,'daytext'); + if ($commande->hasDelay() && ! empty($commande->date_livraison)) { + print ' '.img_picto($langs->trans("Late").' : '.$commande->showDelay(), "warning"); + } } print '</td>'; // Note on several rows