From b3b8c4f9677b78da8b17601292c86cc31b19eb49 Mon Sep 17 00:00:00 2001 From: Christian Vidal Wolf Date: Wed, 28 Jan 2026 11:50:59 +0100 Subject: [PATCH] Revert week logic and add debug tooltip to VendorStockBadge --- components/VendorStockBadge.tsx | 5 ++++- services/dataProcessor.ts | 6 +----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/components/VendorStockBadge.tsx b/components/VendorStockBadge.tsx index 65864d5..d8996fd 100644 --- a/components/VendorStockBadge.tsx +++ b/components/VendorStockBadge.tsx @@ -76,7 +76,10 @@ export const VendorStockBadge: React.FC = ({ asin, vendor {stock.toLocaleString('de-DE')} - + {wocText} diff --git a/services/dataProcessor.ts b/services/dataProcessor.ts index c2ae5fe..cb501eb 100644 --- a/services/dataProcessor.ts +++ b/services/dataProcessor.ts @@ -1820,12 +1820,8 @@ export const calculateVelocityMap = (data: SalesRecord[]): Map = const latestWeek = yearData.length > 0 ? Math.max(...yearData.map(r => r.week).filter(w => w !== undefined) as number[]) : 0; const last4WeeksKeys = new Set(); - // Start from previous week to ensure we use COMPLETED weeks - // If raw data includes current partial week, we skip it. - const startWeek = latestWeek - 1; - for (let i = 0; i < 4; i++) { - let w = startWeek - i; + let w = latestWeek - i; let y = latestYear; if (w <= 0) { w = 52 + w;