You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by as...@apache.org on 2010/09/14 15:32:50 UTC
svn commit: r996892 - in /ofbiz/trunk/applications/product: servicedef/
src/org/ofbiz/shipment/packing/ webapp/facility/WEB-INF/actions/shipment/
webapp/facility/shipment/
Author: ashish
Date: Tue Sep 14 13:32:49 2010
New Revision: 996892
URL: http://svn.apache.org/viewvc?rev=996892&view=rev
Log:
Applied patch from jira issue OFBIZ-3940 - Adding an option to select shipment box type from pack order page.
Previously there wan not any option to select a shipment box type while packing. Selection of a box type is available only for "USPS" carrierPartyId.
Thanks Anurag for the contribution.
Modified:
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/webapp/facility/WEB-INF/actions/shipment/PackOrder.groovy
ofbiz/trunk/applications/product/webapp/facility/shipment/PackOrder.ftl
Modified: ofbiz/trunk/applications/product/servicedef/services_shipment.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/servicedef/services_shipment.xml?rev=996892&r1=996891&r2=996892&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/servicedef/services_shipment.xml (original)
+++ ofbiz/trunk/applications/product/servicedef/services_shipment.xml Tue Sep 14 13:32:49 2010
@@ -622,6 +622,7 @@ under the License.
<attribute name="selInfo" type="Map" string-map-prefix="sel_" mode="IN" optional="true"/>
<attribute name="iteInfo" type="Map" string-map-prefix="ite_" mode="IN" optional="true"/>
<attribute name="wgtInfo" type="Map" string-map-prefix="wgt_" mode="IN" optional="true"/>
+ <attribute name="boxTypeInfo" type="Map" string-map-prefix="boxType_" mode="IN" optional="true"/>
<attribute name="numPackagesInfo" type="Map" string-map-prefix="numPackages_" mode="IN" optional="true"/>
</service>
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?rev=996892&r1=996891&r2=996892&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingServices.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingServices.java Tue Sep 14 13:32:49 2010
@@ -111,6 +111,7 @@ public class PackingServices {
Map<String, String> pkgInfo = UtilGenerics.checkMap(context.get("pkgInfo"));
Map<String, String> wgtInfo = UtilGenerics.checkMap(context.get("wgtInfo"));
Map<String, String> numPackagesInfo = UtilGenerics.checkMap(context.get("numPackagesInfo"));
+ Map<String, String> boxTypeInfo = UtilGenerics.checkMap(context.get("boxTypeInfo"));
if (selInfo != null) {
for (String rowKey: selInfo.keySet()) {
@@ -125,6 +126,8 @@ public class PackingServices {
String pkgStr = pkgInfo.get(rowKey);
String qtyStr = qtyInfo.get(rowKey);
String wgtStr = wgtInfo.get(rowKey);
+ String boxType = boxTypeInfo.get(rowKey);
+ session.setShipmentBoxTypeId(boxType);
Debug.log("Item: " + orderItemSeqId + " / Product: " + prdStr + " / Quantity: " + qtyStr + " / Package: " + pkgStr + " / Weight: " + wgtStr, module);
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?rev=996892&r1=996891&r2=996892&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingSession.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/packing/PackingSession.java Tue Sep 14 13:32:49 2010
@@ -62,6 +62,7 @@ public class PackingSession implements j
protected String shipmentId = null;
protected String instructions = null;
protected String weightUomId = null;
+ protected String shipmentBoxTypeId = null;
protected BigDecimal additionalShippingCharge = null;
protected Map<Integer, BigDecimal> packageWeights = null;
protected List<PackingEvent> packEvents = null;
@@ -794,7 +795,7 @@ public class PackingSession implements j
Map<String, Object> pkgCtx = FastMap.newInstance();
pkgCtx.put("shipmentId", shipmentId);
pkgCtx.put("shipmentPackageSeqId", shipmentPackageSeqId);
- //pkgCtx.put("shipmentBoxTypeId", "");
+ pkgCtx.put("shipmentBoxTypeId", this.shipmentBoxTypeId);
pkgCtx.put("weight", getPackageWeight(i+1));
pkgCtx.put("weightUomId", getWeightUomId());
pkgCtx.put("userLogin", userLogin);
@@ -949,6 +950,10 @@ public class PackingSession implements j
this.weightUomId = weightUomId;
}
+ public void setShipmentBoxTypeId(String shipmentBoxTypeId) {
+ this.shipmentBoxTypeId = shipmentBoxTypeId;
+ }
+
public List<Integer> getPackageSeqIds() {
Set<Integer> packageSeqIds = new TreeSet<Integer>();
if (! UtilValidate.isEmpty(this.getLines())) {
Modified: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/PackOrder.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/PackOrder.groovy?rev=996892&r1=996891&r2=996892&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/PackOrder.groovy (original)
+++ ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/PackOrder.groovy Tue Sep 14 13:32:49 2010
@@ -132,6 +132,11 @@ if (orderId) {
context.orderReadHelper = orh;
orderItemShipGroup = orh.getOrderItemShipGroup(shipGroupSeqId);
context.orderItemShipGroup = orderItemShipGroup;
+ carrierPartyId = orderItemShipGroup.carrierPartyId;
+ if ("USPS".equals(carrierPartyId)) {
+ carrierShipmentBoxTypes = delegator.findList("CarrierShipmentBoxType", EntityCondition.makeCondition([partyId : carrierPartyId]), null, null, null, false);
+ context.carrierShipmentBoxTypes = carrierShipmentBoxTypes;
+ }
if ("ORDER_APPROVED".equals(orderHeader.statusId)) {
if (shipGroupSeqId) {
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?rev=996892&r1=996891&r2=996892&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/facility/shipment/PackOrder.ftl (original)
+++ ofbiz/trunk/applications/product/webapp/facility/shipment/PackOrder.ftl Tue Sep 14 13:32:49 2010
@@ -261,6 +261,9 @@ under the License.
<td> </td>
<td align="center">${uiLabelMap.ProductPackQty}</td>
<td align="center">${uiLabelMap.ProductPackedWeight} (${("uiLabelMap.ProductShipmentUomAbbreviation_" + defaultWeightUomId)?eval})</td>
+ <#if carrierShipmentBoxTypes?has_content>
+ <td align="center">${uiLabelMap.ProductShipmentBoxType}</td>
+ </#if>
<td align="center">${uiLabelMap.ProductPackage}</td>
<td align="right"> <b>*</b> ${uiLabelMap.ProductPackages}</td>
</tr>
@@ -307,6 +310,17 @@ under the License.
<td align="center">
<input type="text" size="7" name="wgt_${rowKey}" value="" />
</td>
+ <#if carrierShipmentBoxTypes?has_content>
+ <td align="center">
+ <select name="boxType_${rowKey}">
+ <option value=""></option>
+ <#list carrierShipmentBoxTypes as carrierShipmentBoxType>
+ <#assign shipmentBoxType = carrierShipmentBoxType.getRelatedOne("ShipmentBoxType") />
+ <option value="${shipmentBoxType.shipmentBoxTypeId}">${shipmentBoxType.description?default(shipmentBoxType.shipmentBoxTypeId)}</option>
+ </#list>
+ </select>
+ </td>
+ </#if>
<td align="center">
<select name="pkg_${rowKey}">
<#if packingSession.getPackageSeqIds()?exists>