From 2b411404da5e5f7e62e6df65bc82b11fb6963a66 Mon Sep 17 00:00:00 2001 From: DEls Date: Wed, 21 Oct 2026 04:43:56 +0200 Subject: [PATCH] fix(management): drop 95% cost line from income chart; purple/green cumulative result Remove the planned-cost line from the actual vs forecast income chart and colour the Turnover Overview cumulative result purple (planned) or green (actual). Co-Authored-By: Claude Sonnet 5.5 --- .../dashboard/management/management-charts.tsx | 15 ++++++--------- src/app/dashboard/management/turnover-view.tsx | 2 +- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/app/dashboard/management/management-charts.tsx b/src/app/dashboard/management/management-charts.tsx index a40bb5b..4927126 100644 --- a/src/app/dashboard/management/management-charts.tsx +++ b/src/app/dashboard/management/management-charts.tsx @@ -104,7 +104,7 @@ export function IncomeCostChart({ months, title = "Income & cost", incomeLabel = description={description ?? "Teal shows income left after costs, excluding retention payouts. Values below zero are red."} />; } -export function ResultChart({ months, title = "Cumulative planned cash result from zero; not a bank balance" }: { months: { label: string; cumulativeResult: number | null }[]; title?: string }) { +export function ResultChart({ months, title = "Cumulative planned cash result from zero; not a bank balance", color = chartColors.result }: { months: { label: string; cumulativeResult: number | null }[]; title?: string; color?: string }) { const gradientId = useId().replace(/:/g, ""); const max = Math.max(0, ...months.map((m) => m.cumulativeResult ?? 0)); const min = Math.min(0, ...months.map((m) => m.cumulativeResult ?? 0)); @@ -112,8 +112,8 @@ export function ResultChart({ months, title = "Cumulative planned cash result fr return
} cursor={{ stroke: "var(--muted-foreground)", strokeDasharray: "3 5" }} /> - - + +
; } @@ -145,7 +145,6 @@ function IncomeForecastTooltip({ active, payload, label }: { active?: boolean; p return
{label}
Forecast{money(point.forecast)}
-
Planned cost (95% of forecast){money(point.forecastCost)}
Actual / invoiced{money(point.actual)}
Not yet started{money(point.notStarted)}
{variance !== null &&
Variance{money(variance)}
} @@ -162,7 +161,6 @@ export function IncomeForecastChart({ data }: { data: IncomeSeriesPoint[] }) { const rows = data.map((point) => ({ label: incomeMonthLabel(point.index), forecast: point.forecast, - forecastCost: point.forecastCost, forecastRed: point.redOnActual ? null : point.notStarted, actual: point.actual, actualRed: point.redOnActual ? point.notStarted : null, @@ -171,9 +169,9 @@ export function IncomeForecastChart({ data }: { data: IncomeSeriesPoint[] }) { const tooltipSpace = 156; return
- +
-
+
@@ -186,10 +184,9 @@ export function IncomeForecastChart({ data }: { data: IncomeSeriesPoint[] }) { -
-

Purple: forecast. Grey dashed line: planned cost at 95% of the purple forecast income only, excluding red amounts. Green: invoiced actuals. Red: awarded jobs not yet started, stacked on the invoiced bar up to the current month and on the forecast bar after it.

+

Purple: forecast. Green: invoiced actuals. Red: awarded jobs not yet started, stacked on the invoiced bar up to the current month and on the forecast bar after it.

; } diff --git a/src/app/dashboard/management/turnover-view.tsx b/src/app/dashboard/management/turnover-view.tsx index 193ca3c..0966e39 100644 --- a/src/app/dashboard/management/turnover-view.tsx +++ b/src/app/dashboard/management/turnover-view.tsx @@ -35,7 +35,7 @@ function TurnoverSection({ data, periodLabel, part }: { data: TurnoverSectionDat
; if (part === "result") return - +
Selected period result{amount(data.result)}
; return