From 56f8140af53642d8a4f72d377daa14b201898c8a Mon Sep 17 00:00:00 2001 From: kelle Date: Tue, 14 Jul 2026 08:24:43 +0200 Subject: [PATCH] =?UTF-8?q?Uebergang:=20PK/3a=20nach=20der=20Pensionierung?= =?UTF-8?q?=20inaktiv=20("=E2=80=93")?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/components/PlanView.tsx | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/components/PlanView.tsx b/src/components/PlanView.tsx index 37c5324..3ca9e8f 100644 --- a/src/components/PlanView.tsx +++ b/src/components/PlanView.tsx @@ -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({ ); } - 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 (