You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by go...@apache.org on 2026/05/27 07:47:05 UTC

(ofbiz-framework) branch release24.09 updated: Fixed: Correct receivedQuantity calculation in updatePurchaseShipmentFromReceipt by including quantityRejected

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

golja 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 add97930a7 Fixed: Correct receivedQuantity calculation in updatePurchaseShipmentFromReceipt by including quantityRejected
add97930a7 is described below

commit add97930a72beb825a0094fdbcea918c7bd9e4c8
Author: Anahita Goljahani <an...@gmail.com>
AuthorDate: Mon May 25 10:17:20 2026 +0200

    Fixed: Correct receivedQuantity calculation in updatePurchaseShipmentFromReceipt by including quantityRejected
    
    (cherry picked from commit fc5bfb6a2438977c7634e54633555d5379f43ede)
---
 .../main/java/org/apache/ofbiz/shipment/shipment/ShipmentServices.java  | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/applications/product/src/main/java/org/apache/ofbiz/shipment/shipment/ShipmentServices.java b/applications/product/src/main/java/org/apache/ofbiz/shipment/shipment/ShipmentServices.java
index c5c0174c60..0d01e58327 100644
--- a/applications/product/src/main/java/org/apache/ofbiz/shipment/shipment/ShipmentServices.java
+++ b/applications/product/src/main/java/org/apache/ofbiz/shipment/shipment/ShipmentServices.java
@@ -761,6 +761,8 @@ public class ShipmentServices {
             Map<String, BigDecimal> receivedCountMap = new HashMap<>();
             for (GenericValue item: shipmentReceipts) {
                 BigDecimal receivedQuantity = item.getBigDecimal("quantityAccepted");
+                BigDecimal rejectedQuantity = item.getBigDecimal("quantityRejected");
+                receivedQuantity = rejectedQuantity == null ? receivedQuantity : receivedQuantity.add(rejectedQuantity);
                 BigDecimal quantity = receivedCountMap.get(item.getString("productId"));
                 quantity = quantity == null ? receivedQuantity : receivedQuantity.add(quantity);
                 receivedCountMap.put(item.getString("productId"), quantity);