svn commit: r541104 - in /ofbiz/trunk/applications/product: config/ entitydef/ src/org/ofbiz/shipment/thirdparty/ups/ webapp/facility/WEB-INF/actions/shipment/ webapp/facility/shipment/

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

svn commit: r541104 - in /ofbiz/trunk/applications/product: config/ entitydef/ src/org/ofbiz/shipment/thirdparty/ups/ webapp/facility/WEB-INF/actions/shipment/ webapp/facility/shipment/

sichen
Author: sichen
Date: Wed May 23 15:27:52 2007
New Revision: 541104

URL: http://svn.apache.org/viewvc?view=rev&rev=541104
Log:
Change shipmentRouteSegment to use two fields for thirdPartyPostalCode and thirdPartyCountryGeoCode instead of thirdPartyContactMechId, to make it easier to integrate into the order entry process

Modified:
    ofbiz/trunk/applications/product/config/ProductUiLabels.properties
    ofbiz/trunk/applications/product/entitydef/entitymodel_shipment.xml
    ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java
    ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/EditShipmentRouteSegments.bsh
    ofbiz/trunk/applications/product/webapp/facility/shipment/EditShipmentRouteSegments.ftl

Modified: ofbiz/trunk/applications/product/config/ProductUiLabels.properties
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/config/ProductUiLabels.properties?view=diff&rev=541104&r1=541103&r2=541104
==============================================================================
--- ofbiz/trunk/applications/product/config/ProductUiLabels.properties (original)
+++ ofbiz/trunk/applications/product/config/ProductUiLabels.properties Wed May 23 15:27:52 2007
@@ -1235,7 +1235,8 @@
 ProductShipmentPlanToOrderItems=Shipment Plan --> Order Items
 ProductShipmentQuickComplete=Quick Complete Drop Shipment
 ProductShipmentThirdPartyAccountNumber=Third Party Account Number
-ProductShipmentThirdPartyAddress=Third Party Account Address ID
+ProductShipmentThirdPartyPostalCode=Third Party Postal Code
+ProductShipmentThirdPartyCountryCode=Third Party Country Code
 ProductShipmentTotalWeight=Total Weight
 ProductShipmentTotalVolume=Total Volume
 ProductShipmentType=Shipment Type

Modified: ofbiz/trunk/applications/product/entitydef/entitymodel_shipment.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/entitydef/entitymodel_shipment.xml?view=diff&rev=541104&r1=541103&r2=541104
==============================================================================
--- ofbiz/trunk/applications/product/entitydef/entitymodel_shipment.xml (original)
+++ ofbiz/trunk/applications/product/entitydef/entitymodel_shipment.xml Wed May 23 15:27:52 2007
@@ -1113,7 +1113,8 @@
       <field name="homeDeliveryType" type="id"></field>
       <field name="homeDeliveryDate" type="date-time"></field>
       <field name="thirdPartyAccountNumber" type="id"></field>
-      <field name="thirdPartyContactMechId" type="id"></field>
+      <field name="thirdPartyPostalCode" type="id"></field>
+      <field name="thirdPartyCountryGeoCode" type="id"></field>
       <prim-key field="shipmentId"/>
       <prim-key field="shipmentRouteSegmentId"/>
       <relation type="one" fk-name="SHPMT_RTSEG_SHPMT" rel-entity-name="Shipment">
@@ -1166,9 +1167,6 @@
       </relation>
       <relation type="one" fk-name="SHPKRTSG_BWUOM" title="BillingWeight" rel-entity-name="Uom">
         <key-map field-name="billingWeightUomId" rel-field-name="uomId"/>
-      </relation>
-      <relation type="one" fk-name="SHPMT_RTSEG_TPPAD" title="ThirdParty" rel-entity-name="PostalAddress">
-        <key-map field-name="thirdPartyContactMechId" rel-field-name="contactMechId"/>
       </relation>
     </entity>
     <view-entity entity-name="ShipmentPackageRouteDetail"

