mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-11 17:27:31 +02:00
Update dashboard to display total pending orders
Modify the Dashboard component to count all orders with 'pending' status instead of filtering for orders pending over 10 days. Also removes overflow from the pending orders card. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 98f01874-e00c-4bbe-9d71-b0b338001848 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/98f01874-e00c-4bbe-9d71-b0b338001848/XDIQsDu
This commit is contained in:
1 parent
dbca763d4b
commit
5fbdc67153
1 file changed
+2
-11
@@ -246,16 +246,7 @@ export default function Dashboard() {
|
||||
console.log('🚚 Dashboard - Upcoming deliveries result:', upcomingDeliveries.length, upcomingDeliveries);
|
||||
|
||||
// Calculs pour les statistiques
|
||||
const pendingOrdersCount = Array.isArray(allOrders) ? allOrders.filter((order: any) => {
|
||||
if (order.status !== 'pending') return false;
|
||||
|
||||
// Vérifier si la commande est en pending depuis plus de 10 jours
|
||||
const orderDate = safeDate(order.createdAt);
|
||||
if (!orderDate) return false;
|
||||
|
||||
const daysDiff = Math.floor((new Date().getTime() - orderDate.getTime()) / (1000 * 60 * 60 * 24));
|
||||
return daysDiff > 10;
|
||||
}).length : 0;
|
||||
const pendingOrdersCount = Array.isArray(allOrders) ? allOrders.filter((order: any) => order.status === 'pending').length : 0;
|
||||
const averageDeliveryTime = Math.round(stats?.averageDeliveryTime || 0);
|
||||
const deliveredThisMonth = Array.isArray(allDeliveries) ? allDeliveries.filter((delivery: any) => {
|
||||
const deliveryDate = safeDate(delivery.deliveredDate || delivery.createdAt);
|
||||
@@ -462,7 +453,7 @@ export default function Dashboard() {
|
||||
)}
|
||||
</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-3 p-6 max-h-96 overflow-y-auto">
|
||||
<CardContent className="space-y-3 p-6">
|
||||
{pendingOrders.length > 0 ? pendingOrders.map((order: any) => {
|
||||
// Calculer le nombre de jours en attente
|
||||
const orderDate = safeDate(order.createdAt);
|
||||
|
||||
Reference in new issue
Block a user