Rechtliches: Fristen ohne Monatsende-Drift, Indizes und Warten auf Attribute im Setup
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c8c1d84794
commit
c24b3d43c8
4 files changed
+65
-5
No files matched your search
+4
-2
@@ -64,8 +64,10 @@ export function nextCancellationDate(contract, today) {
|
||||
if (!isSet(contract.noticeValue) || !isSet(contract.noticeUnit)) {
|
||||
return { state: 'incomplete', periodEnd: null, noticeBy: null }
|
||||
}
|
||||
while (noticeDate(periodEnd, contract) < today) {
|
||||
periodEnd = addMonthsClamped(periodEnd, renewal)
|
||||
// Jede Periode vom Beginn aus rechnen: vom schon geklemmten Ende weiterzuzaehlen
|
||||
// wuerde nach einem Februar auf dem 28. haengen bleiben.
|
||||
for (let k = 1; noticeDate(periodEnd, contract) < today; k++) {
|
||||
periodEnd = addMonthsClamped(contract.startDate, term + k * renewal)
|
||||
}
|
||||
return { state: 'active', periodEnd, noticeBy: noticeDate(periodEnd, contract) }
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user