This is an automated email from the ASF dual-hosted git repository.
golja pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
The following commit(s) were added to refs/heads/trunk by this push:
new fc5bfb6a24 Fixed: Correct receivedQuantity calculation in
updatePurchaseShipmentFromReceipt by including quantityRejected
fc5bfb6a24 is described below
commit fc5bfb6a2438977c7634e54633555d5379f43ede
Author: Anahita Goljahani <[email protected]>
AuthorDate: Mon May 25 10:17:20 2026 +0200
Fixed: Correct receivedQuantity calculation in
updatePurchaseShipmentFromReceipt by including quantityRejected
---
.../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);