@@ -668,39 +683,59 @@ export default function FinanzplanSlide({ lang, investorId, preferredScenarioId,
{isEditable && }
{row.position && ({row.position})}
- {row.section && [{row.section}]}
- |
- {formatCell(annual)}
- |
- {Array.from({ length: 12 }, (_, idx) => {
- const mKey = `m${monthStart + idx}`
- const v = values[mKey] || 0
-
- return (
- 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)}
|
- )
- })}
+ {Array.from({ length: 12 }, (_, idx) => {
+ const mKey = `m${monthStart + idx}`
+ const v = values[mKey] || 0
+ return (
+ 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)}
+ |
+ )
+ })}
+ >
+ )}
)
})}
{/* 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