From d496073e889878e2dfd08f1d1455e50d7a9f0b69 Mon Sep 17 00:00:00 2001 From: Christian Vidal Wolf Date: Tue, 27 Jan 2026 09:43:28 +0100 Subject: [PATCH] Forecast View: Period-aware banners and labels --- components/ForecastView.tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/components/ForecastView.tsx b/components/ForecastView.tsx index 413eba1..c015a8d 100644 --- a/components/ForecastView.tsx +++ b/components/ForecastView.tsx @@ -85,14 +85,16 @@ const ForecastView: React.FC = ({ data, filters, top50Ranking let totalForecast = 0; let totalActual = 0; data.forEach(p => { - totalForecast += p.annualForecast; p.monthlyData.forEach(md => { - totalActual += md.actualUnits; + if (activeMonths.includes(md.month)) { + totalForecast += md.forecastUnits; + totalActual += md.actualUnits; + } }); }); const fulfillment = totalForecast > 0 ? (totalActual / totalForecast) * 100 : 0; return { totalForecast, totalActual, fulfillment }; - }, [data]); + }, [data, activeMonths]); const filteredProducts = useMemo(() => { let result = data; @@ -138,7 +140,7 @@ const ForecastView: React.FC = ({ data, filters, top50Ranking
-

Total Forecast 2026

+

Total Forecast (Period)

{globalSummary.totalForecast.toLocaleString('de-DE')} Units
@@ -146,7 +148,7 @@ const ForecastView: React.FC = ({ data, filters, top50Ranking
-

Total Actual Sales 2026

+

Total Actual Sales (Period)

{globalSummary.totalActual.toLocaleString('de-DE')} Units
@@ -154,7 +156,7 @@ const ForecastView: React.FC = ({ data, filters, top50Ranking
-

Global Fulfillment

+

Fulfillment (Period)

= 100 ? 'text-emerald-400' : 'text-indigo-400'}`}> {globalSummary.fulfillment.toFixed(1)}%