-
Notifications
You must be signed in to change notification settings - Fork 318
Description
Describe the issue
This issue addresses multiple critical bugs and extensibility gaps in the Microsoft Subscription Billing deferrals functionality. The current implementation has the following issues:
-
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.
Expected behavior
Extensibility Enhancements
Objects requiring extensibility events:
- Report 8051 "Contract Deferrals Release"
- Table 8066 "Cust. Sub. Contract Deferral"
- Table 8072 "Vend. Sub. Contract Deferral"
- Report 8052 "Cust. Contr. Def. Analysis"
- Report 8053 "Vend Contr. Def. Analysis"
Required events:
- OnBeforeInsertGenJournalLine event in ReleaseContractDeferral/related functions to allow ISVs to skip journal line insertion based on custom logic
- OnAfterInitFromSalesLine event in InitFromSalesLine procedure
- OnAfterInitFromPurchaseLine event in InitFromPurchaseLine procedure
Bug Fixes Expected Behavior
Task 2 - Posting Groups Storage:
- Add "Gen. Bus. Posting Group" and "Gen. Prod. Posting Group" fields to both deferral tables
- Populate these fields during deferral entry creation from the invoice line
- Modify release logic to use stored posting groups instead of retrieving from posted documents
- Implement data upgrade to retrospectively fill posting groups from existing document lines
Task 3 - Zero-Amount Prevention:
- Skip deferral entry creation when the deferral amount equals 0.00
- Prevent G/L postings for zero-amount deferrals during release
- Reduce unnecessary ledger entries significantly in contracts with multiple zero-amount lines
Task 4 - Consistent Partial Period Calculation:
- Apply consistent day-based calculation for all partial billing periods in vendor contracts
- Ensure both the first and last month of multi-month periods are calculated proportionally based on actual days
- Monthly amounts should match deferral amounts when billing covers full calendar months
Task 5 - Credit Memo Deferral Handling:
- Generate negative deferral entries for all credit memos, regardless of amount
- Ensure credit memos that exceed original invoice amounts create corresponding deferral adjustments
- Maintain complete and accurate deferral schedules reflecting all revenue adjustments
Task 6 - Prevent Double Deferrals:
- Block "Deferral Code" field on Sales Line and Purchase Line when contract deferrals are enabled
- Field should only be editable when:
- Contract line has "Create Contract Deferrals" = No, OR
- Contract line has "Create Contract Deferrals" = Contract-dependent AND contract header has "Create Contract Deferrals" = No
Steps to reproduce
Task 2 - Missing Posting Groups
- Import contract deferral data from legacy system (without corresponding posted documents)
- Navigate to Contract Deferrals Release (Report 8051)
- Set posting date and post-until date
- Execute release process
- Result: Error occurs because system cannot retrieve posting groups from non-existent posted invoice lines
Task 3 - Zero-Amount Deferrals
- Create a Customer Subscription Contract with 11 lines:
- 1 line with monthly amount (e.g., €100)
- 10 lines with 0.00 amount (asset subscriptions)
- Enable "Contract Deferrals" = Yes
- Create and post contract invoice
- Execute Contract Deferral Release
- Result:
- 11 contract deferrals created (11 × 12 = 132 entries for a year)
- 22 G/L entries generated (2 with value, 20 with 0.00)
Task 4 - Partial Period Inconsistency
- Create vendor subscription contract with annual billing
- Post purchase invoice 1 with period 01.05.2025 - 15.06.2025
- Post purchase invoice 2 with period 16.06.2025 - 31.07.2025
- Review generated deferrals
- Result:
- Invoice 1: Amount divided equally between May and June (ignores partial June)
- Invoice 2: Amount distributed daily across months (correct partial period handling)
Task 5 - Credit Memo Deferrals
- Create customer subscription contract with deferrals enabled
- Post invoice for €1,000
- Create credit memo for €1,200 (exceeding original invoice)
- Post credit memo
- Review contract deferrals
- Result: Only the €1,000 invoice appears in deferrals; no €1,200 credit memo entry exists
Task 6 - Double Deferrals
- Create Customer Subscription Contract and Subscription
- Assign subscription to contract
- Create contract invoice
- On the invoice line, assign a Deferral Code (standard BC deferrals)
- Post the contract invoice
- Check both:
- Subscription Billing module → Contract Deferrals
- Financial Management → Standard Deferrals
- Result: Deferrals created in BOTH locations, causing double revenue deferral
Additional context
No response
I will provide a fix for a bug
- I will provide a fix for a bug