diff --git a/attached_assets/Pasted--Calcul-statistiques-mensuelles-year-2025-month-8-startDate-2025-1755292316686_1755292316686.txt b/attached_assets/Pasted--Calcul-statistiques-mensuelles-year-2025-month-8-startDate-2025-1755292316686_1755292316686.txt new file mode 100644 index 0000000..4d8aba0 --- /dev/null +++ b/attached_assets/Pasted--Calcul-statistiques-mensuelles-year-2025-month-8-startDate-2025-1755292316686_1755292316686.txt @@ -0,0 +1,202 @@ + + +📊 Calcul statistiques mensuelles: { + + year: 2025, + + month: 8, + + startDate: '2025-08-01', + + endDate: '2025-09-01', + + groupIds: undefined + +} + +🗓️ [DATE-CALC] Aujourd'hui: 2025-08-15 (Vendredi) + +🗓️ [DATE-CALC] Année précédente: 2024-08-16 (Vendredi) + +🌤️ [RESPONSE] Weather data prepared: { + + hasCurrentYear: true, + + hasPreviousYear: true, + + location: 'Frouard, France' + +} + +GET /api/weather/current 304 in 72ms + +📊 Statistiques calculées: { + + ordersCount: 20, + + deliveriesCount: 42, + + pendingOrdersCount: 8, + + averageDeliveryTime: 0.3611111111111111, + + totalPalettes: 120, + + totalPackages: 36 + +} + +GET /api/stats/monthly 304 in 72ms + +Deliveries API called with: { + + startDate: undefined, + + endDate: undefined, + + storeId: undefined, + + withBL: undefined, + + userRole: 'admin' + +} + +Admin filtering deliveries with groupIds: undefined + +Fetching all deliveries + +Orders API called with: { + + startDate: undefined, + + endDate: undefined, + + storeId: undefined, + + userRole: 'admin' + +} + +Admin filtering with groupIds: undefined + +Fetching all orders + +Customer Orders API called with: { groupIds: undefined, userRole: 'admin' } + +🔗 PRODUCTION: getOrders() récupéré 51 commandes avec relations + +Orders returned: 51 items + +GET /api/orders 304 in 372ms + +🔍 Tasks API called with: { + + groupIds: undefined, + + userRole: 'admin', + + userId: 'admin_local', + + requestedStoreId: undefined, + + userGroups: 'all' + +} + +GET /api/user 304 in 361ms + +GET /api/dlc-products/stats 304 in 367ms + +🔗 PRODUCTION: getDeliveries() récupéré 86 livraisons avec relations + +Deliveries returned: 86 items + +GET /api/deliveries 304 in 384ms + +Customer Orders returned: 37 items + +GET /api/customer-orders 304 in 385ms + +📋 Tasks returned: 55 items for user: admin_local + +GET /api/tasks 304 in 377ms + +GET /api/publicities 304 in 384ms + +GET /api/user 304 in 5ms + +Orders API called with: { + + startDate: undefined, + + endDate: undefined, + + storeId: '1', + + userRole: 'admin' + +} + +Admin filtering with groupIds: [ 1 ] + +Fetching all orders + +Deliveries API called with: { + + startDate: undefined, + + endDate: undefined, + + storeId: '1', + + withBL: undefined, + + userRole: 'admin' + +} + +Admin filtering deliveries with groupIds: [ 1 ] + +Fetching all deliveries + +Customer Orders API called with: { groupIds: [ 1 ], userRole: 'admin' } + +🔗 PRODUCTION: getOrders() récupéré 33 commandes avec relations + +Orders returned: 33 items + +GET /api/orders 304 in 120ms + +🔗 PRODUCTION: getDeliveries() récupéré 48 livraisons avec relations + +Deliveries returned: 48 items + +GET /api/deliveries 304 in 137ms + +Customer Orders returned: 9 items + +GET /api/customer-orders 304 in 139ms + +GET /api/groups 304 in 60ms + +GET /api/publicities 304 in 90ms + +GET /api/user 304 in 6ms + +GET /api/suppliers 304 in 9ms + +GET /api/dlc-products 304 in 24ms + +GET /api/weather/current 401 in 1ms + +📄 SPA: Serving index.html for /auth + +GET /api/user 401 in 1ms + +GET /api/user 401 in 1ms + +GET /api/default-credentials-check 304 in 4ms + +HEAD /api/health 200 in 1ms + diff --git a/attached_assets/image_1755292278125.png b/attached_assets/image_1755292278125.png new file mode 100644 index 0000000..30f4f62 Binary files /dev/null and b/attached_assets/image_1755292278125.png differ diff --git a/client/src/pages/DlcPage.tsx b/client/src/pages/DlcPage.tsx index bb07b47..aa80fa2 100644 --- a/client/src/pages/DlcPage.tsx +++ b/client/src/pages/DlcPage.tsx @@ -229,7 +229,7 @@ export default function DlcPage() { const dlcData: InsertDlcProduct = { ...data, - dlcDate, + expiryDate: dlcDate, quantity: 1, // Valeur par défaut unit: "unité", // Valeur par défaut location: "Magasin", // Valeur par défaut @@ -249,7 +249,7 @@ export default function DlcPage() { form.reset({ productName: product.productName, gencode: product.gencode || "", - dlcDate: product.dlcDate ? format(new Date(product.dlcDate), "yyyy-MM-dd") : "", + dlcDate: product.expiryDate ? format(new Date(product.expiryDate), "yyyy-MM-dd") : "", dateType: product.dateType as "dlc" | "ddm" | "dluo", supplierId: product.supplierId, status: product.status as "en_cours" | "expires_soon" | "expires" | "valides", @@ -278,7 +278,7 @@ export default function DlcPage() { // Fonction pour déterminer si un produit doit afficher le bouton de validation const shouldShowValidateButton = (product: DlcProductWithRelations) => { const today = new Date(); - const expiry = new Date(product.dlcDate || new Date()); + const expiry = new Date(product.expiryDate || new Date()); const daysUntilExpiry = Math.ceil((expiry.getTime() - today.getTime()) / (1000 * 60 * 60 * 24)); // Afficher le bouton si le produit expire dans 15 jours ou moins, ou est déjà expiré @@ -779,10 +779,10 @@ export default function DlcPage() { - {product.dlcDate ? format(new Date(product.dlcDate), "dd/MM/yyyy", { locale: fr }) : 'Date non définie'} + {product.expiryDate ? format(new Date(product.expiryDate), "dd/MM/yyyy", { locale: fr }) : 'Date non définie'} {product.supplier?.name || 'Non défini'} - {getStatusBadge(product.status, product.dlcDate)} + {getStatusBadge(product.status, product.expiryDate)}