Skip to content

Commit ecf3b83

Browse files
authored
Fixed:Include handling for rejected quantities in cancelRemaingPurchaseOrderItems service (OFBIZ-13373) (#985)
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 ignores rejected items. Please refer to [OFBIZ-13373](https://issues.apache.org/jira/browse/OFBIZ-13373) for further details. The changes in this PR fix the issue in the cancelRemainingPurchaseOrderItems service.
1 parent e0823de commit ecf3b83

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5490,6 +5490,9 @@ public static Map<String, Object> cancelRemainingPurchaseOrderItems(DispatchCont
54905490
if (!UtilValidate.isEmpty(shipmentReceipt.get("quantityAccepted"))) {
54915491
receivedQuantity = receivedQuantity.add(shipmentReceipt.getBigDecimal("quantityAccepted"));
54925492
}
5493+
if (!UtilValidate.isEmpty(shipmentReceipt.get("quantityRejected"))) {
5494+
receivedQuantity = receivedQuantity.add(shipmentReceipt.getBigDecimal("quantityRejected"));
5495+
}
54935496
}
54945497

54955498
BigDecimal quantityToCancel = orderItemQuantity.subtract(orderItemCancelQuantity).subtract(receivedQuantity);

0 commit comments

Comments
 (0)