Skip to content

[Bug][SubscriptionBilling] Contract lines of type G/L Account never post to the selected G/L account (backport to releases/28.x) - #10091

Open
Miljan Milosavljević (miljance) wants to merge 1 commit into
microsoft:releases/28.xfrom
miljance:SBGLAccountContractLinePostingFor28.x
Open

[Bug][SubscriptionBilling] Contract lines of type G/L Account never post to the selected G/L account (backport to releases/28.x)#10091
Miljan Milosavljević (miljance) wants to merge 1 commit into
microsoft:releases/28.xfrom
miljance:SBGLAccountContractLinePostingFor28.x

Conversation

@miljance

@miljance Miljan Milosavljević (miljance) commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

What & why

  • This is a backport of PR for 29: to 28.x [Bug][SubscriptionBilling] Contract lines of type G/L Account never post to the selected G/L account #9905
  • post G/L Account contract lines to their own account. Subscription Billing contract lines of type "G/L Account" always posted to the Customer/Vendor Subscription Contract Account from the General Posting Setup, ignoring the account actually selected on the contract line.
  • Without deferrals, CustomerDeferralsMngmt/VendorDeferralsMngmt now skip the General Posting Setup account lookup for "G/L Account" lines so the invoice posts directly to the line's account.
  • With deferrals, a new "G/L Account No." field (27) on Cust./Vend. Sub. Contract Deferral carries the account from the sales/purchase line, and is surfaced on the Customer/Vendor Contract Deferrals pages.
  • ContractDeferralsRelease now posts to that account when releasing the deferral, falling back to the General Posting Setup account when it is blank, and only requires the General Posting Setup account to be filled when no contract-line account is available.
  • Added TDD tests to CustomerDeferralsTest and VendorDeferralsTest covering both the immediate-posting and deferral-release paths, with a shared fixture in ContractTestLibrary.

Linked work

Fixes #9885

How I validated this

  • I read the full diff and it contains only changes I intended.
  • I built the affected app(s) locally with no new analyzer warnings.
  • I ran the change in Business Central and confirmed it behaves as expected.
  • I added or updated tests for the new behavior, or explained below why none are needed.

What I tested and the outcome

  • This backport is a clean cherry-pick of the commit from [Bug][SubscriptionBilling] Contract lines of type G/L Account never post to the selected G/L account #9905 onto releases/28.x — the diff is identical to the original PR's diff, with no conflicts and no context drift.
  • The change itself (including the new tests in CustomerDeferralsTest and VendorDeferralsTest) was built, run, and validated on main as part of the original PR: posted contract invoices for G/L Account contract lines with and without deferrals and confirmed the line's G/L account is used for posting and for deferral release.
  • The backport itself was not built or test-run against a 28.x environment.

Risk & compatibility

  • Intentional behavior change: contract lines of type "G/L Account" without
    deferrals now post to the G/L account selected on the line instead of the
    Cust./Vend. Subscription Contract Account from General Posting Setup. Anyone
    who relied on the old (incorrect) routing will see revenue/cost on different
    accounts going forward.
  • Schema: purely additive — new field 27 "G/L Account No." on the
    Cust./Vend. Sub. Contract Deferral tables. No breaking changes, no upgrade
    code needed: the field is blank on pre-existing deferral rows, and release
    falls back to the General Posting Setup account, so existing deferrals
    release exactly as before.
  • Relaxed validation: Contract Deferrals Release no longer requires the
    General Posting Setup contract account when the deferral carries its own
    account — setups with a blank GPS account now succeed where they previously
    errored (intended).
  • Credit memos: reversal copies the deferral record, so the new field is
    propagated automatically.
  • Test library: ContractTestLibrary got a new overload; the existing
    CreateServiceObjectForGLAccountWithServiceCommitments signature is unchanged.
  • No permissions, telemetry, or feature-flag impact. No follow-up work planned.
  • The cherry-pick onto releases/28.x applied cleanly with no conflict resolution.

🤖 Generated with Claude Code

Subscription Billing contract lines of type "G/L Account" always
posted to the Customer/Vendor Subscription Contract Account from the
General Posting Setup, ignoring the account actually selected on the
contract line.

- Without deferrals, CustomerDeferralsMngmt/VendorDeferralsMngmt now
  skip the General Posting Setup account lookup for "G/L Account"
  lines so the invoice posts directly to the line's account.
- With deferrals, a new "G/L Account No." field (27) on
  Cust./Vend. Sub. Contract Deferral carries the account from the
  sales/purchase line, and is surfaced on the Customer/Vendor
  Contract Deferrals pages.
- ContractDeferralsRelease now posts to that account when releasing
  the deferral, falling back to the General Posting Setup account
  when it is blank, and only requires the General Posting Setup
  account to be filled when no contract-line account is available.
- Added TDD tests to CustomerDeferralsTest and VendorDeferralsTest
  covering both the immediate-posting and deferral-release paths,
  with a shared fixture in ContractTestLibrary.

Fixes microsoft#9885

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions github-actions Bot added AL: Apps (W1) Add-on apps for W1 From Fork Pull request is coming from a fork Finance GitHub request for Finance area needs-approval Workflow runs require maintainer approval to start labels Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AL: Apps (W1) Add-on apps for W1 Finance GitHub request for Finance area From Fork Pull request is coming from a fork needs-approval Workflow runs require maintainer approval to start

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant