svn commit: r703725 - /ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/PackingSlip.groovy

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

svn commit: r703725 - /ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/PackingSlip.groovy

jleroux@apache.org
Author: jleroux
Date: Sat Oct 11 13:24:31 2008
New Revision: 703725

URL: http://svn.apache.org/viewvc?rev=703725&view=rev
Log:
Fix "Packing Slip for Mktng pack pick assembly: the qty shown "In this Shipment" and "Total Shipped" is the sum of the components instead of the product ordered." (https://issues.apache.org/jira/browse/OFBIZ-1411) - OFBIZ-1411

Modified:
    ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/PackingSlip.groovy

Modified: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/PackingSlip.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/PackingSlip.groovy?rev=703725&r1=703724&r2=703725&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/PackingSlip.groovy (original)
+++ ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/PackingSlip.groovy Sat Oct 11 13:24:31 2008
@@ -104,13 +104,23 @@
     contents.each { content ->
         shipmentItem = content.getRelatedOne("ShipmentItem");
         product = shipmentItem.getRelatedOne("Product");
+        productTypeId = product.get("productTypeId");
 
         line = [:];
         line.product = product;
+        line.quantityRequested = quantityRequestedByProduct.get(product.productId);
         line.quantityInPackage = content.quantity;
+        if (productTypeId.equals("MARKETING_PKG_PICK") && line.quantityInPackage > line.quantityRequested) {
+            line.quantityInPackage = line.quantityRequested;
+        }
         line.quantityInShipment = quantityInShipmentByProduct.get(product.productId);
+        if (productTypeId.equals("MARKETING_PKG_PICK") && line.quantityInShipment > line.quantityRequested) {
+            line.quantityInShipment = line.quantityRequested;
+        }
         line.quantityShipped = quantityShippedByProduct.get(product.productId);
-        line.quantityRequested = quantityRequestedByProduct.get(product.productId);
+        if (productTypeId.equals("MARKETING_PKG_PICK") && line.quantityShipped > line.quantityRequested) {
+            line.quantityShipped = line.quantityRequested;
+        }
         lines.add(line);
     }
     packages.add(lines);