Author: sichen
Date: Tue Feb 20 13:34:42 2007
New Revision: 509763

URL: http://svn.apache.org/viewvc?view=rev&rev=509763
Log:
OFBIZ-734
- Added UI for entering weights in the PackOrder screen as items are packed, 
plus supporting changes to PackingServices and  packBulkItems service definition
- Added supporting methods to PackingSession and PackingSessionLine classes
- Added overloaded getShipmentCostEstimate method to PackingSession
- Used in PackOrder screen to display shipment cost estimates for initial ship 
group and packed items

Modified:
    ofbiz/trunk/applications/product/build.xml
    ofbiz/trunk/applications/product/config/ProductUiLabels.properties
    ofbiz/trunk/applications/product/servicedef/services_shipment.xml
    
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingServices.java
    
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingSession.java
    
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingSessionLine.java
    
ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/PackOrder.bsh
    ofbiz/trunk/applications/product/webapp/facility/shipment/PackOrder.ftl

Modified: ofbiz/trunk/applications/product/build.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/build.xml?view=diff&rev=509763&r1=509762&r2=509763
==============================================================================
--- ofbiz/trunk/applications/product/build.xml (original)
+++ ofbiz/trunk/applications/product/build.xml Tue Feb 20 13:34:42 2007
@@ -53,6 +53,7 @@
             <fileset dir="../../framework/common/build/lib" includes="*.jar"/>
             <fileset dir="../content/lib" includes="*.jar"/>
             <fileset dir="../content/build/lib" includes="*.jar"/>
+            <fileset dir="../order/build/lib" includes="*.jar"/>
             <fileset dir="../party/build/lib" includes="*.jar"/>
         </path>
     </target>

Modified: ofbiz/trunk/applications/product/config/ProductUiLabels.properties
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/config/ProductUiLabels.properties?view=diff&rev=509763&r1=509762&r2=509763
==============================================================================
--- ofbiz/trunk/applications/product/config/ProductUiLabels.properties 
(original)
+++ ofbiz/trunk/applications/product/config/ProductUiLabels.properties Tue Feb 
20 13:34:42 2007
@@ -517,6 +517,8 @@
 ProductEstimatedDates=Estimated Dates
 ProductEstimatedReadyDate=Estimated Ready Date
 ProductEstimatedShipCost=Estimated Ship Cost
+ProductEstimatedShipCostPackages=Estimated Ship Cost for Packages
+ProductEstimatedShipCostForShipGroup=Estimated Ship Cost for Ship Group
 ProductEstimatedShipDate=Estimated Ship Date
 ProductEstimatedShipEvent=Estimated Ship Event
 ProductEstimatedShipWorkEffId=Estimated Ship Work Eff Id
@@ -904,6 +906,7 @@
 ProductPackageQty=Package Qty
 ProductPackages=Packages
 ProductPackedQty=Packed Qty
+ProductPackedWeight=Packed Wt
 ProductPackOrder=Pack Order
 ProductPacking=Packing
 ProductPackingSlip=Packing Slip
@@ -1194,6 +1197,8 @@
 ProductShipmentTotalVolume=Total Volume
 ProductShipmentType=Shipment Type
 ProductShipmentTypeId=Shipment type Id
+ProductShipmentUomAbbreviation_WT_lb=lbs
+ProductShipmentUomAbbreviation_WT_kg=kg
 ProductShipments=Shipments
 ProductShipmentsFound=Shipments Found
 ProductShippingAddress=Shipping Address

Modified: ofbiz/trunk/applications/product/servicedef/services_shipment.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/servicedef/services_shipment.xml?view=diff&rev=509763&r1=509762&r2=509763
==============================================================================
--- ofbiz/trunk/applications/product/servicedef/services_shipment.xml (original)
+++ ofbiz/trunk/applications/product/servicedef/services_shipment.xml Tue Feb 
20 13:34:42 2007
@@ -383,6 +383,7 @@
         <attribute name="qtyInfo" type="Map" string-map-prefix="qty_" 
