Fix: Cash-Vorbelegung im Ist-Wizard zeigte den Phasen-Endwert
Deploy App / deploy (push) Successful in 1m4s
Deploy App / deploy (push) Successful in 1m4s
Der Wizard las cashBridge.cashEnd -- also den Stand am Phasenende statt am gewaehlten Stichtag. In einer Phase 2026-2036 erschien fuer 2031 der Wert von 2036. Ursache: computePlan wies den Cash-Bestand nur je PHASE aus. YearPoint traegt neu ein Feld `cash` (Stand am Jahresende), analog zu wealthNominal; der Wizard liest daraus. Die Vorbelegung der Elemente war nie betroffen -- die stammte schon immer aus dem Jahresverlauf. Zwei Regressionstests (208 -> 210). Spezifikation 0.22. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -198,6 +198,11 @@ export interface YearPoint {
|
||||
// Vermögensverlauf über ALLE Jahre statt nur über die Phasengrenzen.
|
||||
wealthNominal: number;
|
||||
wealthReal: number;
|
||||
// Cash-Bestand am Jahresende. Die Brücken führen Cash nur je PHASE (Anfang/Ende) -- für
|
||||
// eine Aussage zu einem einzelnen Jahr (Vorbelegung der effektiven Werte, Kap. 3.9.2)
|
||||
// reicht das nicht: In einer Phase über zehn Jahre ist der Phasen-Endwert etwas ganz
|
||||
// anderes als der Stand in der Mitte.
|
||||
cash: number;
|
||||
}
|
||||
|
||||
export interface PlanComputed {
|
||||
@@ -751,6 +756,7 @@ export function computePlan(plan: PlanInput, sample?: PlanSample, options?: Comp
|
||||
expenseReal: Math.round(expenseReal),
|
||||
wealthNominal: 0,
|
||||
wealthReal: 0,
|
||||
cash: 0,
|
||||
};
|
||||
yearly.push(yearPoint);
|
||||
|
||||
@@ -907,6 +913,7 @@ export function computePlan(plan: PlanInput, sample?: PlanSample, options?: Comp
|
||||
for (const d of debts) total += -d.owed;
|
||||
yearPoint.wealthNominal = Math.round(total);
|
||||
yearPoint.wealthReal = Math.round(total / (cumInfl[yearsBefore + t] || 1));
|
||||
yearPoint.cash = Math.round(cash);
|
||||
if (ruinAge === null && total < 0) ruinAge = personA.age + yearsBefore + t;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user