-
Notifications
You must be signed in to change notification settings - Fork 318
Description
Describe the issue
When posting a sales order with a subscription item in partial shipments, an error occurs during the final post operation (Ship + Invoice). The root cause is that Qty. to Invoice is being set to a non-zero value after the first shipment, which should never happen for subscription items.
After shipping the first piece of a subscription item with quantity 2, the Qty. to Invoice field is incorrectly set to 1 (matching Qty. to Ship). When attempting to post the second piece with Ship + Invoice, the system attempts to create invoice entries for the subscription item, which results in the following error:
Document No. must have a value in Gen. Journal Line: Journal Template Name=, Journal Batch Name=, Line No.=0. It cannot be zero or empty.
Expected behavior
Subscription items should never be invoiced through sales orders - they are invoiced exclusively through contracts. The Qty. to Invoice field must remain 0 at all times for subscription items to prevent the system from attempting to create invoice-related ledger entries.
Qty. to Invoiceshould always be 0 for subscription items, even after partial shipments- Posting the final piece with Ship + Invoice should complete successfully without errors
Steps to reproduce
- Create a sales order with a subscription item and set quantity to 2
- Post (Ship only) one piece of the subscription item
- Verify that
Qty. to Invoiceis incorrectly set to 1 (should be 0) - Attempt to post (Ship + Invoice) the second piece
- Observe the error: "Document No. must have a value in Gen. Journal Line..."
Additional context
No response
I will provide a fix for a bug
- I will provide a fix for a bug