mode="IN" optional="true"/>
         <attribute name="pkgInfo" type="Map" string-map-prefix="pkg_" 
mode="IN" optional="true"/>
         <attribute name="selInfo" type="Map" string-map-prefix="sel_" 
mode="IN" optional="true"/>
+        <attribute name="wgtInfo" type="Map" string-map-prefix="wgt_" 
mode="IN" optional="true"/>
     </service>
 
     <service name="setNextPackageSeq" engine="java"

Modified: 
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingServices.java?view=diff&rev=509763&r1=509762&r2=509763
==============================================================================
--- 
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingServices.java
 (original)
+++ 
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingServices.java
 Tue Feb 20 13:34:42 2007
@@ -37,6 +37,7 @@
         String orderId = (String) context.get("orderId");
         String productId = (String) context.get("productId");
         Double quantity = (Double) context.get("quantity");
+        Double weight = (Double) context.get("weight");
         Integer packageSeq = (Integer) context.get("packageSeq");
 
         // set the instructions -- will clear out previous if now null
@@ -54,7 +55,7 @@
         Debug.log("Pack input [" + productId + "] @ [" + quantity + "]", 
module);
         
         try {
-            session.addOrIncreaseLine(orderId, null, shipGroupSeqId, 
productId, quantity.doubleValue(), packageSeq.intValue(), false);
+            session.addOrIncreaseLine(orderId, null, shipGroupSeqId, 
productId, quantity.doubleValue(), packageSeq.intValue(), weight.doubleValue(), 
false);
         } catch (GeneralException e) {
             Debug.logError(e, module);
             return ServiceUtil.returnError(e.getMessage());
@@ -84,6 +85,7 @@
         Map prdInfo = (Map) context.get("prdInfo");
         Map qtyInfo = (Map) context.get("qtyInfo");
         Map pkgInfo = (Map) context.get("pkgInfo");
+        Map wgtInfo = (Map) context.get("wgtInfo");
 
         if (selInfo != null) {
             Iterator i = selInfo.keySet().iterator();
@@ -95,15 +97,17 @@
                     prdStr = null;
                 }
 
-                // base package/quantity strings
+                // base package/quantity/weight strings
                 String pkgStr = (String) pkgInfo.get(orderItemSeqId);
                 String qtyStr = (String) qtyInfo.get(orderItemSeqId);
+                String wgtStr = (String) wgtInfo.get(orderItemSeqId);
 
-                Debug.log("Item: " + orderItemSeqId + " / Product: " + prdStr 
+ " / Quantity: " + qtyStr + " /  Package: " + pkgStr, module);
+                Debug.log("Item: " + orderItemSeqId + " / Product: " + prdStr 
+ " / Quantity: " + qtyStr + " /  Package: " + pkgStr + " / Weight: " + wgtStr, 
module);
 
                 // array place holders
                 String[] quantities;
                 String[] packages;
+                String[] weights;
 
                 // process the package array
                 if (pkgStr.indexOf(",") != -1) {
@@ -130,19 +134,25 @@
                 } else {
                     quantities = new String[] { qtyStr };
                 }
+                
+                // process the weight array
+                if (UtilValidate.isEmpty(wgtStr)) wgtStr = "0";
+                weights = new String[] { wgtStr };
 
                 for (int p = 0; p < packages.length; p++) {
                     double quantity;
                     int packageSeq;
+                    double weightSeq;
                     try {
                         quantity = Double.parseDouble(quantities[p]);
                         packageSeq = Integer.parseInt(packages[p]);
+                        weightSeq = Double.parseDouble(weights[p]);
                     } catch (Exception e) {
                         return ServiceUtil.returnError(e.getMessage());
                     }
 
                     try {
-                        session.addOrIncreaseLine(orderId, orderItemSeqId, 
shipGroupSeqId, prdStr, quantity, packageSeq, updateQuantity.booleanValue());
+                        session.addOrIncreaseLine(orderId, orderItemSeqId, 
shipGroupSeqId, prdStr, quantity, packageSeq, weightSeq, 
updateQuantity.booleanValue());
                     } catch (GeneralException e) {
                         Debug.logError(e, module);
                         return ServiceUtil.returnError(e.getMessage());

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=509763&r1=509762&r2=509763
==============================================================================
--- 
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingSession.java
 (original)
+++ 
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingSession.java
 Tue Feb 20 13:34:42 2007
@@ -23,6 +23,7 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.math.BigDecimal;
 
 import javolution.util.FastMap;
 import javolution.util.FastList;
@@ -42,6 +43,7 @@
 import org.ofbiz.service.LocalDispatcher;
 import org.ofbiz.service.ServiceUtil;
 import org.ofbiz.product.product.ProductWorker;
+import org.ofbiz.order.order.OrderReadHelper;
 
 public class PackingSession implements java.io.Serializable {
 
@@ -91,7 +93,7 @@
         this(dispatcher, userLogin, null, null, null, null);
     }
 
-    public void addOrIncreaseLine(String orderId, String orderItemSeqId, 
String shipGroupSeqId, String productId, double quantity, int packageSeqId, 
boolean update) throws GeneralException {
+    public void addOrIncreaseLine(String orderId, String orderItemSeqId, 
String shipGroupSeqId, String productId, double quantity, int packageSeqId, 
double weight, boolean update) throws GeneralException {
         // reset the session if we just completed
         if (status == 0) {
             throw new GeneralException("Packing session has been completed; be 
sure to CLEAR before packing a new order! [000]");
@@ -132,7 +134,7 @@
         if (reservations.size() == 1) {
             GenericValue res = EntityUtil.getFirst(reservations);
             int checkCode = this.checkLineForAdd(res, orderId, orderItemSeqId, 
shipGroupSeqId, quantity, packageSeqId, update);
-            this.createPackLineItem(checkCode, res, orderId, orderItemSeqId, 
shipGroupSeqId, productId, quantity, packageSeqId);
+            this.createPackLineItem(checkCode, res, orderId, orderItemSeqId, 
shipGroupSeqId, productId, quantity, weight, packageSeqId);
         } else {
             // more than one reservation found
             Map toCreateMap = FastMap.newInstance();
@@ -166,7 +168,7 @@
                 while (x.hasNext()) {
                     GenericValue res = (GenericValue) x.next();
                     Double qty = (Double) toCreateMap.get(res);
-                    this.createPackLineItem(2, res, orderId, orderItemSeqId, 
shipGroupSeqId, productId, qty.doubleValue(), packageSeqId);
+                    this.createPackLineItem(2, res, orderId, orderItemSeqId, 
shipGroupSeqId, productId, qty.doubleValue(), weight, packageSeqId);
                 }
             } else {
                 throw new GeneralException("Not enough inventory reservation 
available; cannot pack the item! [103]");
@@ -178,11 +180,11 @@
     }
 
     public void addOrIncreaseLine(String orderId, String orderItemSeqId, 
String shipGroupSeqId, double quantity, int packageSeqId) throws 
GeneralException {
-        this.addOrIncreaseLine(orderId, orderItemSeqId, shipGroupSeqId, null, 
quantity, packageSeqId, false);
+        this.addOrIncreaseLine(orderId, orderItemSeqId, shipGroupSeqId, null, 
quantity, packageSeqId, 0, false);
     }
 
     public void addOrIncreaseLine(String productId, double quantity, int 
packageSeqId) throws GeneralException {
-        this.addOrIncreaseLine(null, null, null, productId, quantity, 
packageSeqId, false);
+        this.addOrIncreaseLine(null, null, null, productId, quantity, 
packageSeqId, 0, false);
     }
 
     public PackingSessionLine findLine(String orderId, String orderItemSeqId, 
String shipGroupSeqId, String inventoryItemId, int packageSeq) {
@@ -201,7 +203,7 @@
         return null;
     }
 
-    protected void createPackLineItem(int checkCode, GenericValue res, String 
orderId, String orderItemSeqId, String shipGroupSeqId, String productId, double 
quantity, int packageSeqId) throws GeneralException {
+    protected void createPackLineItem(int checkCode, GenericValue res, String 
orderId, String orderItemSeqId, String shipGroupSeqId, String productId, double 
quantity, double weight, int packageSeqId) throws GeneralException {
         // process the result; add new item if necessary
         switch(checkCode) {
             case 0:
@@ -213,7 +215,7 @@
             case 2:
                 // need to create a new item
                 String invItemId = res.getString("inventoryItemId");
-                packLines.add(new PackingSessionLine(orderId, orderItemSeqId, 
shipGroupSeqId, productId, invItemId, quantity, packageSeqId));
+                packLines.add(new PackingSessionLine(orderId, orderItemSeqId, 
shipGroupSeqId, productId, invItemId, quantity, weight, packageSeqId));
                 break;
         }
 
@@ -772,4 +774,90 @@
     public void setAdditionalShippingCharge(Double additionalShippingCharge) {
         this.additionalShippingCharge = additionalShippingCharge;
     }
+    
+    public double getTotalWeight(int packageSeq) {
+        double total = 0.0;
+        List lines = this.getLines();
+        Iterator i = lines.iterator();
+        while (i.hasNext()) {
+            PackingSessionLine line = (PackingSessionLine) i.next();
+            if (packageSeq == -1 || packageSeq == line.getPackageSeq()) {
+                total += line.getWeight();
+            }
+        }
+        return total;
+    }
+
+    public Double getShipmentCostEstimate(GenericValue orderItemShipGroup, 
String productStoreId, List shippableItemInfo, Double shippableTotal, Double 
shippableWeight, Double shippableQuantity) {
+        return 
getShipmentCostEstimate(orderItemShipGroup.getString("contactMechId"), 
orderItemShipGroup.getString("shipmentMethodTypeId"),
+                                       
orderItemShipGroup.getString("carrierPartyId"), 
orderItemShipGroup.getString("carrierRoleTypeId"), 
+                                       productStoreId, shippableItemInfo, 
shippableTotal, shippableWeight, shippableQuantity);
+    }
+    
+    public Double getShipmentCostEstimate(GenericValue orderItemShipGroup, 
String productStoreId) {
+        return 
getShipmentCostEstimate(orderItemShipGroup.getString("contactMechId"), 
orderItemShipGroup.getString("shipmentMethodTypeId"),
+                                       
orderItemShipGroup.getString("carrierPartyId"), 
orderItemShipGroup.getString("carrierRoleTypeId"), 
+                                       productStoreId, null, null, null, null);
+    }
+    
+    public Double getShipmentCostEstimate(String shippingContactMechId, String 
shipmentMethodTypeId, String carrierPartyId, String carrierRoleTypeId, String 
productStoreId, List shippableItemInfo, Double shippableTotal, Double 
shippableWeight, Double shippableQuantity) {
+
+        Double shipmentCostEstimate = null;
+        Map serviceResult = null;
+        try {
+            Map serviceContext = FastMap.newInstance();
+            serviceContext.put("shippingContactMechId", shippingContactMechId);
+            serviceContext.put("shipmentMethodTypeId", shipmentMethodTypeId);
+            serviceContext.put("carrierPartyId", carrierPartyId);
+            serviceContext.put("carrierRoleTypeId", carrierRoleTypeId);
+            serviceContext.put("productStoreId", productStoreId);
+    
+            if (UtilValidate.isEmpty(shippableItemInfo)) {
+                shippableItemInfo = FastList.newInstance();
+                Iterator lit = getLines().iterator();
+                while (lit.hasNext()) {
+                    PackingSessionLine line = (PackingSessionLine) lit.next();
+                    List oiasgas = 
getDelegator().findByAnd("OrderItemAndShipGroupAssoc", 
UtilMisc.toMap("orderId", line.getOrderId(), "orderItemSeqId", 
line.getOrderItemSeqId(), "shipGroupSeqId", line.getShipGroupSeqId()));
+                    shippableItemInfo.addAll(oiasgas);
+                }
+            }
+            serviceContext.put("shippableItemInfo", shippableItemInfo);
+
+            if (UtilValidate.isEmpty(shippableWeight)) {
+                shippableWeight = new Double(getTotalWeight(-1));
+            }
+            serviceContext.put("shippableWeight", shippableWeight);
+
+            if (UtilValidate.isEmpty(shippableQuantity)) {
+                shippableQuantity = new Double(getPackedQuantity(-1));
+            }
+            serviceContext.put("shippableQuantity", shippableQuantity);
+
+            if (UtilValidate.isEmpty(shippableTotal)) {
+                shippableTotal = new Double(0);
+                Iterator lit = getLines().iterator();
+                while (lit.hasNext()) {
+                    PackingSessionLine line = (PackingSessionLine) lit.next();
+                    GenericValue orderItem = 
getDelegator().findByPrimaryKey("OrderItem", UtilMisc.toMap("orderId", 
line.getOrderId(), "orderItemSeqId", line.getOrderItemSeqId()));
+                    BigDecimal orderItemTotal = 
OrderReadHelper.getOrderItemSubTotalBd(orderItem, null, false, false);
+                    shippableTotal = new Double(shippableTotal.doubleValue() + 
orderItemTotal.doubleValue());                    
+                }
+            }
+            serviceContext.put("shippableTotal", shippableTotal);
+    
+            serviceResult = 
getDispatcher().runSync("calcShipmentCostEstimate", serviceContext);
+        } catch( GenericEntityException e ) {
+            e.printStackTrace();
+        } catch( GenericServiceException e ) {
+            e.printStackTrace();
+        }
+        
+        if (! 
UtilValidate.isEmpty(serviceResult.get("shippingEstimateAmount"))) {
+            shipmentCostEstimate = (Double) 
serviceResult.get("shippingEstimateAmount");
+        }
+        
+        return shipmentCostEstimate;
+        
+    }
+   
 }

Modified: 
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingSessionLine.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingSessionLine.java?view=diff&rev=509763&r1=509762&r2=509763
==============================================================================
--- 
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingSessionLine.java
 (original)
+++ 
ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingSessionLine.java
 Tue Feb 20 13:34:42 2007
@@ -41,15 +41,17 @@
     protected String inventoryItemId = null;
     protected String shipmentItemSeqId = null;
     protected double quantity = 0;
+    protected double weight = 0;
     protected int packageSeq = 0;
 
-    public PackingSessionLine(String orderId, String orderItemSeqId, String 
shipGroupSeqId, String productId, String inventoryItemId, double quantity, int 
packageSeq) {
+    public PackingSessionLine(String orderId, String orderItemSeqId, String 
shipGroupSeqId, String productId, String inventoryItemId, double quantity, 
double weight, int packageSeq) {
         this.orderId = orderId;
         this.orderItemSeqId = orderItemSeqId;
         this.shipGroupSeqId = shipGroupSeqId;
         this.inventoryItemId = inventoryItemId;
         this.productId = productId;
         this.quantity = quantity;
+        this.weight = weight;
         this.packageSeq = packageSeq;
     }
 
@@ -91,6 +93,18 @@
 
     public void addQuantity(double quantity) {
         this.quantity += quantity;
+    }
+
+    public double getWeight() {
+        return weight;
+    }
+
+    public void setWeight(double weight) {
+        this.weight = weight;
+    }
+
+    public void addWeight(double weight) {
+        this.weight += weight;
     }
 
     public int getPackageSeq() {

Modified: 
ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/PackOrder.bsh
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/PackOrder.bsh?view=diff&rev=509763&r1=509762&r2=509763
==============================================================================
--- 
ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/PackOrder.bsh
 (original)
+++ 
ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/PackOrder.bsh
 Tue Feb 20 13:34:42 2007
@@ -86,11 +86,22 @@
         context.put("orderId", orderId);
         context.put("orderHeader", orderHeader);
         context.put("orderReadHelper", orh);
-        context.put("orderItemShipGroup", 
orh.getOrderItemShipGroup(shipGroupSeqId));
+        orderItemShipGroup = orh.getOrderItemShipGroup(shipGroupSeqId);
+        context.put("orderItemShipGroup", orderItemShipGroup);
 
         if ("ORDER_APPROVED".equals(orderHeader.getString("statusId"))) {
             if (UtilValidate.isNotEmpty(shipGroupSeqId)) {
-                context.put("itemInfos", 
orh.getOrderItemAndShipGroupAssoc(shipGroupSeqId));
+
+                // Generate the shipment cost estimate for the ship group
+                productStoreId = orh.getProductStoreId();
+                shippableItemInfo = 
orh.getOrderItemAndShipGroupAssoc(shipGroupSeqId);
+                shippableTotal = new 
Double(orh.getShippableTotalBd(shipGroupSeqId).doubleValue());
+                shippableWeight = new 
Double(orh.getShippableWeightBd(shipGroupSeqId).doubleValue());
+                shippableQuantity = new 
Double(orh.getShippableQuantityBd(shipGroupSeqId).doubleValue());
+                shipmentCostEstimate = 
packSession.getShipmentCostEstimate(orderItemShipGroup, productStoreId, 
shippableItemInfo, shippableTotal, shippableWeight, shippableQuantity);         
       
+                context.put("shipmentCostEstimateForShipGroup", 
shipmentCostEstimate);
+
+                context.put("itemInfos", shippableItemInfo);
             } else {
                 request.setAttribute("errorMessageList", UtilMisc.toList("No 
ship group sequence ID. Cannot process."));
             }
@@ -102,3 +113,12 @@
     }
 }
 
+// Try to get the defaultWeightUomId first from the facility, then from the 
shipment properties, and finally defaulting to kilos
+defaultWeightUomId = null; 
+if (! UtilValidate.isEmpty(facility)) {
+    defaultWeightUomId = facility.getString("defaultWeightUomId");
+}
+if (UtilValidate.isEmpty(defaultWeightUomId)) {
+    defaultWeightUomId = 
UtilProperties.getPropertyValue("shipment.properties", 
"shipment.default.weight.uom", "WT_kg");
+}
+context.put("defaultWeightUomId", defaultWeightUomId);

Modified: 
ofbiz/trunk/applications/product/webapp/facility/shipment/PackOrder.ftl
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/shipment/PackOrder.ftl?view=diff&rev=509763&r1=509762&r2=509763
==============================================================================
--- ofbiz/trunk/applications/product/webapp/facility/shipment/PackOrder.ftl 
(original)
+++ ofbiz/trunk/applications/product/webapp/facility/shipment/PackOrder.ftl Tue 
Feb 20 13:34:42 2007
@@ -126,6 +126,11 @@
                 </#if>
                 ${orderItemShipGroup.shipmentMethodTypeId?default("??")}
               </div>
+              <div>&nbsp;</div>
+              <div 
class="tableheadtext">${uiLabelMap.ProductEstimatedShipCostForShipGroup}:</div>
+              <#if shipmentCostEstimateForShipGroup?exists>
+                  <div class="tabletext"><@ofbizCurrency 
amount=shipmentCostEstimateForShipGroup 
isoCode=orderReadHelper.getCurrency()?if_exists/></div>
+              </#if>
             </td>
             <td>&nbsp;&nbsp;</td>
             <td valign="top">
@@ -199,10 +204,11 @@
               <td align="right"><div 
class="tableheadtext">${uiLabelMap.ProductPackedQty}</td>
               <td>&nbsp;</td>
               <td align="center"><div 
class="tableheadtext">${uiLabelMap.ProductPackQty}</td>
+              <td align="center"><div 
class="tableheadtext">${uiLabelMap.ProductPackedWeight}&nbsp;(${("uiLabelMap.ProductShipmentUomAbbreviation_"
 + defaultWeightUomId)?eval})</td>
               <td align="center"><div 
class="tableheadtext">${uiLabelMap.ProductPackage}</td>
             </tr>
             <tr>
-              <td colspan="10">
+              <td colspan="11">
                 <hr class="sepbar"/>
               </td>
             </tr>
@@ -228,6 +234,9 @@
                   <input type="text" class="inputBox" size="7" 
name="qty_${orderItem.orderItemSeqId}" value="${inputQty}">
                 </td>
                 <td align="center">
+                  <input type="text" class="inputBox" size="7" 
name="wgt_${orderItem.orderItemSeqId}" value="">
+                </td>
+                <td align="center">
                   <select name="pkg_${orderItem.orderItemSeqId}">
                     <option value="1">${uiLabelMap.ProductPackage} 1</option>
                     <option value="2">${uiLabelMap.ProductPackage} 2</option>
@@ -239,9 +248,9 @@
                 <input type="hidden" name="prd_${orderItem.orderItemSeqId}" 
value="${orderItem.productId?if_exists}">
               </tr>
             </#list>
-            <tr><td colspan="10">&nbsp;</td></tr>
+            <tr><td colspan="11">&nbsp;</td></tr>
             <tr>
-              <td colspan="10" align="right">
+              <td colspan="11" align="right">
                 <input type="submit" value="${uiLabelMap.ProductPackItem}">
                 &nbsp;
                 <input type="button" value="${uiLabelMap.CommonClear}" 
onclick="javascript:document.clearPackForm.submit();"/>
@@ -274,6 +283,14 @@
                 <div 
class="tableheadtext">${uiLabelMap.ProductAdditionalShippingCharge}:</div>
                 <div>
                   <input type="text" class="inputBox" 
name="additionalShippingCharge" 
value="${packingSession.getAdditionalShippingCharge()?if_exists}" size="20"/>
+                  <br/>
+                  <#if packingSession.getLines()?exists && 
packingSession.getLines()?has_content>
+                    <#assign packedShipmentCostEstimate = 
packingSession.getShipmentCostEstimate(orderItemShipGroup, 
orderReadHelper.getProductStoreId())/>
+                    ${uiLabelMap.ProductEstimatedShipCostPackages}:
+                    <#if packedShipmentCostEstimate?exists>
+                        <@ofbizCurrency amount=packedShipmentCostEstimate 
isoCode=orderReadHelper.getCurrency()?if_exists/>
+                    </#if>
+                  </#if>
                 </div>
               </td>
               <td align="right">
@@ -303,11 +320,12 @@
             <td><div 
class="tableheadtext">${uiLabelMap.ProductDescription}</td>
             <td><div class="tableheadtext">${uiLabelMap.ProductInventoryItem} 
#</td>
             <td align="right"><div 
class="tableheadtext">${uiLabelMap.ProductPackedQty}</td>
+            <td align="right"><div 
class="tableheadtext">${uiLabelMap.ProductPackedWeight}&nbsp;(${("uiLabelMap.ProductShipmentUomAbbreviation_"
 + defaultWeightUomId)?eval})</td>
             <td align="right"><div 
class="tableheadtext">${uiLabelMap.ProductPackage} #</td>
             <td>&nbsp;</td>
           </tr>
           <tr>
-            <td colspan="7">
+            <td colspan="8">
               <hr class="sepbar"/>
             </td>
           </tr>
@@ -319,6 +337,7 @@
               <td><div 
class="tabletext">${(orderItem.itemDescription)?default("[N/A]")}</td>
               <td><div class="tabletext">${line.getInventoryItemId()}</td>
               <td align="right"><div 
class="tabletext">${line.getQuantity()}</td>
+              <td align="right"><div class="tabletext">${line.getWeight()}</td>
               <td align="right"><div 
class="tabletext">${line.getPackageSeq()}</td>
               <td align="right"><a 
href="<@ofbizUrl>ClearPackLine?facilityId=${facilityId}&orderId=${line.getOrderId()}&orderItemSeqId=${line.getOrderItemSeqId()}&shipGroupSeqId=${line.getShipGroupSeqId()}&inventoryItemId=${line.getInventoryItemId()}&packageSeqId=${line.getPackageSeq()}</@ofbizUrl>"
 class="buttontext">${uiLabelMap.CommonClear}</a></td>
             </tr>


Reply via email to