Drei Berechnungs-Fixes: Phaseninflation, Tilgungsraten, Vorbezugssteuer
- Phase.inflationRate ersatzlos entfernt (inkl. Migration). Die Inflation liegt seit V5 plan-weit; das Feld wurde von computePlan nie gelesen und war wirkungslos. - Amortisation und Tilgung stoppen, sobald Hypothek bzw. Schuld abbezahlt sind: Hypothek/Restschuld sind neu laufende Salden, die Rate ist pro Jahr am Restsaldo gekappt. Belastet danach weder Cash noch Sparquote. - Kapitalbezugssteuer greift neu auch bei PK-/3a-Vorbezuegen vor der Pensionierung. Der Bezug wird brutto dem Kapital entnommen, netto ins Cash gebucht. plannedSaveRate ist neu die Rate des ersten Phasenjahres. Drei Regressionstests ergaenzt (10 -> 13). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -8,7 +8,6 @@ import { maxPhaseDuration } from "@/lib/calculations";
|
||||
const updatePhaseSchema = z.object({
|
||||
name: z.string().min(1).max(120).optional(),
|
||||
durationYears: z.number().int().min(1).max(80).optional(),
|
||||
inflationRate: z.number().min(-20).max(50).nullable().optional(),
|
||||
});
|
||||
|
||||
export async function PUT(
|
||||
@@ -46,7 +45,6 @@ export async function PUT(
|
||||
data: {
|
||||
name: parsed.data.name ?? undefined,
|
||||
durationYears: duration ?? undefined,
|
||||
inflationRate: parsed.data.inflationRate === undefined ? undefined : parsed.data.inflationRate,
|
||||
},
|
||||
});
|
||||
return NextResponse.json({ phase: { id: phase.id } });
|
||||
|
||||
@@ -10,7 +10,6 @@ import { num, type PhaseData } from "@/lib/elements";
|
||||
const createPhaseSchema = z.object({
|
||||
name: z.string().min(1).max(120).optional(),
|
||||
durationYears: z.number().int().min(1).max(80).optional(),
|
||||
inflationRate: z.number().min(-20).max(50).nullable().optional(),
|
||||
});
|
||||
|
||||
// Legt eine neue Lebensphase am Ende der Kette an. Die Dauer wird ans naechste
|
||||
@@ -59,7 +58,6 @@ export async function POST(
|
||||
sequenceNumber: nextSequence,
|
||||
name: defaultName,
|
||||
durationYears: duration,
|
||||
inflationRate: parsed.data.inflationRate ?? undefined,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -58,7 +58,6 @@ export async function POST(
|
||||
sequenceNumber: phase.sequenceNumber,
|
||||
name: phase.name,
|
||||
durationYears: phase.durationYears,
|
||||
inflationRate: phase.inflationRate,
|
||||
},
|
||||
});
|
||||
phaseIdMap.set(phase.id, created.id);
|
||||
|
||||
Reference in New Issue
Block a user