Modified: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java?view=diff&rev=541104&r1=541103&r2=541104
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/ups/UpsServices.java Wed May 23 15:27:52 2007
@@ -352,15 +352,15 @@
             } else {
 
                 // Paid by another shipper (may be receiver or not)
-                GenericValue thirdPartyPostalAddress = shipmentRouteSegment.getRelatedOne("ThirdPartyPostalAddress");
     
                 // UPS requires the postal code and country code of the third party
-                if (UtilValidate.isEmpty(thirdPartyPostalAddress)) {
-                    return ServiceUtil.returnError("ThirdPartyPostalAddress not found for ShipmentRouteSegment with shipmentId " + shipmentId + " and shipmentRouteSegmentId " + shipmentRouteSegmentId);
+                String thirdPartyPostalCode = shipmentRouteSegment.getString("thirdPartyPostalCode");
+                if (UtilValidate.isEmpty(thirdPartyPostalCode)) {
+                    return ServiceUtil.returnError("Third-party postal code not found for ShipmentRouteSegment with shipmentId " + shipmentId + " and shipmentRouteSegmentId " + shipmentRouteSegmentId);
                 }
-                GenericValue thirdPartyCountryGeo = thirdPartyPostalAddress.getRelatedOne("CountryGeo");
-                if (UtilValidate.isEmpty(thirdPartyCountryGeo)) {
-                    return ServiceUtil.returnError("ThirdPartyCountryGeo not found for ShipmentRouteSegment with shipmentId " + shipmentId + " and shipmentRouteSegmentId " + shipmentRouteSegmentId);
+                String thirdPartyCountryGeoCode = shipmentRouteSegment.getString("thirdPartyCountryGeoCode");
+                if (UtilValidate.isEmpty(thirdPartyCountryGeoCode)) {
+                    return ServiceUtil.returnError("Third-party country not found for ShipmentRouteSegment with shipmentId " + shipmentId + " and shipmentRouteSegmentId " + shipmentRouteSegmentId);
                 }
 
                 Element billThirdPartyElement = UtilXml.addChildElement(paymentInformationElement, "BillThirdParty", shipmentConfirmRequestDoc);
@@ -368,8 +368,8 @@
                 UtilXml.addChildElementValue(billThirdPartyShipperElement, "AccountNumber", thirdPartyAccountNumber, shipmentConfirmRequestDoc);
                 Element thirdPartyElement = UtilXml.addChildElement(billThirdPartyShipperElement, "ThirdParty", shipmentConfirmRequestDoc);
                 Element addressElement = UtilXml.addChildElement(thirdPartyElement, "Address", shipmentConfirmRequestDoc);
-                UtilXml.addChildElementValue(addressElement, "PostalCode", thirdPartyPostalAddress.getString("postalCode"), shipmentConfirmRequestDoc);
-                UtilXml.addChildElementValue(addressElement, "CountryCode", thirdPartyCountryGeo.getString("geoCode"), shipmentConfirmRequestDoc);
+                UtilXml.addChildElementValue(addressElement, "PostalCode", thirdPartyPostalCode, shipmentConfirmRequestDoc);
+                UtilXml.addChildElementValue(addressElement, "CountryCode", thirdPartyCountryGeoCode, shipmentConfirmRequestDoc);
             }
 
             // Child of Shipment: Service

Modified: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/EditShipmentRouteSegments.bsh
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/EditShipmentRouteSegments.bsh?view=diff&rev=541104&r1=541103&r2=541104
==============================================================================
--- ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/EditShipmentRouteSegments.bsh (original)
+++ ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/EditShipmentRouteSegments.bsh Wed May 23 15:27:52 2007
@@ -60,7 +60,6 @@
             } else {
                 shipmentRouteSegmentData.put("carrierServiceStatusValidChangeToDetails", delegator.findByAnd("StatusValidChangeToDetail", UtilMisc.toMap("statusId", "SHRSCS_NOT_STARTED"), UtilMisc.toList("sequenceId")));
             }
-            shipmentRouteSegmentData.put("thirdPartyPostalAddress", shipmentRouteSegment.getRelatedOne("ThirdPartyPostalAddress"));
             shipmentRouteSegmentDatas.add(shipmentRouteSegmentData);
         }
     }

