From c17cc7ed5e20da1b075173bcbf5a4e74a3651b13 Mon Sep 17 00:00:00 2001 From: michaelschal <35957947-michaelschal@users.noreply.replit.com> Date: Tue, 4 Nov 2025 05:35:19 +0000 Subject: [PATCH 1/2] Fix issue where invoice amounts and due dates do not update correctly Address a bug in the invoice verification process where `invoiceAmount` and `dueDate` fields were not being updated from cache, leading to stale data when the green checkmark was present. This commit ensures these fields are correctly populated from NocoDB or relevant data sources. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 1e4433b5-47ab-464c-b663-fea2e53367dd Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 302575d1-3428-4b62-9d1b-07ed4c9aa548 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/1e4433b5-47ab-464c-b663-fea2e53367dd/gTQvEeF --- ...fication-e-1762234474743_1762234474743.txt | 204 ++++++++++++++++++ 1 file changed, 204 insertions(+) create mode 100644 attached_assets/Pasted-dueDate-null-fromCache-true-permanent-false-R-sultat-v-rification-e-1762234474743_1762234474743.txt diff --git a/attached_assets/Pasted-dueDate-null-fromCache-true-permanent-false-R-sultat-v-rification-e-1762234474743_1762234474743.txt b/attached_assets/Pasted-dueDate-null-fromCache-true-permanent-false-R-sultat-v-rification-e-1762234474743_1762234474743.txt new file mode 100644 index 0000000..0eea4e0 --- /dev/null +++ b/attached_assets/Pasted-dueDate-null-fromCache-true-permanent-false-R-sultat-v-rification-e-1762234474743_1762234474743.txt @@ -0,0 +1,204 @@ +dueDate: null, + + fromCache: true, + + permanent: false + +} + +✅ Résultat vérification: { + + exists: true, + + matchType: 'invoice_reference', + + errorMessage: null, + + invoiceReference: 'FC25638222', + + supplierName: 'Tendance', + + invoiceAmount: undefined, + + dueDate: null, + + fromCache: true, + + permanent: false + +} + +✅ [DATABASE-CACHE] Cache hit pour: { + + cacheKey: '1_fc25638222', + + expires: 2025-11-04T11:22:05.884Z, + + hoursRemaining: 6 + +} + +🔍 [CACHE] Résultat cache: { + + found: true, + + isReconciled: false, + + expired: false, + + expiresAt: 2025-11-04T11:22:05.884Z, + + currentTime: '2025-11-04T05:33:50.014Z' + +} + +✅ [CACHE] Cache temporaire hit pour: { invoiceReference: 'FC25638222', groupId: 1, exists: true } + +✅ [INVOICE] Résultat depuis cache: { + + exists: true, + + matchType: 'invoice_reference', + + errorMessage: null, + + invoiceReference: 'FC25638222', + + supplierName: 'Tendance', + + invoiceAmount: undefined, + + dueDate: null, + + fromCache: true, + + permanent: false + +} + +✅ Résultat vérification: { + + exists: true, + + matchType: 'invoice_reference', + + errorMessage: null, + + invoiceReference: 'FC25638222', + + supplierName: 'Tendance', + + invoiceAmount: undefined, + + dueDate: null, + + fromCache: true, + + permanent: false + +} + +POST /api/deliveries/335/verify-invoice 200 in 432ms + +POST /api/deliveries/420/verify-invoice 200 in 462ms + +POST /api/deliveries/385/verify-invoice 200 in 424ms + +POST /api/deliveries/385/verify-invoice 200 in 407ms + +✅ [DATABASE-CACHE] Cache hit pour: { + + cacheKey: 'bl_1_bl00060473_ access deco', + + expires: 2025-11-04T10:19:30.357Z, + + hoursRemaining: 5 + +} + +💾 Cache hit pour BL: { blNumber: 'BL00060473', groupId: 1 } + +✅ Résultat vérification: { + + exists: false, + + matchType: 'none', + + errorMessage: 'Aucun BL correspondant trouvé dans NocoDB', + + invoiceReference: 'BL00060473', + + supplierName: ' Access Deco', + + fromCache: true + +} + +✅ [DATABASE-CACHE] Cache hit pour: { + + cacheKey: 'bl_1_198355_depot', + + expires: 2025-11-04T10:19:30.101Z, + + hoursRemaining: 5 + +} + +💾 Cache hit pour BL: { blNumber: '198355', groupId: 1 } + +✅ Résultat vérification: { + + exists: false, + + matchType: 'none', + + errorMessage: 'Aucun BL correspondant trouvé dans NocoDB', + + invoiceReference: '198355', + + supplierName: 'Depot', + + fromCache: true + +} + +✅ [DATABASE-CACHE] Cache hit pour: { + + cacheKey: 'bl_1_bl00060473_ access deco', + + expires: 2025-11-04T10:19:30.357Z, + + hoursRemaining: 5 + +} + +💾 Cache hit pour BL: { blNumber: 'BL00060473', groupId: 1 } + +✅ Résultat vérification: { + + exists: false, + + matchType: 'none', + + errorMessage: 'Aucun BL correspondant trouvé dans NocoDB', + + invoiceReference: 'BL00060473', + + supplierName: ' Access Deco', + + fromCache: true + +} + +POST /api/deliveries/333/verify-invoice 200 in 449ms + +POST /api/deliveries/335/verify-invoice 200 in 414ms + +POST /api/deliveries/333/verify-invoice 200 in 439ms + +HEAD /api/health 200 in 1ms + + + + + \ No newline at end of file From 11a59f53e62352b547ddf6cf9c4a8512d8260ceb Mon Sep 17 00:00:00 2001 From: michaelschal <35957947-michaelschal@users.noreply.replit.com> Date: Tue, 4 Nov 2025 05:43:40 +0000 Subject: [PATCH 2/2] Update data storage to include invoice details and reconciliation status Modify DatabaseStorage and MemStorage classes to incorporate new fields: supplierName, invoiceReference, invoiceAmount, dueDate, and isReconciled, enhancing data persistence and retrieval for invoice management. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 1e4433b5-47ab-464c-b663-fea2e53367dd Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 521a9239-53be-4766-99e6-a59de73ba301 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/1e4433b5-47ab-464c-b663-fea2e53367dd/gTQvEeF --- server/storage.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server/storage.ts b/server/storage.ts index d7b2dba..8cde487 100644 --- a/server/storage.ts +++ b/server/storage.ts @@ -1720,6 +1720,11 @@ export class DatabaseStorage implements IStorage { exists: cacheData.exists, matchType: cacheData.matchType, errorMessage: cacheData.errorMessage, + supplierName: cacheData.supplierName, + invoiceReference: cacheData.invoiceReference, + invoiceAmount: cacheData.invoiceAmount, + dueDate: cacheData.dueDate, + isReconciled: cacheData.isReconciled, cacheHit: cacheData.cacheHit, apiCallTime: cacheData.apiCallTime, updatedAt: new Date() @@ -3615,9 +3620,12 @@ export class MemStorage implements IStorage { groupId: cache.groupId, invoiceReference: cache.invoiceReference, supplierName: cache.supplierName || null, + invoiceAmount: cache.invoiceAmount || null, + dueDate: cache.dueDate || null, exists: cache.exists, matchType: cache.matchType, errorMessage: cache.errorMessage || null, + isReconciled: cache.isReconciled || false, cacheHit: cache.cacheHit || false, apiCallTime: cache.apiCallTime || null, expiresAt: cache.expiresAt,