diff --git a/attached_assets/Pasted--PRODUCTION-Looking-for-user-with-username-admin-PRODUCTION-Looking-for--1762258084615_1762258084615.txt b/attached_assets/Pasted--PRODUCTION-Looking-for-user-with-username-admin-PRODUCTION-Looking-for--1762258084615_1762258084615.txt new file mode 100644 index 0000000..08590bd --- /dev/null +++ b/attached_assets/Pasted--PRODUCTION-Looking-for-user-with-username-admin-PRODUCTION-Looking-for--1762258084615_1762258084615.txt @@ -0,0 +1,201 @@ + + +] + +🔍 [PRODUCTION] Looking for user with username: admin + +🔍 [PRODUCTION] Looking for user with username: admin + +🔍 [PRODUCTION] Looking for user with username: admin + +🔍 [PRODUCTION] Looking for user with username: admin_local + +🔍 [PRODUCTION] User search result: Found + +🔍 [PRODUCTION] User search result: Found + +🔍 [PRODUCTION] User search result: Found + +❌ [PRODUCTION] User not found with username: admin_local + +🔍 [PRODUCTION] User search result: Not found + +🎯 [PRODUCTION] Found announcements: 4 + +GET /api/announcements 304 in 9ms + +GET /api/user 304 in 4ms + +📢 [SERVER] Fetching announcements for user: _1754936203292 environment: production + +📢 [SERVER] User found: { username: 'ff292', role: 'employee' } + +🎯 [PRODUCTION] Using PostgreSQL DASHBOARD_MESSAGES table + +🔍 [PRODUCTION] Raw messages from DB: 4 items: [ + + { + + id: 20, + + title: 'DLC', + + content: 'Attention des DLC sont en expiré bientôt ou expiré, il faut s en occuper', + + type: 'success', + + storeId: 2, + + createdBy: 'admin', + + createdAt: 2025-09-24T11:26:13.521Z + + }, + + { + + id: 17, + + title: 'Module Avoir', + + content: "Le module d'avoir est en place", + + type: 'error', + + storeId: 1, + + createdBy: 'admin', + + createdAt: 2025-09-09T07:47:47.650Z + + }, + + { + + id: 16, + + title: 'Mise à jour Prix', + + content: 'Merci de mettre vos prix a jour tous les matins, certain magasin ne le font pas.', + + type: 'success', + + storeId: null, + + createdBy: 'admin', + + createdAt: 2025-08-18T10:45:08.585Z + + }, + + { + + id: 8, + + title: 'Bon de Livraison', + + content: 'Lorsque vous rentrez un numéro de bon de livraison, faite le a l identique, même les majuscules. Pour My candy Shop, prendre le numéro de commande.', + + type: 'info', + + storeId: null, + + createdBy: 'admin_local', + + createdAt: 2025-08-07T11:04:38.123Z + + } + +] + +🔍 [PRODUCTION] Looking for user with username: admin + +🔍 [PRODUCTION] Looking for user with username: admin + +🔍 [PRODUCTION] Looking for user with username: admin + +🔍 [PRODUCTION] Looking for user with username: admin_local + +❌ [PRODUCTION] User not found with username: admin_local + +🔍 [PRODUCTION] User search result: Found + +🔍 [PRODUCTION] User search result: Found + +🔍 [PRODUCTION] User search result: Found + +🔍 [PRODUCTION] User search result: Not found + +🎯 [PRODUCTION] Found announcements: 4 + +GET /api/announcements 304 in 24ms + +GET /api/groups 304 in 5ms + +GET /api/user 304 in 4ms + +GET /api/suppliers 200 in 4ms + +GET /api/dlc-products 200 in 53ms + +📊 [EXPORT] Début de l'export Excel + +🔍 [EXPORT] Utilisateur: admin (admin) + +📋 [EXPORT] Paramètres: { + + groupId: 1, + + month: '2025-12', + + paymentMethods: [ 'Traite Magnétique' ], + + includeHT: true, + + includeTTC: true + +} + +❌ PRODUCTION: Delivery #127 (store 2) linked to order #81 (store 1) - STORE MISMATCH DETECTED! + +🔗 PRODUCTION: getDeliveries() récupéré 357 livraisons avec relations + +📦 [EXPORT] Import du module xlsx... + +❌ [EXPORT] Erreur export Excel: Error: Dynamic require of "stream" is not supported + + at file:///app/dist/index.js:11:9 + + at make_xlsx_lib (file:///app/dist/index.js:44815:22) + + at node_modules/xlsx/xlsx.js (file:///app/dist/index.js:44819:41) + + at __require2 (file:///app/dist/index.js:17:50) + + at file:///app/dist/index.js:47198:63 + + at process.processTicksAndRejections (node:internal/process/task_queues:95:5) + + at async file:///app/dist/index.js:47198:20 + +❌ [EXPORT] Message: Dynamic require of "stream" is not supported + +❌ [EXPORT] Stack: Error: Dynamic require of "stream" is not supported + + at file:///app/dist/index.js:11:9 + + at make_xlsx_lib (file:///app/dist/index.js:44815:22) + + at node_modules/xlsx/xlsx.js (file:///app/dist/index.js:44819:41) + + at __require2 (file:///app/dist/index.js:17:50) + + at file:///app/dist/index.js:47198:63 + + at process.processTicksAndRejections (node:internal/process/task_queues:95:5) + + at async file:///app/dist/index.js:47198:20 + +POST /api/payment-schedule/export 500 in 910ms + +HEAD /api/health 200 in 1ms \ No newline at end of file diff --git a/attached_assets/Pasted-Actions-hoursRemaining-438287-CACHE-R-sultat-cache-found--1762258677960_1762258677960.txt b/attached_assets/Pasted-Actions-hoursRemaining-438287-CACHE-R-sultat-cache-found--1762258677960_1762258677960.txt new file mode 100644 index 0000000..5fab322 --- /dev/null +++ b/attached_assets/Pasted-Actions-hoursRemaining-438287-CACHE-R-sultat-cache-found--1762258677960_1762258677960.txt @@ -0,0 +1,205 @@ +Actions + + + + + hoursRemaining: 438287 + +} + +🔍 [CACHE] Résultat cache: { + + found: true, + + isReconciled: true, + + expired: false, + + expiresAt: 2075-11-04T10:58:49.338Z, + + currentTime: '2025-11-04T12:17:35.661Z' + +} + +🛡️ [CACHE] PERMANENT - Facture validée avec coche verte, AUCUNE vérification: { + + invoiceReference: '22529151', + + groupId: 1, + + exists: true, + + invoiceAmount: '2653.75', + + dueDate: null + +} + +✅ [INVOICE] Résultat depuis cache: { + + exists: true, + + matchType: 'invoice_reference', + + errorMessage: null, + + invoiceReference: '22529151', + + supplierName: 'Sovacom', + + invoiceAmount: 2653.75, + + invoiceAmountTTC: 3184.5, + + dueDate: null, + + fromCache: true, + + permanent: true + +} + +🔍 [INVOICE] Début vérification facture: { invoiceReference: 'FCLT035833', groupId: 1, forceRefresh: false } + +🔍 [INVOICE] Vérification cache... + +🔍 [CACHE] Recherche cache pour: { + + invoiceReference: 'FCLT035833', + + groupId: 1, + + cacheKey: '1_fclt035833' + +} + +✅ [DATABASE-CACHE] Cache hit pour: { + + cacheKey: '1_fclt035833', + + expires: 2075-11-04T10:58:49.353Z, + + hoursRemaining: 438287 + +} + +🔍 [CACHE] Résultat cache: { + + found: true, + + isReconciled: true, + + expired: false, + + expiresAt: 2075-11-04T10:58:49.353Z, + + currentTime: '2025-11-04T12:17:35.662Z' + +} + +🛡️ [CACHE] PERMANENT - Facture validée avec coche verte, AUCUNE vérification: { + + invoiceReference: 'FCLT035833', + + groupId: 1, + + exists: true, + + invoiceAmount: '1307.26', + + dueDate: null + +} + +✅ [INVOICE] Résultat depuis cache: { + + exists: true, + + matchType: 'invoice_reference', + + errorMessage: null, + + invoiceReference: 'FCLT035833', + + supplierName: 'Idvpc', + + invoiceAmount: 1307.26, + + invoiceAmountTTC: 1568.71, + + dueDate: null, + + fromCache: true, + + permanent: true + +} + +💰 Livraisons nécessitant récupération TTC: 0 + +📅 Total échéances retournées: 34 + +GET /api/payment-schedule 304 in 892ms + +📊 [EXPORT] Début de l'export Excel + +🔍 [EXPORT] Utilisateur: admin (admin) + +📋 [EXPORT] Paramètres: { + + groupId: 1, + + month: '2025-11', + + paymentMethods: [ 'Non défini' ], + + includeHT: true, + + includeTTC: true + +} + +❌ PRODUCTION: Delivery #127 (store 2) linked to order #81 (store 1) - STORE MISMATCH DETECTED! + +🔗 PRODUCTION: getDeliveries() récupéré 357 livraisons avec relations + +📦 [EXPORT] Import du module xlsx... + +❌ [EXPORT] Erreur export Excel: Error: Dynamic require of "stream" is not supported + + at file:///app/dist/index.js:11:9 + + at make_xlsx_lib (file:///app/dist/index.js:44815:22) + + at node_modules/xlsx/xlsx.js (file:///app/dist/index.js:44819:41) + + at __require2 (file:///app/dist/index.js:17:50) + + at file:///app/dist/index.js:47198:63 + + at process.processTicksAndRejections (node:internal/process/task_queues:95:5) + + at async file:///app/dist/index.js:47198:20 + +❌ [EXPORT] Message: Dynamic require of "stream" is not supported + +❌ [EXPORT] Stack: Error: Dynamic require of "stream" is not supported + + at file:///app/dist/index.js:11:9 + + at make_xlsx_lib (file:///app/dist/index.js:44815:22) + + at node_modules/xlsx/xlsx.js (file:///app/dist/index.js:44819:41) + + at __require2 (file:///app/dist/index.js:17:50) + + at file:///app/dist/index.js:47198:63 + + at process.processTicksAndRejections (node:internal/process/task_queues:95:5) + + at async file:///app/dist/index.js:47198:20 + +POST /api/payment-schedule/export 500 in 936ms + +HEAD /api/health 200 in 1ms + diff --git a/attached_assets/Pasted-Actions-isReconciled-true-expired-false-expiresAt-2075-11-04T10-5-1762258554084_1762258554084.txt b/attached_assets/Pasted-Actions-isReconciled-true-expired-false-expiresAt-2075-11-04T10-5-1762258554084_1762258554084.txt new file mode 100644 index 0000000..052d21e --- /dev/null +++ b/attached_assets/Pasted-Actions-isReconciled-true-expired-false-expiresAt-2075-11-04T10-5-1762258554084_1762258554084.txt @@ -0,0 +1,205 @@ +Actions + + + + + isReconciled: true, + + expired: false, + + expiresAt: 2075-11-04T10:58:49.326Z, + + currentTime: '2025-11-04T12:15:03.672Z' + +} + +🛡️ [CACHE] PERMANENT - Facture validée avec coche verte, AUCUNE vérification: { + + invoiceReference: '000752796', + + groupId: 1, + + exists: true, + + invoiceAmount: '1203.12', + + dueDate: null + +} + +✅ [INVOICE] Résultat depuis cache: { + + exists: true, + + matchType: 'invoice_reference', + + errorMessage: null, + + invoiceReference: '000752796', + + supplierName: 'CMP', + + invoiceAmount: 1203.12, + + invoiceAmountTTC: 1443.74, + + dueDate: null, + + fromCache: true, + + permanent: true + +} + +🔍 [INVOICE] Début vérification facture: { invoiceReference: '22529151', groupId: 1, forceRefresh: false } + +🔍 [INVOICE] Vérification cache... + +🔍 [CACHE] Recherche cache pour: { invoiceReference: '22529151', groupId: 1, cacheKey: '1_22529151' } + +✅ [DATABASE-CACHE] Cache hit pour: { + + cacheKey: '1_22529151', + + expires: 2075-11-04T10:58:49.338Z, + + hoursRemaining: 438287 + +} + +🔍 [CACHE] Résultat cache: { + + found: true, + + isReconciled: true, + + expired: false, + + expiresAt: 2075-11-04T10:58:49.338Z, + + currentTime: '2025-11-04T12:15:03.675Z' + +} + +🛡️ [CACHE] PERMANENT - Facture validée avec coche verte, AUCUNE vérification: { + + invoiceReference: '22529151', + + groupId: 1, + + exists: true, + + invoiceAmount: '2653.75', + + dueDate: null + +} + +✅ [INVOICE] Résultat depuis cache: { + + exists: true, + + matchType: 'invoice_reference', + + errorMessage: null, + + invoiceReference: '22529151', + + supplierName: 'Sovacom', + + invoiceAmount: 2653.75, + + invoiceAmountTTC: 3184.5, + + dueDate: null, + + fromCache: true, + + permanent: true + +} + +🔍 [INVOICE] Début vérification facture: { invoiceReference: 'FCLT035833', groupId: 1, forceRefresh: false } + +🔍 [INVOICE] Vérification cache... + +🔍 [CACHE] Recherche cache pour: { + + invoiceReference: 'FCLT035833', + + groupId: 1, + + cacheKey: '1_fclt035833' + +} + +✅ [DATABASE-CACHE] Cache hit pour: { + + cacheKey: '1_fclt035833', + + expires: 2075-11-04T10:58:49.353Z, + + hoursRemaining: 438287 + +} + +🔍 [CACHE] Résultat cache: { + + found: true, + + isReconciled: true, + + expired: false, + + expiresAt: 2075-11-04T10:58:49.353Z, + + currentTime: '2025-11-04T12:15:03.677Z' + +} + +🛡️ [CACHE] PERMANENT - Facture validée avec coche verte, AUCUNE vérification: { + + invoiceReference: 'FCLT035833', + + groupId: 1, + + exists: true, + + invoiceAmount: '1307.26', + + dueDate: null + +} + +✅ [INVOICE] Résultat depuis cache: { + + exists: true, + + matchType: 'invoice_reference', + + errorMessage: null, + + invoiceReference: 'FCLT035833', + + supplierName: 'Idvpc', + + invoiceAmount: 1307.26, + + invoiceAmountTTC: 1568.71, + + dueDate: null, + + fromCache: true, + + permanent: true + +} + +💰 Livraisons nécessitant récupération TTC: 0 + +📅 Total échéances retournées: 34 + +GET /api/payment-schedule 304 in 17159ms + +HEAD /api/health 200 in 1ms + diff --git a/attached_assets/{20C84D95-5589-4A3B-A3E8-FF26B0DE30B9}_1762258671191.png b/attached_assets/{20C84D95-5589-4A3B-A3E8-FF26B0DE30B9}_1762258671191.png new file mode 100644 index 0000000..440210a Binary files /dev/null and b/attached_assets/{20C84D95-5589-4A3B-A3E8-FF26B0DE30B9}_1762258671191.png differ diff --git a/attached_assets/{243F4726-3549-4C96-80EB-0FD9A84A36ED}_1762259049954.png b/attached_assets/{243F4726-3549-4C96-80EB-0FD9A84A36ED}_1762259049954.png new file mode 100644 index 0000000..c5ab841 Binary files /dev/null and b/attached_assets/{243F4726-3549-4C96-80EB-0FD9A84A36ED}_1762259049954.png differ diff --git a/attached_assets/{58EC7866-65BC-47E0-8411-6F41026061E8}_1762258865336.png b/attached_assets/{58EC7866-65BC-47E0-8411-6F41026061E8}_1762258865336.png new file mode 100644 index 0000000..d9ab6d1 Binary files /dev/null and b/attached_assets/{58EC7866-65BC-47E0-8411-6F41026061E8}_1762258865336.png differ diff --git a/attached_assets/{773F1FF1-B583-448A-8998-E60750EFCEB7}_1762258496115.png b/attached_assets/{773F1FF1-B583-448A-8998-E60750EFCEB7}_1762258496115.png new file mode 100644 index 0000000..6a3895d Binary files /dev/null and b/attached_assets/{773F1FF1-B583-448A-8998-E60750EFCEB7}_1762258496115.png differ diff --git a/attached_assets/{A4AE40BA-CB21-4BC1-B78E-3D15E088357E}_1762258064762.png b/attached_assets/{A4AE40BA-CB21-4BC1-B78E-3D15E088357E}_1762258064762.png new file mode 100644 index 0000000..db917d6 Binary files /dev/null and b/attached_assets/{A4AE40BA-CB21-4BC1-B78E-3D15E088357E}_1762258064762.png differ diff --git a/client/src/pages/PaymentSchedulePage.tsx b/client/src/pages/PaymentSchedulePage.tsx index 042fa8b..886aa1b 100644 --- a/client/src/pages/PaymentSchedulePage.tsx +++ b/client/src/pages/PaymentSchedulePage.tsx @@ -212,7 +212,7 @@ export default function PaymentSchedulePage() { const url = window.URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; - a.download = `echeancier_${selectedMonth}.xlsx`; + a.download = `echeancier_${selectedMonth}.csv`; document.body.appendChild(a); a.click(); window.URL.revokeObjectURL(url); @@ -221,7 +221,7 @@ export default function PaymentSchedulePage() { setShowExportModal(false); toast({ title: "Export réussi", - description: "Le fichier Excel a été téléchargé avec succès.", + description: "Le fichier CSV a été téléchargé avec succès. Ouvrez-le dans Excel.", }); } catch (error) { console.error('Erreur export:', error); @@ -303,10 +303,10 @@ export default function PaymentSchedulePage() { variant="outline" className="gap-2" disabled={filteredSchedules.length === 0} - data-testid="button-export-excel" + data-testid="button-export-csv" > - Exporter Excel + Exporter CSV