svn commit: r1851353 - /ofbiz/ofbiz-framework/trunk/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: r1851353 - /ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/packing/PackingSession.java

paulfoxworthy
Author: paulfoxworthy
Date: Tue Jan 15 13:53:51 2019
New Revision: 1851353

URL: http://svn.apache.org/viewvc?rev=1851353&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 additional problem in r1850914 when a single reservation has a
quantity that exactly matches the quantity to pack.


Modified:
    ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/packing/PackingSession.java

Modified: ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/packing/PackingSession.java
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/packing/PackingSession.java?rev=1851353&r1=1851352&r2=1851353&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/packing/PackingSession.java (original)
+++ ofbiz/ofbiz-framework/trunk/applications/product/src/main/java/org/apache/ofbiz/shipment/packing/PackingSession.java Tue Jan 15 13:53:51 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);
             }