fix: Liquidität Kontostand + ganzzahlig + Jahresspalte

- Kontostand/LIQUIDITAET: Jahresspalte zeigt Dez-Wert (nicht Summe)
- Alle Werte ganzzahlig (keine Nachkommastellen)
- Engine: Brutto, Sozial, AfA, Material alles Math.round()
- formatCell: immer maximumFractionDigits: 0
- GuV: Jahreswerte gerundet

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-03-27 17:26:30 +01:00
parent 85949dbf8e
commit f849fd729a
2 changed files with 16 additions and 10 deletions

View File

@@ -53,8 +53,7 @@ function getValues(row: SheetRow): Record<string, number> {
function formatCell(v: number | undefined): string {
if (v === undefined || v === null) return ''
if (v === 0) return '—'
if (Math.abs(v) >= 1000) return v.toLocaleString('de-DE', { maximumFractionDigits: 0 })
return v.toLocaleString('de-DE', { maximumFractionDigits: 2 })
return Math.round(v).toLocaleString('de-DE', { maximumFractionDigits: 0 })
}
export default function FinanzplanSlide({ lang }: FinanzplanSlideProps) {
@@ -199,7 +198,7 @@ export default function FinanzplanSlide({ lang }: FinanzplanSlideProps) {
const v = values[`y${y}`] || 0
return (
<td key={y} className={`text-right py-1.5 px-3 ${v < 0 ? 'text-red-400' : v > 0 ? (isSumRow ? 'text-white/80' : 'text-white/50') : 'text-white/15'} ${isSumRow ? 'font-bold' : ''}`}>
{v === 0 ? '—' : v.toLocaleString('de-DE', { maximumFractionDigits: 0 })}
{v === 0 ? '—' : Math.round(v).toLocaleString('de-DE', { maximumFractionDigits: 0 })}
</td>
)
})}
@@ -232,10 +231,17 @@ export default function FinanzplanSlide({ lang }: FinanzplanSlideProps) {
const label = getLabel(row)
const isSumRow = row.is_sum_row || label.includes('GESAMT') || label.includes('Summe') || label.includes('UEBERSCHUSS') || label.includes('LIQUIDITAET')
const isEditable = row.is_editable
// Balance rows show Dec value, flow rows show annual sum
const isBalanceRow = label.includes('Kontostand') || label === 'LIQUIDITAET'
// Annual sum for visible year
let annual = 0
for (let m = monthStart; m <= monthEnd; m++) annual += values[`m${m}`] || 0
if (isBalanceRow) {
// Point-in-time: show last month (December) value
annual = values[`m${monthEnd}`] || 0
} else {
// Flow: sum all 12 months
for (let m = monthStart; m <= monthEnd; m++) annual += values[`m${m}`] || 0
}
return (
<tr