[Subscription Billing]Calculating initial dates correctly#6352
Merged
djukicmilica merged 4 commits intomicrosoft:mainfrom Feb 10, 2026
Merged
[Subscription Billing]Calculating initial dates correctly#6352djukicmilica merged 4 commits intomicrosoft:mainfrom
djukicmilica merged 4 commits intomicrosoft:mainfrom
Conversation
sit-zm
suggested changes
Feb 3, 2026
sit-zm
left a comment
There was a problem hiding this comment.
Hi Miljan,
Please review my comments and decide whether some changes are required.
src/Apps/W1/Subscription Billing/App/Service Commitments/Tables/SubscriptionLine.Table.al
Outdated
Show resolved
Hide resolved
src/Apps/W1/Subscription Billing/App/Service Commitments/Tables/SubscriptionLine.Table.al
Outdated
Show resolved
Hide resolved
src/Apps/W1/Subscription Billing/Test/Service Objects/ServiceObjectTest.Codeunit.al
Outdated
Show resolved
Hide resolved
src/Apps/W1/Subscription Billing/App/Service Objects/Tables/SubscriptionHeader.Table.al
Outdated
Show resolved
Hide resolved
sit-zm
approved these changes
Feb 3, 2026
djukicmilica
approved these changes
Feb 9, 2026
AndersLarsenMicrosoft
approved these changes
Feb 9, 2026
djukicmilica
pushed a commit
that referenced
this pull request
Feb 12, 2026
…6639) <!-- Thank you for submitting a Pull Request. If you're new to contributing to BCApps please read our pull request guideline below * https://github.com/microsoft/BCApps/Contributing.md --> #### Summary <!-- Provide a general summary of your changes --> This is a backport of the PR #6352 #### Work Item(s) <!-- Add the issue number here after the #. The issue needs to be open and approved. Submitting PRs with no linked issues or unapproved issues is highly discouraged. --> Fixes #6132 [AB#618064](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/618064)
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.
Summary
This PR addresses two reported issues in Subscription Billing related to incorrect or missing updates of subscription line dates (
Subscription Line End Date/Service End Date,Term Until, andCancellation Possible Until).Fixed Issues
Initial subscription dates not calculated correctly when Subsequent/Extension Term is defined
When posting Ship and Invoice from a Sales Order containing a Subscription Item with both Initial Term and Subsequent Term filled, the
Subscription Line Start Dateupdated correctly, butService End DateandTerm Untilremained empty.The root cause was logic that skipped initial end-date calculations when a Subsequent/Extension Term existed.
Changes introduce a new internal procedure
CalculateInitialSubscriptionDates()in Subscription Line that always calculates bothService End Date(viaCalculateInitialServiceEndDate()) andTerm Until(viaCalculateInitialTermUntilDate()). Calls in Sales Documents, Create Subscription Line, Post Sub. Contract Renewal, and Subscription Header now use this consolidated procedure, ensuring initial dates are set correctly regardless of Subsequent/Extension Term presence.Cancellation Possible Until and Term Until not recalculated when Service Start Date is modified
On non-invoiced subscription lines (e.g., after "Extend Contract" or manual edit), changing
Service Start Datedid not automatically updateCancellation Possible UntilorTerm Until. The "Update Subscription Line Dates" action also failed to update these fields.The refactor ensures consistent date recalculation:
CalculateInitialTermUntilDate()now prioritizes existingSubscription Line End Datewhen set and always updatesCancellation Possible UntilviaUpdateCancellationPossibleUntil().Additional Improvements
Extension Termtooltip across multiple pages (e.g., Service Commitments, Planned Service Commitments, Customer Contract Lines) by removing outdated references to conditional end-date setting, reflecting the new always-calculate-initial behavior.Renewal Termto Sub. Contr. Analysis Entry for better data consistency in contract analysis.These changes improve reliability of automatic date calculations, reduce manual corrections, and align behavior with expected subscription lifecycle rules without affecting existing renewal logic for subsequent periods.
Technical code review from @samra-singhammer or @sit-zm required prior to approval by Microsoft.
Work Item(s)
Fixes #6132
AB#620493