Author: jleroux
Date: Fri Sep  9 11:50:01 2011
New Revision: 1167116

URL: http://svn.apache.org/viewvc?rev=1167116&view=rev
Log:
A patch from Paul Foxworthy "roleTypeId not copied from 
ProductStoreShipmentMethod to OrderItemShipGroup" 
https://issues.apache.org/jira/browse/OFBIZ-4389

In ordershippinginfo.ftl, a list of shipping methods is presented, and when one 
is chosen values are written into an OrderItemShipGroup. The shipping methods 
are defined by rows in ProductStoreShipMethod, and one of the attributes of 
this entity is a carrierRoleTypeId. Similarly, OrderItemShipGroup has a 
carrierRoleTypeId, but no data is being written into it.

Modified:
    
ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderServices.xml
    ofbiz/trunk/applications/order/webapp/ordermgr/order/ordershippinginfo.ftl

Modified: 
ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderServices.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderServices.xml?rev=1167116&r1=1167115&r2=1167116&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderServices.xml 
(original)
+++ 
ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderServices.xml 
Fri Sep  9 11:50:01 2011
@@ -783,13 +783,15 @@ under the License.
         <set-pk-fields map="parameters" value-field="lookupPKMap"/>
         <find-by-primary-key entity-name="OrderItemShipGroup" 
map="lookupPKMap" value-field="lookedUpValue"/>
         <!-- splitting shipmentMethod request parameter value that contains 
"@" symbol
-             into "shipmentMethodTypeId" and "carrierPartyId".
+             into "shipmentMethodTypeId", "carrierPartyId" and 
"carrierRoleTypeId".
         -->
         <call-bsh><![CDATA[
             shipmentMethod = parameters.get("shipmentMethod");
             if(shipmentMethod != null){
-               parameters.put("shipmentMethodTypeId", 
shipmentMethod.substring(0, shipmentMethod.indexOf("@")));
-               parameters.put("carrierPartyId", 
shipmentMethod.substring(shipmentMethod.indexOf("@")+1));
+               arr = shipmentMethod.split( "@" );
+               parameters.put("shipmentMethodTypeId", arr[0]);
+               parameters.put("carrierPartyId", arr[1]);
+               parameters.put("carrierRoleTypeId", arr[2]);
             }
         ]]></call-bsh>
         <set-nonpk-fields map="parameters" value-field="lookedUpValue"/>

Modified: 
ofbiz/trunk/applications/order/webapp/ordermgr/order/ordershippinginfo.ftl
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/order/ordershippinginfo.ftl?rev=1167116&r1=1167115&r2=1167116&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/order/ordershippinginfo.ftl 
(original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/order/ordershippinginfo.ftl 
Fri Sep  9 11:50:01 2011
@@ -246,18 +246,18 @@ under the License.
                     <td valign="top" width="80%">
                         <div>
                             <#if orderHeader?has_content && 
orderHeader.statusId != "ORDER_CANCELLED" && orderHeader.statusId != 
"ORDER_COMPLETED" && orderHeader.statusId != "ORDER_REJECTED">
-                            <#-- passing the shipmentMethod value as the 
combination of two fields value
-                            i.e shipmentMethodTypeId & carrierPartyId and this 
two field values are separated bye
+                            <#-- passing the shipmentMethod value as the 
combination of three fields value
+                            i.e shipmentMethodTypeId & carrierPartyId & 
roleTypeId. Values are separated by
                             "@" symbol.
                             -->
                             <select name="shipmentMethod">
                                 <#if 
shipGroup.shipmentMethodTypeId?has_content>
-                                <option 
value="${shipGroup.shipmentMethodTypeId}@${shipGroup.carrierPartyId?if_exists}"><#if
 shipGroup.carrierPartyId != 
"_NA_">${shipGroup.carrierPartyId?if_exists}</#if>&nbsp;${shipmentMethodType.get("description",locale)?default("")}</option>
+                                <option 
value="${shipGroup.shipmentMethodTypeId}@${shipGroup.carrierPartyId!}@${shipGroup.carrierRoleTypeId!}"><#if
 shipGroup.carrierPartyId != 
"_NA_">${shipGroup.carrierPartyId!}</#if>&nbsp;${shipmentMethodType.get("description",locale)!}</option>
                                 <#else>
                                 <option value=""/>
                                 </#if>
                                 <#list productStoreShipmentMethList as 
productStoreShipmentMethod>
-                                <#assign shipmentMethodTypeAndParty = 
productStoreShipmentMethod.shipmentMethodTypeId + "@" + 
productStoreShipmentMethod.partyId>
+                                <#assign shipmentMethodTypeAndParty = 
productStoreShipmentMethod.shipmentMethodTypeId + "@" + 
productStoreShipmentMethod.partyId + "@" + 
productStoreShipmentMethod.roleTypeId>
                                 <#if 
productStoreShipmentMethod.partyId?has_content || 
productStoreShipmentMethod?has_content>
                                 <option 
value="${shipmentMethodTypeAndParty?if_exists}"><#if 
productStoreShipmentMethod.partyId != 
"_NA_">${productStoreShipmentMethod.partyId?if_exists}</#if>&nbsp;${productStoreShipmentMethod.get("description",locale)?default("")}</option>
                                 </#if>


Reply via email to