Author: lektran
Date: Sat Jun 23 16:19:27 2007
New Revision: 550138

URL: http://svn.apache.org/viewvc?view=rev&rev=550138
Log:
Fix bug where a reservation is over allocated if it is spread across more than 
one PackingLine

Modified:
    
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingSession.java

Modified: 
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingSession.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingSession.java?view=diff&rev=550138&r1=550137&r2=550138
==============================================================================
--- 
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingSession.java
 (original)
+++ 
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingSession.java
 Sat Jun 23 16:19:27 2007
@@ -150,9 +150,11 @@
                 }
 
                 double resQty = res.getDouble("quantity").doubleValue();
-                PackingSessionLine line = this.findLine(orderId, 
orderItemSeqId, shipGroupSeqId, productId, res.getString("inventoryItemId"), 
packageSeqId);
-                if (UtilValidate.isNotEmpty(line) && !update) {
-                    resQty -= line.getQuantity();
+                double resPackedQty = this.getPackedQuantity(orderId, 
orderItemSeqId, shipGroupSeqId, productId, res.getString("inventoryItemId"), 
-1);
+                if (resPackedQty >= resQty) {
+                    continue;
+                } else if (!update) {
+                    resQty -= resPackedQty;
                 }
                 
                 double thisQty = resQty > qtyRemain ? qtyRemain : resQty;


Reply via email to