svn commit: r564373 - /ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportContactMechs.fo.ftl

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

svn commit: r564373 - /ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportContactMechs.fo.ftl

jacopoc
Author: jacopoc
Date: Thu Aug  9 13:26:41 2007
New Revision: 564373

URL: http://svn.apache.org/viewvc?view=rev&rev=564373
Log:
Improved fix for validation error when no address is available; thanks to Bilgin Ibryam for the review OFBIZ-1192

Modified:
    ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportContactMechs.fo.ftl

Modified: ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportContactMechs.fo.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportContactMechs.fo.ftl?view=diff&rev=564373&r1=564372&r2=564373
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportContactMechs.fo.ftl (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportContactMechs.fo.ftl Thu Aug  9 13:26:41 2007
@@ -17,17 +17,18 @@
 under the License.
 -->
 <#escape x as x?xml>
-       <#if orderHeader.getString("orderTypeId") == "PURCHASE_ORDER" || orderContactMechValueMaps?has_content>
        <fo:table border-spacing="3pt">
           <fo:table-column column-width="3.75in"/>
           <fo:table-column column-width="3.75in"/>
           <fo:table-body>
             <fo:table-row>    <#-- this part could use some improvement -->
             
+             <#assign createEmptyCell = true>
              <#-- a special purchased from address for Purchase Orders -->
              <#if orderHeader.getString("orderTypeId") == "PURCHASE_ORDER">
              <#if supplierGeneralContactMechValueMap?exists>
                <#assign contactMech = supplierGeneralContactMechValueMap.contactMech>
+               <#assign createEmptyCell = false>
                <fo:table-cell>
                  <fo:block>
                      ${uiLabelMap.OrderPurchasedFrom}:
@@ -44,6 +45,7 @@
                </fo:table-cell>
              <#else>
                <#-- here we just display the name of the vendor, since there is no address -->
+               <#assign createEmptyCell = false>
                <fo:table-cell>
                  <#assign vendorParty = orderReadHelper.getBillFromParty()>
                  <fo:block>
@@ -59,6 +61,7 @@
                <#assign contactMechPurpose = orderContactMechValueMap.contactMechPurposeType>
                <#if contactMech.contactMechTypeId == "POSTAL_ADDRESS">
                <#assign postalAddress = orderContactMechValueMap.postalAddress>
+               <#assign createEmptyCell = false>
                <fo:table-cell>
                  <fo:block font-weight="bold">${contactMechPurpose.get("description",locale)}:</fo:block>
                  <#if postalAddress?has_content>
@@ -71,11 +74,14 @@
                </fo:table-cell>
                </#if>
              </#list>
+             <#-- The empty cell is required in order to fill the table-row element and avoid a validation error -->
+             <#if createEmptyCell>
+             <fo:table-cell></fo:table-cell>
+             </#if>
             </fo:table-row>
          </fo:table-body>
        </fo:table>
        <fo:block white-space-collapse="false"> </fo:block>
-       </#if>
       
        <fo:table border-spacing="3pt">
           <fo:table-column column-width="1.75in"/>