diff --git a/.replit b/.replit index ba2f351..2585271 100644 --- a/.replit +++ b/.replit @@ -15,6 +15,10 @@ run = ["npm", "run", "start"] localPort = 5000 externalPort = 80 +[[ports]] +localPort = 37321 +externalPort = 3003 + [[ports]] localPort = 38343 externalPort = 3000 diff --git a/attached_assets/image_1758446384149.png b/attached_assets/image_1758446384149.png new file mode 100644 index 0000000..c2eb7b5 Binary files /dev/null and b/attached_assets/image_1758446384149.png differ diff --git a/client/src/pages/BLReconciliation.tsx b/client/src/pages/BLReconciliation.tsx index 4018ba4..ae36b7e 100644 --- a/client/src/pages/BLReconciliation.tsx +++ b/client/src/pages/BLReconciliation.tsx @@ -628,24 +628,8 @@ export default function BLReconciliation() { // Filtrage des livraisons par recherche et statut de validation const filterDeliveries = (deliveries: any[]) => { - // Debug temporaire pour identifier le problĂšme - if (deliveries.length > 0 && filterStatus !== "all") { - console.log('🔍 DEBUG Filtre:', { - filterStatus, - totalDeliveries: deliveries.length, - exemples: deliveries.slice(0, 3).map(d => ({ - id: d.id, - reconciled: d.reconciled, - type: typeof d.reconciled, - rawValue: JSON.stringify(d.reconciled), - supplier: d.supplier?.name - })) - }); - } - return deliveries.filter((delivery: any) => { // Conversion sĂ»re de reconciled - gestion de tous les cas possibles - // PostgreSQL peut retourner : true/false, 1/0, "t"/"f", "true"/"false", null, undefined const isReconciled = delivery.reconciled === true || delivery.reconciled === 1 || @@ -653,31 +637,20 @@ export default function BLReconciliation() { delivery.reconciled === "true" || (typeof delivery.reconciled === 'string' && delivery.reconciled.toLowerCase() === 'true'); - // Filtre par statut validĂ© - avec debug pour chaque Ă©lĂ©ment filtrĂ© + // VĂ©rifier aussi si une facture a Ă©tĂ© trouvĂ©e ET validĂ©e automatiquement + // (certaines livraisons ont une coche verte mais reconciled = false) + const hasVerifiedInvoice = verificationResults[delivery.id]?.exists === true; + const isValidated = isReconciled || (hasVerifiedInvoice && verificationResults[delivery.id]?.reconciled === true); + + // Filtre par statut validĂ© if (filterStatus === "validated") { - const keep = isReconciled; - if (!keep && delivery.blNumber) { - console.log(`❌ FiltrĂ© (non validĂ©):`, { - id: delivery.id, - bl: delivery.blNumber, - reconciled: delivery.reconciled, - isReconciled - }); - } - return keep; + // Afficher seulement les livraisons vraiment validĂ©es (reconciled = true) + return isReconciled; } if (filterStatus === "not_validated") { - const keep = !isReconciled; - if (!keep && delivery.blNumber) { - console.log(`❌ FiltrĂ© (validĂ©):`, { - id: delivery.id, - bl: delivery.blNumber, - reconciled: delivery.reconciled, - isReconciled - }); - } - return keep; + // Afficher seulement les livraisons non validĂ©es (reconciled = false) + return !isReconciled; } // Filtre par recherche