svn commit: r1851359 - /ofbiz/ofbiz-framework/branches/release17.12/applications/product/src/main/java/org/apache/ofbiz/shipment/packing/PackingSession.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1851359 - /ofbiz/ofbiz-framework/branches/release17.12/applications/product/src/main/java/org/apache/ofbiz/shipment/packing/PackingSession.java

paulfoxworthy
Author: paulfoxworthy
Date: Tue Jan 15 14:09:16 2019
New Revision: 1851359

URL: http://svn.apache.org/viewvc?rev=1851359&view=rev
Log:
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/ofbiz-framework/branches/release17.12/applications/product/src/main/java/org/apache/ofbiz/shipment/packing/PackingSession.java

Modified: ofbiz/ofbiz-framework/branches/release17.12/applications/product/src/main/java/org/apache/ofbiz/shipment/packing/PackingSession.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/branches/release17.12/applications/product/src/main/java/org/apache/ofbiz/shipment/packing/PackingSession.java?rev=1851359&r1=1851358&r2=1851359&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/branches/release17.12/applications/product/src/main/java/org/apache/ofbiz/shipment/packing/PackingSession.java (original)
+++ ofbiz/ofbiz-framework/branches/release17.12/applications/product/src/main/java/org/apache/ofbiz/shipment/packing/PackingSession.java Tue Jan 15 14:09:16 2019
@@ -146,7 +146,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);
             }