svn commit: r575855 - in /ofbiz/trunk/specialpurpose/oagis: src/org/ofbiz/oagis/OagisShipmentServices.java webapp/oagis/message/ProcessShipment.ftl

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

svn commit: r575855 - in /ofbiz/trunk/specialpurpose/oagis: src/org/ofbiz/oagis/OagisShipmentServices.java webapp/oagis/message/ProcessShipment.ftl

jonesde
Author: jonesde
Date: Fri Sep 14 19:16:21 2007
New Revision: 575855

URL: http://svn.apache.org/viewvc?rev=575855&view=rev
Log:
Small fix for cs replace return item label condition; also added some stuff to the Process Shipment template to truncate strings; tested a few variations on this and seems to be working fine, and the numbers are at the top for easier patching/etc

Modified:
    ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java
    ofbiz/trunk/specialpurpose/oagis/webapp/oagis/message/ProcessShipment.ftl

Modified: ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java?rev=575855&r1=575854&r2=575855&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java (original)
+++ ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java Fri Sep 14 19:16:21 2007
@@ -859,7 +859,7 @@
                         Iterator returnItemIter = returnItemList.iterator();
                         while (returnItemIter.hasNext()) {
                             GenericValue returnItem = (GenericValue) returnItemIter.next();
-                            if ("returnTypeId".equals(returnItem.getString("RTN_CSREPLACE"))) {
+                            if ("RTN_CSREPLACE".equals(returnItem.getString("returnTypeId"))) {
                                 includeReturnLabel = true;
                             }
                         }
@@ -899,9 +899,7 @@
                 bodyParameters.put("orderId", orderId);
                 bodyParameters.put("userLogin", userLogin);
 
-                
                 String bodyScreenUri = UtilProperties.getPropertyValue("oagis.properties", "Oagis.Template.ProcessShipment");
-
                 String outText = null;
                 try {
                     Writer writer = new StringWriter();

Modified: ofbiz/trunk/specialpurpose/oagis/webapp/oagis/message/ProcessShipment.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/oagis/webapp/oagis/message/ProcessShipment.ftl?rev=575855&r1=575854&r2=575855&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/oagis/webapp/oagis/message/ProcessShipment.ftl (original)
+++ ofbiz/trunk/specialpurpose/oagis/webapp/oagis/message/ProcessShipment.ftl Fri Sep 14 19:16:21 2007
@@ -1,23 +1,35 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <#--
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-    
-    http://www.apache.org/licenses/LICENSE-2.0
-    
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
 -->
 <#-- xsi:schemaLocation="http://www.openapplications.org/161B_PROCESS_SHIPMENT_001 file:///C:/Documents%20and%20Settings/022523/My%20Documents/Vudu/XML%20Specs/REL%201%20-%20VER%202/161B_process_shipment_005.xsd" -->
+<#-- NOTE: not all of these are used -->
+<#assign partnerNameSize = 35/>
+<#assign partnerAddressLineSize = 35/>
+<#assign partnerAddressCitySize = 15/>
+<#assign partnerAddressStateSize = 2/>
+<#assign partnerAddressPostalSize = 9/>
+<#assign partnerAddressCountrySize = 2/>
+<#assign partnerContactNameSize = 35/>
+<#assign partnerContactPhoneSize = 21/>
+<#assign partnerContactFaxSize = 10/>
+<#assign partnerContactEmailSize = 65/>
+<#assign shipmentNotesSize = 65/>
 <n:PROCESS_SHIPMENT_001
     xmlns:n="http://www.openapplications.org/161B_PROCESS_SHIPMENT_001"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -65,18 +77,28 @@
             <#if (partyNameView.lastName)?has_content><#assign partyName = partyName + " " + partyNameView.lastName/></#if>
 
             <#-- NOTE: this is the to name -->
-            <of:NAME>${address.toName?default(partyName)?if_exists}</of:NAME>
+            <#assign toName = (address.toName)?default(partyName)?if_exists/>
+            <#if (toName?length > partnerNameSize)><#assign toName = (toName?substring(0,partnerNameSize))?if_exists/></#if>
+            <of:NAME>${toName?if_exists}</of:NAME>
             <of:PARTNRTYPE>SHIPTO</of:PARTNRTYPE>
             <of:CURRENCY>USD</of:CURRENCY>
             <os:ADDRESS>
-              <of:ADDRLINE>${address.address1?if_exists}</of:ADDRLINE>
-                <#if address.address2?exists>
-                  <of:ADDRLINE>${address.address2}</of:ADDRLINE>
-                </#if>
-              <of:CITY>${address.city?if_exists}</of:CITY>
-              <of:COUNTRY>${address.countryGeoId?if_exists}</of:COUNTRY>
-              <of:DESCRIPTN></of:DESCRIPTN>
-              <of:FAX></of:FAX>
+              <#assign address1 = address.address1?if_exists/>
+              <#if (address1?length > partnerAddressLineSize)><#assign address1 = (address1?substring(0,partnerAddressLineSize))?if_exists/></#if>
+              <of:ADDRLINE>${address1?if_exists}</of:ADDRLINE>
+              <#if address.address2?exists>
+                <#assign address2 = address.address2?if_exists/>
+                <#if (address2?length > partnerAddressLineSize)><#assign address2 = (address2?substring(0,partnerAddressLineSize))?if_exists/></#if>
+                <of:ADDRLINE>${address2}</of:ADDRLINE>
+              </#if>
+              <#assign city = address.city?if_exists/>
+              <#if (city?length > partnerAddressCitySize)><#assign city = (city?substring(0,partnerAddressCitySize))?if_exists/></#if>
+              <of:CITY>${city?if_exists}</of:CITY>
+              <#assign countryGeoId = address.countryGeoId?if_exists/>
+              <#if (countryGeoId?length > partnerAddressCountrySize)><#assign countryGeoId = (countryGeoId?substring(0,partnerAddressCountrySize))?if_exists/></#if>
+              <of:COUNTRY>${countryGeoId?if_exists}</of:COUNTRY>
+              <#--<of:DESCRIPTN></of:DESCRIPTN>
+              <of:FAX></of:FAX>-->
               <of:POSTALCODE>${address.postalCode?if_exists}</of:POSTALCODE>
               <of:STATEPROVN>${address.stateProvinceGeoId?if_exists}</of:STATEPROVN>
               <#if telecomNumber?has_content>
@@ -85,9 +107,11 @@
             </os:ADDRESS>
             <os:CONTACT>
               <#-- NOTE: this is the attention name -->
-              <of:NAME>${address.attnName?default(partyName)?if_exists}</of:NAME>
+              <#assign attnName = (address.attnName)?default(partyName)?if_exists/>
+              <#if (attnName?length > partnerContactNameSize)><#assign attnName = (attnName?substring(0,partnerContactNameSize))?if_exists/></#if>
+              <of:NAME>${attnName?if_exists}</of:NAME>
               <of:EMAIL>${emailString?if_exists}</of:EMAIL>
-              <of:FAX></of:FAX>
+              <#--<of:FAX></of:FAX>-->
               <of:TELEPHONE><#if telecomNumber.countryCode?has_content>${telecomNumber.countryCode}-</#if>${telecomNumber.areaCode?if_exists}-${telecomNumber.contactNumber?if_exists}</of:TELEPHONE>
             </os:CONTACT>
           </#if>