svn commit: r889897 - in /ofbiz/trunk/applications/order/webapp/ordermgr/order: orderReportBody.fo.ftl 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: r889897 - in /ofbiz/trunk/applications/order/webapp/ordermgr/order: orderReportBody.fo.ftl orderReportContactMechs.fo.ftl

jacopoc
Author: jacopoc
Date: Sat Dec 12 08:36:06 2009
New Revision: 889897

URL: http://svn.apache.org/viewvc?rev=889897&view=rev
Log:
Refactored layout implementation of the top part of the sales order PDF report: migration from table based layout to block based layout.
Small enhancement to the layout.
Added more information about ship groups (ship before/after and ship group id, if there are more than one groups).

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

Modified: ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportBody.fo.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportBody.fo.ftl?rev=889897&r1=889896&r2=889897&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportBody.fo.ftl (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportBody.fo.ftl Sat Dec 12 08:36:06 2009
@@ -20,7 +20,7 @@
     <#if orderHeader?has_content>
         <fo:table border-spacing="3pt">
 
-       <fo:table-column column-width="3.5in"/>
+       <fo:table-column column-width="4in"/>
        <fo:table-column column-width="1in"/>
        <fo:table-column column-width="1in"/>
        <fo:table-column column-width="1in"/>
@@ -28,9 +28,9 @@
        <fo:table-header>
            <fo:table-row>
                <fo:table-cell><fo:block font-weight="bold">${uiLabelMap.OrderProduct}</fo:block></fo:table-cell>
-               <fo:table-cell text-align="center"><fo:block font-weight="bold">${uiLabelMap.OrderQuantity}</fo:block></fo:table-cell>
-               <fo:table-cell text-align="center"><fo:block font-weight="bold">${uiLabelMap.OrderUnitList}</fo:block></fo:table-cell>
-               <fo:table-cell text-align="center"><fo:block font-weight="bold">${uiLabelMap.OrderSubTotal}</fo:block></fo:table-cell>
+               <fo:table-cell text-align="right"><fo:block font-weight="bold">${uiLabelMap.OrderQuantity}</fo:block></fo:table-cell>
+               <fo:table-cell text-align="right"><fo:block font-weight="bold">${uiLabelMap.OrderUnitList}</fo:block></fo:table-cell>
+               <fo:table-cell text-align="right"><fo:block font-weight="bold">${uiLabelMap.OrderSubTotal}</fo:block></fo:table-cell>
            </fo:table-row>
        </fo:table-header>
 

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?rev=889897&r1=889896&r2=889897&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportContactMechs.fo.ftl (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportContactMechs.fo.ftl Sat Dec 12 08:36:06 2009
@@ -17,137 +17,102 @@
 under the License.
 -->
 <#escape x as x?xml>
-       <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}:
-                 </fo:block>
-                 <#assign postalAddress = supplierGeneralContactMechValueMap.postalAddress>
-                 <#if postalAddress?has_content>
-                   <#if postalAddress.toName?has_content><fo:block>${postalAddress.toName}</fo:block></#if>
-                   <#if postalAddress.attnName?has_content><fo:block>${postalAddress.attnName?if_exists}</fo:block></#if>
-                   <fo:block>${postalAddress.address1?if_exists}</fo:block>
-                   <#if postalAddress.address2?has_content><fo:block>${postalAddress.address2?if_exists}</fo:block></#if>
-                   <fo:block>
-                     <#assign stateGeo = (delegator.findOne("Geo", {"geoId", postalAddress.stateProvinceGeoId?if_exists}, false))?if_exists />
-                     ${postalAddress.city}<#if stateGeo?has_content>, ${stateGeo.geoName?if_exists}</#if> ${postalAddress.postalCode?if_exists}
-                   </fo:block>
-                   <fo:block>
-                     <#assign countryGeo = (delegator.findOne("Geo", {"geoId", postalAddress.countryGeoId?if_exists}, false))?if_exists />
-                     <#if countryGeo?has_content>${countryGeo.geoName?if_exists}</#if>
-                   </fo:block>
-                 </#if>
-               </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>
-                   <fo:inline font-weight="bold">${uiLabelMap.OrderPurchasedFrom}:</fo:inline> ${Static['org.ofbiz.party.party.PartyHelper'].getPartyName(vendorParty)}
-                 </fo:block>
-               </fo:table-cell>
-             </#if>
-             </#if>
-
-             <#-- list all postal addresses of the order.  there should be just a billing and a shipping here. -->
-             <#list orderContactMechValueMaps as orderContactMechValueMap>
-               <#assign contactMech = orderContactMechValueMap.contactMech>
-               <#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>
-                   <#if postalAddress.toName?has_content><fo:block>${postalAddress.toName?if_exists}</fo:block></#if>
-                   <#if postalAddress.attnName?has_content><fo:block>${postalAddress.attnName?if_exists}</fo:block></#if>
-                   <fo:block>${postalAddress.address1?if_exists}</fo:block>
-                   <#if postalAddress.address2?has_content><fo:block>${postalAddress.address2?if_exists}</fo:block></#if>
-                   <fo:block>
-                     <#assign stateGeo = (delegator.findOne("Geo", {"geoId", postalAddress.stateProvinceGeoId?if_exists}, false))?if_exists />
-                     ${postalAddress.city}<#if stateGeo?has_content>, ${stateGeo.geoName?if_exists}</#if> ${postalAddress.postalCode?if_exists}
-                   </fo:block>
-                   <fo:block>
-                     <#assign countryGeo = (delegator.findOne("Geo", {"geoId", postalAddress.countryGeoId?if_exists}, false))?if_exists />
-                     <#if countryGeo?has_content>${countryGeo.geoName?if_exists}</#if>
-                   </fo:block>
-                 </#if>
-               </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>
-
-       <fo:table border-spacing="3pt">
-          <fo:table-column column-width="1.75in"/>
-          <fo:table-column column-width="4.25in"/>
-
-  <#-- payment info -->
-          <fo:table-body>
-           <#if orderPaymentPreferences?has_content>
-            <fo:table-row>
-                <fo:table-cell><fo:block font-weight="bold">${uiLabelMap.AccountingPaymentInformation}:</fo:block></fo:table-cell>
-                <fo:table-cell><fo:block>
-                      <#list orderPaymentPreferences as orderPaymentPreference>
-                         <#assign paymentMethodType = orderPaymentPreference.getRelatedOne("PaymentMethodType")?if_exists>
-                         <#if ((orderPaymentPreference != null) && (orderPaymentPreference.getString("paymentMethodTypeId") == "CREDIT_CARD") && (orderPaymentPreference.getString("paymentMethodId")?has_content))>
-                           <#assign creditCard = orderPaymentPreference.getRelatedOne("PaymentMethod").getRelatedOne("CreditCard")>
-                             ${Static["org.ofbiz.party.contact.ContactHelper"].formatCreditCard(creditCard)}
-                         <#else>
-                             ${paymentMethodType.get("description",locale)?if_exists}
-                         </#if>
-                      </#list>
-                      </fo:block>
-                 </fo:table-cell>
-            </fo:table-row>
-         </#if>
-
-        <#-- shipping method.  currently not shown for PO's because we are not recording a shipping method for PO's in order entry -->
-           <#if orderHeader.getString("orderTypeId") == "SALES_ORDER">
-            <fo:table-row>
-               <fo:table-cell><fo:block font-weight="bold">${uiLabelMap.OrderShipmentInformation}:</fo:block></fo:table-cell>
-                  <fo:table-cell>
-                 <#if shipGroups?has_content>
-                   <#list shipGroups as shipGroup>
-                   <#-- TODO: List all full details of each ship group here -->
-                        <fo:block>
-                      <#if (shipGroup.shipmentMethodTypeId)?exists>
-                        ${(shipGroup.getRelatedOne("ShipmentMethodType").get("description", locale))?default(shipGroup.shipmentMethodTypeId)}
-                      </#if>
-                     </fo:block>
-                   </#list>
-                  </#if>
-               </fo:table-cell>
-             </fo:table-row>
-           </#if>
-       <#-- order terms information -->
-             <#if orderTerms?exists?has_content>
-             <fo:table-row>
-               <fo:table-cell><fo:block font-weight="bold">${uiLabelMap.OrderOrderTerms}: </fo:block></fo:table-cell>
-               <fo:table-cell white-space-collapse="false"><#list orderTerms as orderTerm><fo:block>${orderTerm.getRelatedOne("TermType").get("description",locale)} ${orderTerm.termValue?default("")} ${orderTerm.termDays?default("")} ${orderTerm.textValue?default("")}
-</fo:block></#list></fo:table-cell>
-             </fo:table-row>
-             </#if>
-          </fo:table-body>
-       </fo:table>
 
-<fo:block space-after="10pt"/>
+<#if orderHeader.getString("orderTypeId") == "PURCHASE_ORDER">
+    <#if supplierGeneralContactMechValueMap?exists>
+        <#assign contactMech = supplierGeneralContactMechValueMap.contactMech>
+        <fo:block font-weight="bold">${uiLabelMap.OrderPurchasedFrom}:</fo:block>
+        <#assign postalAddress = supplierGeneralContactMechValueMap.postalAddress>
+        <#if postalAddress?has_content>
+            <fo:block text-indent="0.2in">
+                <#if postalAddress.toName?has_content><fo:block>${postalAddress.toName}</fo:block></#if>
+                <#if postalAddress.attnName?has_content><fo:block>${postalAddress.attnName?if_exists}</fo:block></#if>
+                <fo:block>${postalAddress.address1?if_exists}</fo:block>
+                <#if postalAddress.address2?has_content><fo:block>${postalAddress.address2?if_exists}</fo:block></#if>
+                <fo:block>
+                    <#assign stateGeo = (delegator.findOne("Geo", {"geoId", postalAddress.stateProvinceGeoId?if_exists}, false))?if_exists />
+                    ${postalAddress.city}<#if stateGeo?has_content>, ${stateGeo.geoName?if_exists}</#if> ${postalAddress.postalCode?if_exists}
+                </fo:block>
+                <fo:block>
+                    <#assign countryGeo = (delegator.findOne("Geo", {"geoId", postalAddress.countryGeoId?if_exists}, false))?if_exists />
+                    <#if countryGeo?has_content>${countryGeo.geoName?if_exists}</#if>
+                </fo:block>
+            </fo:block>                
+        </#if>
+    <#else>
+        <#-- here we just display the name of the vendor, since there is no address -->
+        <#assign vendorParty = orderReadHelper.getBillFromParty()>
+        <fo:block>
+            <fo:inline font-weight="bold">${uiLabelMap.OrderPurchasedFrom}:</fo:inline> ${Static['org.ofbiz.party.party.PartyHelper'].getPartyName(vendorParty)}
+        </fo:block>
+    </#if>
+</#if>
+
+<#-- list all postal addresses of the order.  there should be just a billing and a shipping here. -->
+<#list orderContactMechValueMaps as orderContactMechValueMap>
+    <#assign contactMech = orderContactMechValueMap.contactMech>
+    <#assign contactMechPurpose = orderContactMechValueMap.contactMechPurposeType>
+    <#if contactMech.contactMechTypeId == "POSTAL_ADDRESS">
+        <#assign postalAddress = orderContactMechValueMap.postalAddress>
+        <fo:block font-weight="bold">${contactMechPurpose.get("description",locale)}:</fo:block>
+        <fo:block text-indent="0.2in">
+            <#if postalAddress?has_content>
+                <#if postalAddress.toName?has_content><fo:block>${postalAddress.toName?if_exists}</fo:block></#if>
+                <#if postalAddress.attnName?has_content><fo:block>${postalAddress.attnName?if_exists}</fo:block></#if>
+                <fo:block>${postalAddress.address1?if_exists}</fo:block>
+                <#if postalAddress.address2?has_content><fo:block>${postalAddress.address2?if_exists}</fo:block></#if>
+                <fo:block>
+                    <#assign stateGeo = (delegator.findOne("Geo", {"geoId", postalAddress.stateProvinceGeoId?if_exists}, false))?if_exists />
+                    ${postalAddress.city}<#if stateGeo?has_content>, ${stateGeo.geoName?if_exists}</#if> ${postalAddress.postalCode?if_exists}
+                </fo:block>
+                <fo:block>
+                    <#assign countryGeo = (delegator.findOne("Geo", {"geoId", postalAddress.countryGeoId?if_exists}, false))?if_exists />
+                    <#if countryGeo?has_content>${countryGeo.geoName?if_exists}</#if>
+                </fo:block>
+            </#if>
+        </fo:block>
+    </#if>
+</#list>
+
+<fo:block space-after="0.2in"/>
+
+<#if orderPaymentPreferences?has_content>
+    <fo:block font-weight="bold">${uiLabelMap.AccountingPaymentInformation}:</fo:block>
+    <#list orderPaymentPreferences as orderPaymentPreference>
+        <fo:block text-indent="0.2in">
+            <#assign paymentMethodType = orderPaymentPreference.getRelatedOne("PaymentMethodType")?if_exists>
+            <#if ((orderPaymentPreference != null) && (orderPaymentPreference.getString("paymentMethodTypeId") == "CREDIT_CARD") && (orderPaymentPreference.getString("paymentMethodId")?has_content))>
+                <#assign creditCard = orderPaymentPreference.getRelatedOne("PaymentMethod").getRelatedOne("CreditCard")>
+                ${Static["org.ofbiz.party.contact.ContactHelper"].formatCreditCard(creditCard)}
+            <#else>
+                ${paymentMethodType.get("description",locale)?if_exists}
+            </#if>
+        </fo:block>
+    </#list>
+</#if>
+<#if orderHeader.getString("orderTypeId") == "SALES_ORDER" && shipGroups?exists?has_content>
+    <fo:block font-weight="bold">${uiLabelMap.OrderShipmentInformation}:</fo:block>
+    <#list shipGroups as shipGroup>
+        <fo:block text-indent="0.2in">
+            <#if shipGroups.size() gt 1>${shipGroup.shipGroupSeqId} - </#if>
+            <#if (shipGroup.shipmentMethodTypeId)?exists>
+                ${(shipGroup.getRelatedOne("ShipmentMethodType").get("description", locale))?default(shipGroup.shipmentMethodTypeId)}
+            </#if>
+            <#if (shipGroup.shipAfterDate)?exists || (shipGroup.shipByDate)?exists>
+                <#if (shipGroup.shipAfterDate)?exists> - ${uiLabelMap.OrderShipAfterDate}: ${Static["org.ofbiz.base.util.UtilDateTime"].toDateString(shipGroup.shipAfterDate)}</#if><#if (shipGroup.shipByDate)?exists> - ${uiLabelMap.OrderShipBeforeDate}: ${Static["org.ofbiz.base.util.UtilDateTime"].toDateString(shipGroup.shipByDate)}</#if>
+            </#if>
+        </fo:block>
+    </#list>
+</#if>
+
+<#if orderTerms?exists?has_content && orderTerms.size() gt 0>
+    <fo:block font-weight="bold">${uiLabelMap.OrderOrderTerms}:</fo:block>
+    <#list orderTerms as orderTerm>
+        <fo:block text-indent="0.2in">
+            ${orderTerm.getRelatedOne("TermType").get("description",locale)} ${orderTerm.termValue?default("")} ${orderTerm.termDays?default("")} ${orderTerm.textValue?default("")}
+        </fo:block>
+    </#list>
+</#if>
+
+<fo:block space-after="0.2in"/>
 </#escape>