fix: GuV-Tab als Jahrestabelle (y2026-y2030) statt Monatsgrid

GuV hat Jahres-Keys (y2026) statt Monats-Keys (m1-m60).
Eigene Tabelle mit 5 Jahrsspalten, Jahresnavigation ausgeblendet.
Alle Summenzeilen (EBIT, Ergebnis, Jahresueberschuss) hervorgehoben.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-03-26 23:50:53 +01:00
parent a01e6cb88e
commit 16de384831

View File

@@ -152,24 +152,64 @@ export default function FinanzplanSlide({ lang }: FinanzplanSlideProps) {
</button>
</div>
{/* Year Navigation */}
<div className="flex items-center justify-center gap-4 mb-2">
<button onClick={() => setYearOffset(Math.max(0, yearOffset - 1))} disabled={yearOffset === 0}
className="p-1 text-white/40 hover:text-white/70 disabled:opacity-20">
<ChevronLeft className="w-4 h-4" />
</button>
<span className="text-sm font-bold text-white">{currentYear}</span>
<button onClick={() => setYearOffset(Math.min(4, yearOffset + 1))} disabled={yearOffset === 4}
className="p-1 text-white/40 hover:text-white/70 disabled:opacity-20">
<ChevronRight className="w-4 h-4" />
</button>
</div>
{/* Year Navigation — not for GuV (annual view) */}
{activeSheet !== 'guv' && (
<div className="flex items-center justify-center gap-4 mb-2">
<button onClick={() => setYearOffset(Math.max(0, yearOffset - 1))} disabled={yearOffset === 0}
className="p-1 text-white/40 hover:text-white/70 disabled:opacity-20">
<ChevronLeft className="w-4 h-4" />
</button>
<span className="text-sm font-bold text-white">{currentYear}</span>
<button onClick={() => setYearOffset(Math.min(4, yearOffset + 1))} disabled={yearOffset === 4}
className="p-1 text-white/40 hover:text-white/70 disabled:opacity-20">
<ChevronRight className="w-4 h-4" />
</button>
</div>
)}
{/* Data Grid */}
<GlassCard hover={false} className="p-2 overflow-x-auto">
{loading ? (
<div className="text-center py-8 text-white/30 text-sm">{de ? 'Lade...' : 'Loading...'}</div>
) : activeSheet === 'guv' ? (
/* === GuV: Annual table (y2026-y2030) === */
<table className="w-full text-[10px]">
<thead>
<tr className="border-b border-white/10">
<th className="text-left py-1.5 px-2 text-white/40 font-medium sticky left-0 bg-slate-900/90 backdrop-blur min-w-[220px]">
{de ? 'GuV-Position' : 'P&L Item'}
</th>
{[2026, 2027, 2028, 2029, 2030].map(y => (
<th key={y} className="text-right py-1.5 px-3 text-white/40 font-medium min-w-[100px]">{y}</th>
))}
</tr>
</thead>
<tbody>
{rows.map(row => {
const values = getValues(row)
const label = getLabel(row)
const isSumRow = row.is_sum_row || label.includes('EBIT') || label.includes('Summe') || label.includes('Rohergebnis') || label.includes('Gesamtleistung') || label.includes('Jahresueberschuss') || label.includes('Ergebnis')
return (
<tr key={row.id} className={`border-b border-white/[0.03] ${isSumRow ? 'bg-white/[0.03]' : ''} hover:bg-white/[0.02]`}>
<td className={`py-1.5 px-2 sticky left-0 bg-slate-900/90 backdrop-blur ${isSumRow ? 'font-bold text-white/80' : 'text-white/60'}`}>
{label}
</td>
{[2026, 2027, 2028, 2029, 2030].map(y => {
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 })}
</td>
)
})}
</tr>
)
})}
</tbody>
</table>
) : (
/* === Monthly Grid (all other sheets) === */
<table className="w-full text-[10px]">
<thead>
<tr className="border-b border-white/10">