Ist der Besitzer eines PK-/3a-Elements zu Beginn der Von-Phase bereits pensioniert, wurde die Position bei der Pensionierung bereits bezogen oder verrentet -- in allen weiteren Uebergaengen gibt es nichts mehr zu tun. Zentrale Hilfsfunktion transitionInactive() (verkauft/getilgt ODER PK/3a post-Pension) steuert Zelle, "?"-Status und Offen-Zaehler einheitlich. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -180,13 +180,26 @@ export function PlanView({
|
||||
};
|
||||
}
|
||||
|
||||
// Am Uebergang nichts (mehr) zu tun: verkauft/getilgt ODER PK/3a nach der Pensionierung
|
||||
// (Besitzer ist zu Beginn der Von-Phase bereits pensioniert -> bereits bezogen/verrentet).
|
||||
function transitionInactive(el: ElementInput, fromPhase: PhaseComputed): boolean {
|
||||
const ce = computedElement(fromPhase.id, el.id);
|
||||
if (ce && ce.status !== "ACTIVE") return true;
|
||||
if (el.category === "PENSION_FUND" || el.category === "PILLAR_3A") {
|
||||
if (el.ownerRole && el.ownerRole !== "HOUSEHOLD") {
|
||||
const owner = fromPhase.persons.find((p) => p.role === el.ownerRole);
|
||||
if (owner && !owner.working) return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Anzahl offener (noch nicht getroffener) Uebergangs-Entscheide an einer Grenze.
|
||||
function transitionOpenCount(fromPhase: PhaseComputed, toPhase: PhaseComputed): number {
|
||||
let n = 0;
|
||||
for (const el of plan.elements) {
|
||||
if (!TRANSITION_CATEGORIES.includes(el.category)) continue;
|
||||
const ce = computedElement(fromPhase.id, el.id);
|
||||
if (ce && ce.status !== "ACTIVE") continue;
|
||||
if (transitionInactive(el, fromPhase)) continue;
|
||||
const td = el.transitionValues[fromPhase.id] ?? {};
|
||||
const retire = toPhase ? isRetirementTransition(el, fromPhase, toPhase) : false;
|
||||
if (!isTransitionAnswered(el.category, retire, td)) n++;
|
||||
@@ -196,8 +209,7 @@ export function PlanView({
|
||||
|
||||
// Ist der Uebergangs-Entscheid dieses Elements noch offen?
|
||||
function transitionUnanswered(el: ElementInput, fromPhase: PhaseComputed, toPhase: PhaseComputed): boolean {
|
||||
const ce = computedElement(fromPhase.id, el.id);
|
||||
if (ce && ce.status !== "ACTIVE") return false;
|
||||
if (transitionInactive(el, fromPhase)) return false;
|
||||
const retire = isRetirementTransition(el, fromPhase, toPhase);
|
||||
return !isTransitionAnswered(el.category, retire, el.transitionValues[fromPhase.id] ?? {});
|
||||
}
|
||||
@@ -359,8 +371,7 @@ export function PlanView({
|
||||
</td>
|
||||
);
|
||||
}
|
||||
const ceT = computedElement(col.fromPhase.id, el.id);
|
||||
const locked = !!ceT && ceT.status !== "ACTIVE"; // verkauft/getilgt
|
||||
const locked = TRANSITION_CATEGORIES.includes(el.category) && transitionInactive(el, col.fromPhase);
|
||||
const canTransition = TRANSITION_CATEGORIES.includes(el.category) && !locked;
|
||||
const open = canTransition && transitionUnanswered(el, col.fromPhase, col.toPhase);
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user