fix(pitch-deck): remove Berechnen button + cell editing from Finanzplan
Some checks failed
Build pitch-deck / build-push-deploy (push) Successful in 1m10s
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-consent (push) Successful in 29s
CI / test-python-voice (push) Successful in 30s
CI / test-bqas (push) Has been cancelled

Finanzplan is now read-only for investors:
- Removed "Berechnen" / "Compute" button
- Removed cell double-click editing
- Removed blue edit indicator dots
- All sums computed live in frontend (no manual recompute needed)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-04-20 10:51:43 +02:00
parent 73e3749960
commit 6111494460

View File

@@ -99,7 +99,6 @@ export default function FinanzplanSlide({ lang, investorId, preferredScenarioId,
const [activeSheet, setActiveSheet] = useState<string>('guv')
const [rows, setRows] = useState<SheetRow[]>([])
const [loading, setLoading] = useState(false)
const [computing, setComputing] = useState(false)
const [yearOffset, setYearOffset] = useState(0) // 0=2026, 1=2027, ...
const de = lang === 'de'
@@ -197,31 +196,6 @@ export default function FinanzplanSlide({ lang, investorId, preferredScenarioId,
useEffect(() => { loadSheet(activeSheet) }, [activeSheet, loadSheet])
// Compute
const handleCompute = async () => {
setComputing(true)
try {
await fetch('/api/finanzplan/compute', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ scenarioId: selectedScenarioId || undefined }) })
await loadSheet(activeSheet)
} catch { /* ignore */ }
setComputing(false)
}
// Cell edit
const handleCellEdit = async (rowId: number, monthKey: string, newValue: string) => {
const numVal = parseFloat(newValue.replace(/[^\d.-]/g, ''))
if (isNaN(numVal)) return
try {
await fetch(`/api/finanzplan/${activeSheet}`, {
method: 'PUT',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ rowId, updates: { [monthKey]: numVal } }),
})
await loadSheet(activeSheet)
} catch { /* ignore */ }
}
const currentYear = 2026 + yearOffset
const monthStart = yearOffset * 12 + 1
const monthEnd = monthStart + 11
@@ -270,15 +244,6 @@ export default function FinanzplanSlide({ lang, investorId, preferredScenarioId,
{tab.label}
</button>
))}
<div className="flex-1" />
<button
onClick={handleCompute}
disabled={computing}
className="flex items-center gap-1 px-3 py-1.5 text-[10px] bg-emerald-500/20 text-emerald-300 rounded-lg hover:bg-emerald-500/30 transition-colors disabled:opacity-50"
>
<RefreshCw className={`w-3 h-3 ${computing ? 'animate-spin' : ''}`} />
{de ? 'Berechnen' : 'Compute'}
</button>
</div>
{/* === KPIs Tab === */}
@@ -656,7 +621,7 @@ export default function FinanzplanSlide({ lang, investorId, preferredScenarioId,
const label = getLabel(row)
const isSumRow = row.is_sum_row || label.includes('GESAMT') || label.includes('Summe') || label.includes('ÜBERSCHUSS') || label.includes('LIQUIDITÄT') || label.includes('UEBERSCHUSS') || label.includes('LIQUIDITAET')
const isTotalRow = label.includes('GESAMT') || label.includes('Bestandskunden gesamt') || label.includes('GESAMTUMSATZ') || label.includes('SUMME')
const isEditable = row.is_editable
const isEditable = false // read-only for investors
// Balance rows show Dec value, flow rows show annual sum
const isBalanceRow = label.includes('Kontostand') || label === 'LIQUIDITÄT' || label === 'LIQUIDITAET'
const isUnitPrice = (row as Record<string, unknown>).section === 'unit_cost' || (row as Record<string, unknown>).section === 'einkauf' || label.includes('Einkaufspreis')