diff --git a/client/src/pages/Dashboard.tsx b/client/src/pages/Dashboard.tsx index 50072ac..040bfb3 100644 --- a/client/src/pages/Dashboard.tsx +++ b/client/src/pages/Dashboard.tsx @@ -351,14 +351,6 @@ export default function Dashboard() { {/* Alerts */}
- {pendingOrdersCount > 0 && ( -
- - - {pendingOrdersCount} commande(s) en attente nécessitent une planification - -
- )} {dlcStats.expiringSoon > 0 && (
@@ -454,25 +446,37 @@ export default function Dashboard() { - {pendingOrders.length > 0 ? pendingOrders.map((order: any) => ( -
-
-
-
-

{order.supplier?.name}

-

{order.group?.name}

+ {pendingOrders.length > 0 ? pendingOrders.map((order: any) => { + // Calculer le nombre de jours en attente + const orderDate = safeDate(order.createdAt); + const daysPending = orderDate ? Math.floor((new Date().getTime() - orderDate.getTime()) / (1000 * 60 * 60 * 24)) : 0; + const isOverdue = daysPending > 10; + + return ( +
+
+
+
+

{order.supplier?.name}

+

{order.group?.name}

+
+
+
+ + {daysPending} jour{daysPending > 1 ? 's' : ''} + +

+ {safeFormat(order.plannedDate, "d MMM")} +

-
- - En attente - -

- {safeFormat(order.plannedDate, "d MMM")} -

-
-
- )) : ( + ); + }) : (

Aucune commande en attente

)}