You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "Anahita Goljahani (Jira)" <ji...@apache.org> on 2026/03/14 18:20:00 UTC
[jira] [Created] (OFBIZ-13373) Error when forcing PO completion if receipt contains rejected units
Anahita Goljahani created OFBIZ-13373:
-----------------------------------------
Summary: Error when forcing PO completion if receipt contains rejected units
Key: OFBIZ-13373
URL: https://issues.apache.org/jira/browse/OFBIZ-13373
Project: OFBiz
Issue Type: Bug
Components: order
Affects Versions: Upcoming Branch
Reporter: Anahita Goljahani
Attachments: 1_Receive_annotated.png, 2_Receive_Selected_Shipment_annotated.png, 3_Receive_Selected_product(s)_annotated.png, 4_Receipt(s)_For_Purchase_Order_annotated.png, 5_Force_Complete_Purchase_Order_annotated.png, 6_Error_cannot_cancel_annotated.png
When a PO receipt contains rejected units, clicking the *“Force Complete Purchase Order”* button in the Order Details screen generates an error because the {{cancelRemainingPurchaseOrderItems}} service does not take rejected items into account when computing the units to cancel.
The issue can be reproduced as follows.
Create a PO for, e.g., 10 units of WG-1111 and approve it.
In the ‘Actions’ sections of the order details screen, click the ‘Receive’ button.
Select the automatically created shipment and click ‘Receive Selected Shipment’.
Receive 8 units of WG-1111, reject 1 and click ‘Receive Selected Product(s)’.
Go back to the order details screen, e.g., by clicking the PO id in the ‘Receipt(s) For Purchase Order …’ recap section.
Click ‘Force Complete Purchase Order’ in the ‘Actions’ section of the Order details screen.
An error is generated because of an invalid cancel quantity computation in the 'cancelRemainingPurchaseOrderItems' service.
The problem is that, currently, the service only accounts for accepted quantities, 8 in our example, and doesn’t take into account rejected units, 1 in our example. Hence, the service tries to cancel 2 units ( = 10 – 8) from the 10 units ordered, but an error is generated because there is only 1 unit ( = 10 – 8 – 1) available to cancel.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)