Modified: ofbiz/trunk/applications/product/webapp/facility/shipment/EditShipmentRouteSegments.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/shipment/EditShipmentRouteSegments.ftl?view=diff&rev=541104&r1=541103&r2=541104
==============================================================================
--- ofbiz/trunk/applications/product/webapp/facility/shipment/EditShipmentRouteSegments.ftl (original)
+++ ofbiz/trunk/applications/product/webapp/facility/shipment/EditShipmentRouteSegments.ftl Wed May 23 15:27:52 2007
@@ -26,7 +26,8 @@
             <div class="tableheadtext">${uiLabelMap.ProductOriginDestinationAddressId}</div>
             <div class="tableheadtext">${uiLabelMap.ProductOriginDestinationPhoneId}</div>
             <div class="tableheadtext">${uiLabelMap.ProductShipmentThirdPartyAccountNumber}</div>
-            <div class="tableheadtext">${uiLabelMap.ProductShipmentThirdPartyAddress}</div>
+            <div class="tableheadtext">${uiLabelMap.ProductShipmentThirdPartyPostalCode}</div>
+            <div class="tableheadtext">${uiLabelMap.ProductShipmentThirdPartyCountryCode}</div>
         </td>
         <td>
             <div class="tableheadtext">${uiLabelMap.ProductShipmentFedexHomeDeliveryTypeDate}</div>
@@ -62,7 +63,6 @@
     <#assign currencyUom = shipmentRouteSegmentData.currencyUom?if_exists>
     <#assign billingWeightUom = shipmentRouteSegmentData.billingWeightUom?if_exists>
     <#assign carrierServiceStatusValidChangeToDetails = shipmentRouteSegmentData.carrierServiceStatusValidChangeToDetails?if_exists>
-    <#assign thirdPartyPostalAddress = shipmentRouteSegmentData.thirdPartyPostalAddress?if_exists>
     <form action="<@ofbizUrl>updateShipmentRouteSegment</@ofbizUrl>" name="updateShipmentRouteSegmentForm${shipmentRouteSegmentData_index}">
     <input type="hidden" name="shipmentId" value="${shipmentId}"/>
     <input type="hidden" name="shipmentRouteSegmentId" value="${shipmentRouteSegment.shipmentRouteSegmentId}"/>
@@ -135,8 +135,10 @@
                 <input type="text" size="15" name="thirdPartyAccountNumber" value="${shipmentRouteSegment.thirdPartyAccountNumber?if_exists}" class="inputBox"/>
             </div>
             <div class="tabletext">
-                <input type="text" size="15" name="thirdPartyContactMechId" value="${shipmentRouteSegment.thirdPartyContactMechId?if_exists}" class="inputBox"/>
-                <#if thirdPartyPostalAddress?has_content>[${uiLabelMap.CommonTo}: ${thirdPartyPostalAddress.toName?if_exists}, ${uiLabelMap.CommonAttn}: ${thirdPartyPostalAddress.attnName?if_exists}, ${thirdPartyPostalAddress.address1?if_exists}, ${thirdPartyPostalAddress.address2?if_exists}, ${thirdPartyPostalAddress.city?if_exists}, ${thirdPartyPostalAddress.stateProvinceGeoId?if_exists}, ${thirdPartyPostalAddress.postalCode?if_exists}, ${thirdPartyPostalAddress.countryGeoId?if_exists}]</#if>
+                <input type="text" size="15" name="thirdPartyPostalCode" value="${shipmentRouteSegment.thirdPartyPostalCode?if_exists}" class="inputBox"/>
+            </div>
+            <div class="tabletext">
+                <input type="text" size="15" name="thirdPartyCountryGeoCode" value="${shipmentRouteSegment.thirdPartyCountryGeoCode?if_exists}" class="inputBox"/>
             </div>
         </td>
         <td>