// Tax + Rent + Tasks pages — neue Module für Steuer, Mieten-Status, Aufgaben // ──────────────────────────────────────────────────────────────────── // AfA-Sektion: wird auf PropertyDetail eingebunden + auf TaxPage // ──────────────────────────────────────────────────────────────────── function AfaSection({ data, propertyId }) { const { assets, properties, store } = data; const [year, setYear] = React.useState(new Date().getFullYear()); const [showForm, setShowForm] = React.useState(false); const [editing, setEditing] = React.useState(null); const [deleting, setDeleting] = React.useState(null); const [summary, setSummary] = React.useState(null); React.useEffect(() => { let cancelled = false; window.getAfaSummary({ year, propertyId }) .then(s => { if (!cancelled) setSummary(s); }) .catch(() => {}); return () => { cancelled = true; }; }, [year, propertyId, assets]); const propAssets = (assets || []).filter(a => !propertyId || a.propertyId === propertyId); const openAdd = () => { setEditing(null); setShowForm(true); }; return (
| Bezeichnung | Typ | Anschaffung | Kosten | AfA-Satz | AfA {year} | Buchwert | |
|---|---|---|---|---|---|---|---|
| {a.label} | {typeLabel} | {fmtDateShort(a.acquisitionDate)} | {fmtEUR(a.acquisitionCost)} | {a.afaRate.toFixed(1)} % | {fmtEUR(a.afaThisYear)} | {fmtEUR(a.bookValue)} | e.stopPropagation()} style={{ whiteSpace: 'nowrap' }}> |
| Mieter | Wohnung | Soll | Ist | Saldo | Fehlende Monate | |
|---|---|---|---|---|---|---|
| {fmtEUR(t.expectedAmount)} | {fmtEUR(t.receivedAmount)} | {t.saldo >= 0 ? '+' : ''}{fmtEUR(t.saldo)} | {t.missedMonths.length === 0 ? ( vollständig ) : ( {t.missedMonths.length} ({t.missedMonths.slice(0, 3).join(', ')}{t.missedMonths.length > 3 ? '…' : ''}) )} | {isDebtor && ( )} |