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
- Create an item set up for subscription.
- Create a customer subscription contract.
- Extend the contract with the item.
- Extend the contract again with the same item, using a negative quantity for this second line (e.g.
-1).
- Change the Calculation Base Amount to a value lower than the amount in the first line.
- Create a contract invoice and post it.
- 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
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:
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).Additional context
No response
I will provide a fix for a bug