[Bug][SubscriptionBilling]: Subscription line end date incorrectly set when subsequent term is defined on the subscription package#8513
Merged
djukicmilica merged 1 commit intoJun 8, 2026
Conversation
… Term is used When a Subscription Line has a Subsequent Term (Extension Term) defined, the contract auto-renews indefinitely, so no fixed End Date should be stored. - CalculateServiceEndDate: exit early when Extension Term is set - CalculateTermUntilDate: when End Date is 0D and Extension Term is set, derive Term Until from Initial Term (or Notice Period as fallback) instead of falling through to the Notice Period path unconditionally; mirrors the logic already encoded in the GetTermUntilDate/GetCancellationPossibleUntilDate test helpers - Update CheckClearTerminationPeriods: End Date is intentionally 0D when Subsequent Term is defined - Update VerifySubscriptionLineDates: expect End Date = 0D when Extension Term is set on the Subscription Line - Add CheckSubscriptionLineEndDateNotSetWhenSubsequentTermIsUsed (unit test on CalculateServiceEndDate) and the corresponding integration test via sales order posting in SalesServiceCommitmentTest Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
djukicmilica
approved these changes
Jun 8, 2026
AndersLarsenMicrosoft
approved these changes
Jun 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
When a Subscription Line has a Subsequent Term (Extension Term) defined, the contract auto-renews indefinitely, so no fixed End Date should be stored.
Linked work
Fixes #8428
How I validated this
What I tested and the outcome (required ΓÇö be specific: scenarios, commands, screenshots for UI changes)
Risk & compatibility
Low risk. The change affects two internal procedures (CalculateServiceEndDate, CalculateTermUntilDate) that are not part of the public API surface.
Existing data: Subscription Lines already in the database are not affected ΓÇö the fix only applies at creation/calculation time. Lines that were created before this fix with an incorrect End Date will keep that value until manually cleared or recalculated via "Update Subscription Line Dates".
Behavior change: For Subscription Lines with both an Initial Term and a Subsequent Term:
End Date is no longer auto-populated (was Start + Initial Term − 1D, now blank). This is the intended correction.
Term Until and Cancellation Possible Until continue to be calculated correctly from the Initial Term, so invoicing and cancellation logic is unaffected.
No behavior change for Subscription Lines without a Subsequent Term ΓÇö CalculateServiceEndDate and CalculateTermUntilDate follow the same paths as before.
Fixes AB#637991