From 66fb265f222eaa42f56f8a2aefed845078832d12 Mon Sep 17 00:00:00 2001 From: Benjamin Admin Date: Mon, 20 Apr 2026 10:31:47 +0200 Subject: [PATCH] feat(pitch-deck): collapsible year view in Finanzplan + remove section labels - Year navigation: "Alle Jahre" shows 5 annual columns, individual years show 12 months - Default starts at single year view - Annual view: flow rows show yearly sum, balance rows show Dec value - Removed [section] labels from row display - Footer sum only shown in monthly view (not annual) Co-Authored-By: Claude Opus 4.6 (1M context) --- .../components/slides/FinanzplanSlide.tsx | 128 +++++++++++------- 1 file changed, 80 insertions(+), 48 deletions(-) diff --git a/pitch-deck/components/slides/FinanzplanSlide.tsx b/pitch-deck/components/slides/FinanzplanSlide.tsx index 08e5011..80b3811 100644 --- a/pitch-deck/components/slides/FinanzplanSlide.tsx +++ b/pitch-deck/components/slides/FinanzplanSlide.tsx @@ -500,18 +500,24 @@ export default function FinanzplanSlide({ lang, investorId, preferredScenarioId, )} - {/* Year Navigation — not for GuV, KPIs, Charts (annual views) */} + {/* Year Navigation — not for GuV, KPIs, Charts */} {!['guv', 'kpis', 'charts'].includes(activeSheet) && ( -
- - {currentYear} - + {[2026, 2027, 2028, 2029, 2030].map((y, idx) => ( + + ))}
)} @@ -558,21 +564,30 @@ export default function FinanzplanSlide({ lang, investorId, preferredScenarioId, ) : ( - /* === Monthly Grid (all other sheets) === */ + /* === Monthly/Annual Grid (all other sheets) === */ - - {MONTH_LABELS.map((label, idx) => ( - - ))} + {yearOffset === -1 ? ( + // All years view + [2026, 2027, 2028, 2029, 2030].map(y => ( + + )) + ) : ( + <> + + {MONTH_LABELS.map((label, idx) => ( + + ))} + + )} @@ -668,39 +683,59 @@ export default function FinanzplanSlide({ lang, investorId, preferredScenarioId, {isEditable && } {row.position && ({row.position})} - {row.section && [{row.section}]} - - {Array.from({ length: 12 }, (_, idx) => { - const mKey = `m${monthStart + idx}` - const v = values[mKey] || 0 - - return ( - + ) + }) + ) : ( + <> + - ) - })} + {Array.from({ length: 12 }, (_, idx) => { + const mKey = `m${monthStart + idx}` + const v = values[mKey] || 0 + return ( + + ) + })} + + )} ) })} {/* Summenzeile für relevante Sheets */} - {['personalkosten', 'betriebliche', 'investitionen', 'sonst_ertraege'].includes(activeSheet) && rows.length > 0 && (() => { - // Berechne Summe über alle Zeilen die keine Summenzeilen sind + {yearOffset !== -1 && ['personalkosten', 'betriebliche', 'investitionen'].includes(activeSheet) && rows.length > 0 && (() => { const sumValues: Record = {} let sumAnnual = 0 const nonSumRows = rows.filter(r => { @@ -724,10 +759,7 @@ export default function FinanzplanSlide({ lang, investorId, preferredScenarioId, {de ? 'SUMME' : 'TOTAL'} {Array.from({ length: 12 }, (_, idx) => { const mKey = `m${monthStart + idx}`
{de ? 'Position' : 'Item'} - {currentYear} - - {label} - {y} + {currentYear} + + {label} +
- {formatCell(annual)} - 0 ? (isSumRow ? 'text-white/70' : 'text-white/50') : 'text-white/15' - } ${isEditable ? 'cursor-pointer hover:bg-indigo-500/10' : ''}`} - onDoubleClick={() => { - if (!isEditable) return - const input = prompt(`${label} — ${MONTH_LABELS[idx]} ${currentYear}`, String(v)) - if (input !== null) handleCellEdit(row.id, mKey, input) - }} - > - {formatCell(v)} + {yearOffset === -1 ? ( + // All years view: show annual values per year + [2026, 2027, 2028, 2029, 2030].map(y => { + const yStart = (y - 2026) * 12 + 1 + const yEnd = yStart + 11 + let yVal = 0 + if (isUnitPrice) { + yVal = values[`m${yEnd}`] || 0 + } else if (isBalanceRow) { + yVal = values[`m${yEnd}`] || 0 + } else { + for (let m = yStart; m <= yEnd; m++) yVal += values[`m${m}`] || 0 + } + return ( + 0 ? (isSumRow ? 'text-white/80' : 'text-white/50') : 'text-white/15'} ${isSumRow ? 'font-bold' : ''}`}> + {formatCell(Math.round(yVal))} + + {formatCell(annual)} 0 ? (isSumRow ? 'text-white/70' : 'text-white/50') : 'text-white/15' + } ${isEditable ? 'cursor-pointer hover:bg-indigo-500/10' : ''}`} + onDoubleClick={() => { + if (!isEditable) return + const input = prompt(`${label} — ${MONTH_LABELS[idx]} ${currentYear}`, String(v)) + if (input !== null) handleCellEdit(row.id, mKey, input) + }} + > + {formatCell(v)} +
- {['kunden', 'kunden_summary'].includes(activeSheet) - ? formatCell(sumValues[`m${monthEnd}`] || 0) - : formatCell(sumAnnual) - } + {formatCell(sumAnnual)}