Author: paulfoxworthy
Date: Tue Jan 15 14:03:35 2019
New Revision: 1851357
URL:
http://svn.apache.org/viewvc?rev=1851357&view=revLog:
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 bug in r1850914 when a single reservation's quantity exactly matches
the quantity to pack.
Modified:
ofbiz/branches/release16.11/applications/product/src/main/java/org/apache/ofbiz/shipment/packing/PackingSession.java
Modified: ofbiz/branches/release16.11/applications/product/src/main/java/org/apache/ofbiz/shipment/packing/PackingSession.java
URL:
http://svn.apache.org/viewvc/ofbiz/branches/release16.11/applications/product/src/main/java/org/apache/ofbiz/shipment/packing/PackingSession.java?rev=1851357&r1=1851356&r2=1851357&view=diff==============================================================================
--- ofbiz/branches/release16.11/applications/product/src/main/java/org/apache/ofbiz/shipment/packing/PackingSession.java (original)
+++ ofbiz/branches/release16.11/applications/product/src/main/java/org/apache/ofbiz/shipment/packing/PackingSession.java Tue Jan 15 14:03:35 2019
@@ -145,7 +145,8 @@ public class PackingSession implements j
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);
}