microsoft / microsoft/BCApps

[Bug][SubscriptionBilling] Incorrect deferral amount sign for negative lines in contract invoices and credit memos

Open
#8,599 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Approved Team: Finance
Dominant language
AL
Stars
683
Forks
459
Avg merge
3d 26m
Merged PRs (30d)
633

Description

Describe the issue

When a contract (subscription) invoice or auto-generated credit memo contains a negative line — the posted contract deferrals are calculated with the wrong sign.

Given an invoice such as:

Line Quantity Line Amount
1 1 100
2 -1 -20

Posting produces two deferral lines that are both negative, whereas the negative line (line 2) should yield a positive deferral amount. The same defect appears when releasing the contract deferrals: the resulting G/L entries carry the wrong sign. It also reproduces in automatically created credit memos when the positive amount is smaller than the negative amount.

Expected behavior

Deferral lines should follow the sign of each individual line: a negative invoice line should produce a positive (offsetting) deferral, and releasing the deferrals should post G/L entries with the correct sign. Both the customer (sales) and vendor (purchase) sides should behave consistently. It should not be possible to extend a contract with a negative quantity.

Steps to reproduce
  1. Create an item set up for subscription.
  2. Create a customer subscription contract.
  3. Extend the contract with the item.
  4. Extend the contract again with the same item, using a negative quantity for this second line (e.g. -1).
  5. Change the Calculation Base Amount to a value lower than the amount in the first line.
  6. Create a contract invoice and post it.
  7. Check the customer deferral entries → both entries are negative (the second line should be positive).
Additional context

No response

I will provide a fix for a bug
  • I will provide a fix for a bug

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue using the subscription contract steps, including a negative quantity and a calculation base below the first line amount. Inspect the contract invoice and automatically created credit memo deferral entries, then release the deferrals and verify that negative lines produce positive offsetting amounts and correct G/L signs for both customer and vendor flows.

Written by the indexing model from the issue text.

Assessment

Domain
payments
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.