From e362efdfd94a5cae30ac79fcda84fd70ff6278a8 Mon Sep 17 00:00:00 2001 From: Jacques Le Roux Date: Tue, 15 Jan 2019 14:14:14 +0000 Subject: [PATCH] "Applied fix from trunk for revision: 1851353" ------------------------------------------------------------------------ r1851353 | paulfoxworthy | 2019-01-15 14:53:51 +0100 (mar. 15 janv. 2019) | 11 lignes Fixed: In packing, only use reservations with stock on hand (OFBIZ-9677) During packing, OFBiz looks for reservations (OrderItemShipGrpInvRes) for the order item. Some reservations are for back ordered items not on hand. These reservations should not be used during packing, but they are. Fixed additional problem in r1850914 when a single reservation has a quantity that exactly matches the quantity to pack. ------------------------------------------------------------------------ git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release18.12@1851361 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/ofbiz/shipment/packing/PackingSession.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/applications/product/src/main/java/org/apache/ofbiz/shipment/packing/PackingSession.java b/applications/product/src/main/java/org/apache/ofbiz/shipment/packing/PackingSession.java index 8aad1b8c32..359212be0c 100644 --- a/applications/product/src/main/java/org/apache/ofbiz/shipment/packing/PackingSession.java +++ b/applications/product/src/main/java/org/apache/ofbiz/shipment/packing/PackingSession.java @@ -146,7 +146,8 @@ public class PackingSession implements java.io.Serializable { GenericValue res = EntityUtil.getFirst(reservations); BigDecimal resQty = numAvailableItems(res); - if (resQty.compareTo(quantity) > 0) { + // If reservation has enough for the quantity required + if (resQty.compareTo(quantity) >= 0) { int checkCode = this.checkLineForAdd(res, orderId, orderItemSeqId, shipGroupSeqId, productId, quantity, packageSeqId, update); this.createPackLineItem(checkCode, res, orderId, orderItemSeqId, shipGroupSeqId, productId, quantity, weight, packageSeqId); }