This is an automated email from the ASF dual-hosted git repository.

jleroux pushed a commit to branch release24.09
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/release24.09 by this push:
     new 2ceca30526 Fixed:Include handling for rejected quantities in 
cancelRemaingPurchaseOrderItems service (OFBIZ-13373) (#985)
2ceca30526 is described below

commit 2ceca305266b8652d3bad310e69c840b63c28f4a
Author: Anahita Goljahani <[email protected]>
AuthorDate: Fri Mar 27 10:48:54 2026 +0100

    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.
---
 .../src/main/java/org/apache/ofbiz/order/order/OrderServices.java      | 3 +++
 1 file changed, 3 insertions(+)

diff --git 
a/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java
 
b/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java
index 3473d03e16..d8ef11f220 100644
--- 
a/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java
+++ 
b/applications/order/src/main/java/org/apache/ofbiz/order/order/OrderServices.java
@@ -5490,6 +5490,9 @@ public class OrderServices {
                     if 
(!UtilValidate.isEmpty(shipmentReceipt.get("quantityAccepted"))) {
                         receivedQuantity = 
receivedQuantity.add(shipmentReceipt.getBigDecimal("quantityAccepted"));
                     }
+                    if 
(!UtilValidate.isEmpty(shipmentReceipt.get("quantityRejected"))) {
+                        receivedQuantity = 
receivedQuantity.add(shipmentReceipt.getBigDecimal("quantityRejected"));
+                    }
                 }
 
                 BigDecimal quantityToCancel = 
orderItemQuantity.subtract(orderItemCancelQuantity).subtract(receivedQuantity);

Reply via email to