[Subscription Billing] Fix deferral creation, release, and credit memo handling#6636
Open
miljance wants to merge 6 commits intomicrosoft:mainfrom
Open
[Subscription Billing] Fix deferral creation, release, and credit memo handling#6636miljance wants to merge 6 commits intomicrosoft:mainfrom
miljance wants to merge 6 commits intomicrosoft:mainfrom
Conversation
vkozlov-sit
suggested changes
Feb 12, 2026
vkozlov-sit
left a comment
There was a problem hiding this comment.
Hi Miljan, please check the comments, rather optimization related remarks.
src/Apps/W1/Subscription Billing/App/Base/Codeunits/UpgradeSubscriptionBilling.Codeunit.al
Show resolved
Hide resolved
src/Apps/W1/Subscription Billing/App/Billing/Codeunits/PurchaseDocuments.Codeunit.al
Outdated
Show resolved
Hide resolved
src/Apps/W1/Subscription Billing/App/Deferrals/Codeunits/CustomerDeferralsMngmt.Codeunit.al
Outdated
Show resolved
Hide resolved
src/Apps/W1/Subscription Billing/Test/Deferrals/CustomerDeferralsTest.Codeunit.al
Outdated
Show resolved
Hide resolved
src/Apps/W1/Subscription Billing/Test/Deferrals/VendorDeferralsTest.Codeunit.al
Outdated
Show resolved
Hide resolved
src/Apps/W1/Subscription Billing/Test/Deferrals/VendorDeferralsTest.Codeunit.al
Outdated
Show resolved
Hide resolved
src/Apps/W1/Subscription Billing/Test/Deferrals/VendorDeferralsTest.Codeunit.al
Outdated
Show resolved
Hide resolved
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 pull request introduces a new data upgrade step to populate posting group fields in contract deferral records, along with some code clean-up and improvements/fixes across related modules.
Extensibility: Five core deferral objects need integration points (events) for ISV extensions to customize behavior during deferral creation and release processes.
Missing Posting Groups in Deferrals: Contract deferrals cannot be released when the original posted documents are unavailable (e.g., in data migration scenarios), because posting group information is retrieved from posted invoice/credit memo lines instead of being stored in the deferral entries.
Zero-Amount Deferrals: The system creates unnecessary deferral entries and G/L postings for contract lines with 0.00 amounts, leading to excessive ledger entries with no financial impact.
Inconsistent Partial Period Handling: Vendor contract deferrals handle partial billing periods inconsistently—some invoices are deferred based on full months while others are calculated daily, causing incorrect revenue recognition.
Credit Memo Deferral Gap: Credit memos with amounts exceeding the original invoice amount do not generate corresponding deferral entries, resulting in incomplete revenue recognition.
Double Deferral Generation: When both contract-based deferrals and standard deferral codes are used, deferrals are incorrectly created in both systems simultaneously.
Work Item(s)
Fixes #6281