Skip to content

[Bug][SubscriptionBilling]: "Qty. to Invoice" incorrectly set to non-zero value for subscription items after partial shipment, causing posting error #6319

@miljance

Description

@miljance

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 Invoice should 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

  1. Create a sales order with a subscription item and set quantity to 2
  2. Post (Ship only) one piece of the subscription item
  3. Verify that Qty. to Invoice is incorrectly set to 1 (should be 0)
  4. Attempt to post (Ship + Invoice) the second piece
  5. 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

Metadata

Metadata

Labels

ApprovedThe issue is approvedFinanceGitHub request for Finance area

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions