svn commit: r432302 - in /incubator/ofbiz/trunk: applications/ecommerce/widget/ applications/order/webapp/ordermgr/order/ applications/order/widget/ordermgr/ framework/common/webcommon/includes/ framework/common/widget/

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

svn commit: r432302 - in /incubator/ofbiz/trunk: applications/ecommerce/widget/ applications/order/webapp/ordermgr/order/ applications/order/widget/ordermgr/ framework/common/webcommon/includes/ framework/common/widget/

jacopoc
Author: jacopoc
Date: Thu Aug 17 10:38:38 2006
New Revision: 432302

URL: http://svn.apache.org/viewvc?rev=432302&view=rev
Log:
Added new common template for document based pdf reports (sales and purchase orders, invoices, returns etc...).
Refactored the sales/purchase order pdf to use the common template.

Added:
    incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportBody.fo.ftl   (with props)
    incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportConditions.fo.ftl   (with props)
    incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportContactMechs.fo.ftl   (with props)
    incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportHeaderInfo.fo.ftl   (with props)
    incubator/ofbiz/trunk/framework/common/webcommon/includes/reportTemplate.fo.ftl   (with props)
Removed:
    incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderView.fo.ftl
Modified:
    incubator/ofbiz/trunk/applications/ecommerce/widget/EmailOrderScreens.xml
    incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/companyHeader.fo.ftl
    incubator/ofbiz/trunk/applications/order/widget/ordermgr/OrderPrintForms.xml
    incubator/ofbiz/trunk/framework/common/widget/CommonScreens.xml

Modified: incubator/ofbiz/trunk/applications/ecommerce/widget/EmailOrderScreens.xml
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/ecommerce/widget/EmailOrderScreens.xml?rev=432302&r1=432301&r2=432302&view=diff
==============================================================================
--- incubator/ofbiz/trunk/applications/ecommerce/widget/EmailOrderScreens.xml (original)
+++ incubator/ofbiz/trunk/applications/ecommerce/widget/EmailOrderScreens.xml Thu Aug 17 10:38:38 2006
@@ -32,7 +32,44 @@
                 <script location="component://order/webapp/ordermgr/WEB-INF/actions/order/orderview.bsh"/>
             </actions>
             <widgets>
-                <platform-specific><html><html-template location="component://order/webapp/ordermgr/order/orderView.fo.ftl"/></html></platform-specific>
+                <decorator-screen name="FoReportDecorator" location="component://common/widget/CommonScreens.xml">
+                    <!-- at the top left of every page we put the logo and company information -->
+                    <decorator-section name="topLeft">
+                        <section>
+                            <widgets>
+                                <include-screen name="CompanyLogo" location="component://order/widget/ordermgr/OrderPrintForms.xml"/>
+                            </widgets>
+                        </section>
+                    </decorator-section>
+                    <!-- at the top right of every page we put the order information -->
+                    <decorator-section name="topRight">
+                        <section>
+                            <widgets>
+                                <platform-specific>
+                                    <html><html-template location="component://order/webapp/ordermgr/order/orderReportHeaderInfo.fo.ftl"/></html>
+                                </platform-specific>
+                            </widgets>
+                        </section>
+                    </decorator-section>
+                    <decorator-section name="body">
+                        <section>
+                            <widgets>
+                                <!-- the contach mechanisms, terms, payment and shipping methods are shown in the first page -->
+                                <platform-specific>
+                                    <html><html-template location="component://order/webapp/ordermgr/order/orderReportContactMechs.fo.ftl"/></html>
+                                </platform-specific>
+                                <!-- order items and totals -->
+                                <platform-specific>
+                                    <html><html-template location="component://order/webapp/ordermgr/order/orderReportBody.fo.ftl"/></html>
+                                </platform-specific>
+                                <!-- return policies and notes are shown in the last page -->
+                                <platform-specific>
+                                    <html><html-template location="component://order/webapp/ordermgr/order/orderReportConditions.fo.ftl"/></html>
+                                </platform-specific>
+                            </widgets>
+                        </section>
+                    </decorator-section>
+                </decorator-screen>
             </widgets>
         </section>
     </screen>

Modified: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/companyHeader.fo.ftl
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/companyHeader.fo.ftl?rev=432302&r1=432301&r2=432302&view=diff
==============================================================================
--- incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/companyHeader.fo.ftl (original)
+++ incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/companyHeader.fo.ftl Thu Aug 17 10:38:38 2006
@@ -14,7 +14,7 @@
 License for the specific language governing permissions and limitations
 under the License.
 -->
-        <fo:table font-size="8pt"  font-family="sans-serif">
+        <fo:table font-size="8pt">
            <fo:table-column column-width="4.5in"/>
            <fo:table-column column-width="2in"/>
             <fo:table-body>

Added: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportBody.fo.ftl
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportBody.fo.ftl?rev=432302&view=auto
==============================================================================
--- incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportBody.fo.ftl (added)
+++ incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportBody.fo.ftl Thu Aug 17 10:38:38 2006
@@ -0,0 +1,145 @@
+<#--
+
+Copyright 2001-2006 The Apache Software Foundation
+
+Licensed 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.
+-->
+    <#if orderHeader?has_content>
+        <fo:table border-spacing="3pt">
+
+       <fo:table-column column-width="3.5in"/>
+       <fo:table-column column-width="1in"/>
+       <fo:table-column column-width="1in"/>
+       <fo:table-column column-width="1in"/>
+  
+       <fo:table-header>
+           <fo:table-row>
+               <fo:table-cell><fo:block font-weight="bold">${uiLabelMap.ProductProduct}</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-row>        
+       </fo:table-header>
+        
+            <fo:table-body>
+           <#list orderItemList as orderItem>
+                 <#assign orderItemType = orderItem.getRelatedOne("OrderItemType")?if_exists>
+                 <#assign productId = orderItem.productId?if_exists>
+                    <#assign remainingQuantity = (orderItem.quantity?default(0) - orderItem.cancelQuantity?default(0))>
+                 <#assign itemAdjustment = Static["org.ofbiz.order.order.OrderReadHelper"].getOrderItemAdjustmentsTotal(orderItem, orderAdjustments, true, false, false)>
+                  <fo:table-row>
+                        <fo:table-cell>
+                            <fo:block>
+                               <#if productId?exists>
+                                ${orderItem.productId?default("N/A")} - ${orderItem.itemDescription?xml?if_exists}
+                              <#elseif orderItemType?exists>
+                                ${orderItemType.get("description",locale)} - ${orderItem.itemDescription?xml?if_exists}
+                              <#else>
+                                ${orderItem.itemDescription?xml?if_exists}
+                              </#if>
+                               </fo:block>
+                          </fo:table-cell>
+                              <fo:table-cell text-align="right"><fo:block>${remainingQuantity}</fo:block></fo:table-cell>            
+                            <fo:table-cell text-align="right"><fo:block><@ofbizCurrency amount=orderItem.unitPrice isoCode=currencyUomId/></fo:block></fo:table-cell>
+                            <fo:table-cell text-align="right"><fo:block>
+                            <#if orderItem.statusId != "ITEM_CANCELLED">
+                                  <@ofbizCurrency amount=Static["org.ofbiz.order.order.OrderReadHelper"].getOrderItemSubTotal(orderItem, orderAdjustments) isoCode=currencyUomId/>
+                            <#else>
+                                <@ofbizCurrency amount=0.00 isoCode=currencyUomId/>
+                            </#if></fo:block></fo:table-cell>
+                       </fo:table-row>
+                       <#if itemAdjustment != 0>
+                       <fo:table-row>
+                        <fo:table-cell number-columns-spanned="2"><fo:block><fo:inline font-style="italic">${uiLabelMap.OrderAdjustments}</fo:inline>: <@ofbizCurrency amount=itemAdjustment isoCode=currencyUomId/></fo:block></fo:table-cell>
+                    </fo:table-row>
+                    </#if>
+           </#list>
+          <#list orderHeaderAdjustments as orderHeaderAdjustment>
+            <#assign adjustmentType = orderHeaderAdjustment.getRelatedOne("OrderAdjustmentType")>
+            <#assign adjustmentAmount = Static["org.ofbiz.order.order.OrderReadHelper"].calcOrderAdjustment(orderHeaderAdjustment, orderSubTotal)>
+            <#if adjustmentAmount != 0>
+            <fo:table-row>
+               <fo:table-cell></fo:table-cell>
+               <fo:table-cell number-columns-spanned="2"><fo:block font-weight="bold">${adjustmentType.get("description",locale)} : <#if orderHeaderAdjustment.get("description")?has_content>(${orderHeaderAdjustment.get("description")?if_exists})</#if> </fo:block></fo:table-cell>
+               <fo:table-cell text-align="right"><fo:block><@ofbizCurrency amount=adjustmentAmount isoCode=currencyUomId/></fo:block></fo:table-cell>
+            </fo:table-row>
+            </#if>
+          </#list>
+
+           <#-- summary of order amounts -->
+                    <fo:table-row>
+                        <fo:table-cell></fo:table-cell>
+                        <fo:table-cell number-columns-spanned="2"><fo:block font-weight="bold">${uiLabelMap.OrderItemsSubTotal}</fo:block></fo:table-cell>
+                        <fo:table-cell text-align="right"><fo:block><@ofbizCurrency amount=orderSubTotal isoCode=currencyUomId/></fo:block></fo:table-cell>
+                    </fo:table-row>
+                  <#if otherAdjAmount != 0>
+                    <fo:table-row>
+                        <fo:table-cell></fo:table-cell>
+                        <fo:table-cell number-columns-spanned="2"><fo:block font-weight="bold">${uiLabelMap.OrderTotalOtherOrderAdjustments}</fo:block></fo:table-cell>
+                        <fo:table-cell text-align="right"><fo:block><@ofbizCurrency amount=otherAdjAmount isoCode=currencyUomId/></fo:block></fo:table-cell>
+                    </fo:table-row>
+                  </#if>
+                  <#if shippingAmount != 0>
+                    <fo:table-row>
+                        <fo:table-cell></fo:table-cell>
+                        <fo:table-cell number-columns-spanned="2"><fo:block font-weight="bold">${uiLabelMap.OrderTotalShippingAndHandling}</fo:block></fo:table-cell>
+                        <fo:table-cell text-align="right"><fo:block><@ofbizCurrency amount=shippingAmount isoCode=currencyUomId/></fo:block></fo:table-cell>
+                    </fo:table-row>
+                  </#if>
+                  <#if taxAmount != 0>
+                    <fo:table-row>
+                        <fo:table-cell></fo:table-cell>
+                        <fo:table-cell number-columns-spanned="2"><fo:block font-weight="bold">${uiLabelMap.OrderTotalSalesTax}</fo:block></fo:table-cell>
+                        <fo:table-cell text-align="right"><fo:block><@ofbizCurrency amount=taxAmount isoCode=currencyUomId/></fo:block></fo:table-cell>
+                    </fo:table-row>
+                  </#if>
+                  <#if grandTotal != 0>
+                    <fo:table-row>
+                        <fo:table-cell></fo:table-cell>
+                        <fo:table-cell number-columns-spanned="2" background-color="#EEEEEE"><fo:block font-weight="bold">${uiLabelMap.OrderTotalDue}</fo:block></fo:table-cell>
+                        <fo:table-cell text-align="right"><fo:block><@ofbizCurrency amount=grandTotal isoCode=currencyUomId/></fo:block></fo:table-cell>
+                    </fo:table-row>
+                  </#if>
+
+           <#-- notes -->
+           <#if orderNotes?has_content>
+                   <fo:table-row >
+                       <fo:table-cell number-columns-spanned="3">
+                           <fo:block font-weight="bold">${uiLabelMap.OrderNotes}</fo:block>
+                       </fo:table-cell>    
+                   </fo:table-row>    
+                <#list orderNotes as note>
+                 <#if (note.internalNote?has_content) && (note.internalNote != "Y")>
+                    <fo:table-row>
+                        <fo:table-cell number-columns-spanned="6">
+                            <fo:block><fo:leader leader-length="19cm" leader-pattern="rule" /></fo:block>    
+                        </fo:table-cell>
+                    </fo:table-row>
+                    <fo:table-row>
+                        <fo:table-cell number-columns-spanned="1">
+                        <fo:block>${note.noteInfo?if_exists}</fo:block>    
+                    </fo:table-cell>
+                        <fo:table-cell number-columns-spanned="2">
+                        <#assign notePartyNameResult = dispatcher.runSync("getPartyNameForDate", Static["org.ofbiz.base.util.UtilMisc"].toMap("partyId", note.noteParty, "compareDate", note.noteDateTime, "lastNameFirst", "Y", "userLogin", userLogin))/>
+                        <fo:block>${uiLabelMap.CommonBy}: ${notePartyNameResult.fullName?default("${uiLabelMap.OrderPartyNameNotFound}")}</fo:block>
+                    </fo:table-cell>
+                        <fo:table-cell number-columns-spanned="1">
+                        <fo:block>${uiLabelMap.CommonAt}: ${note.noteDateTime?string?if_exists}</fo:block>    
+                    </fo:table-cell>
+                  </fo:table-row>
+                  </#if>                  
+                  </#list>
+            </#if>
+            </fo:table-body>
+    </fo:table>    
+    </#if>

Propchange: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportBody.fo.ftl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportBody.fo.ftl
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportBody.fo.ftl
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportConditions.fo.ftl
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportConditions.fo.ftl?rev=432302&view=auto
==============================================================================
--- incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportConditions.fo.ftl (added)
+++ incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportConditions.fo.ftl Thu Aug 17 10:38:38 2006
@@ -0,0 +1,27 @@
+<#--
+
+Copyright 2001-2006 The Apache Software Foundation
+
+Licensed 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.
+-->
+<fo:block space-after="40pt"/>
+<#if orderHeader.getString("orderTypeId") == "SALES_ORDER">
+  <fo:block font-size="14pt" font-weight="bold" text-align="center">THANK YOU FOR YOUR PATRONAGE!</fo:block>
+  <fo:block font-size="8pt">
+    Here is a good place to put policies and return information.
+  </fo:block>
+<#elseif orderHeader.getString("orderTypeId") == "PURCHASE_ORDER">
+  <fo:block font-size="8pt">
+    Here is a good place to put boilerplate terms and conditions for a purchase order.
+  </fo:block>
+</#if>

Propchange: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportConditions.fo.ftl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportConditions.fo.ftl
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportConditions.fo.ftl
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportContactMechs.fo.ftl
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportContactMechs.fo.ftl?rev=432302&view=auto
==============================================================================
--- incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportContactMechs.fo.ftl (added)
+++ incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportContactMechs.fo.ftl Thu Aug 17 10:38:38 2006
@@ -0,0 +1,107 @@
+<#--
+
+Copyright 2001-2006 The Apache Software Foundation
+
+Licensed 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.
+-->
+       <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 -->
+             <#list orderContactMechValueMaps as orderContactMechValueMap>
+               <#assign contactMech = orderContactMechValueMap.contactMech>
+               <#assign contactMechPurpose = orderContactMechValueMap.contactMechPurposeType>
+               <#if contactMech.contactMechTypeId == "POSTAL_ADDRESS">
+               <fo:table-cell>
+                 <fo:block white-space-collapse="false">
+<fo:block font-weight="bold">${contactMechPurpose.get("description",locale)} : </fo:block><#assign postalAddress = orderContactMechValueMap.postalAddress><#if postalAddress?has_content><#if postalAddress.toName?has_content>${postalAddress.toName}</#if><#if postalAddress.attnName?has_content>
+${postalAddress.attnName}</#if>
+${postalAddress.address1}<#if postalAddress.address2?has_content>
+${postalAddress.address2}</#if>
+${postalAddress.city}<#if postalAddress.stateProvinceGeoId?has_content>, ${postalAddress.stateProvinceGeoId} </#if></#if><#if postalAddress.postalCode?has_content>${postalAddress.postalCode}</#if>
+</fo:block>
+                </fo:table-cell>
+                </#if>
+             </#list>
+             <#if orderHeader.getString("orderTypeId") == "PURCHASE_ORDER">
+             <#if supplierGeneralContactMechValueMap?exists>
+               <#assign contactMech = supplierGeneralContactMechValueMap.contactMech>
+               <fo:table-cell>
+                 <fo:block white-space-collapse="false">
+<fo:block font-weight="bold">${uiLabelMap.ProductSupplier}:</fo:block><#assign postalAddress = supplierGeneralContactMechValueMap.postalAddress><#if postalAddress?has_content><#if postalAddress.toName?has_content>${postalAddress.toName}</#if><#if postalAddress.attnName?has_content>
+${postalAddress.attnName}</#if>
+${postalAddress.address1}<#if postalAddress.address2?has_content>
+${postalAddress.address2}</#if>
+${postalAddress.city}<#if postalAddress.stateProvinceGeoId?has_content>, ${postalAddress.stateProvinceGeoId} </#if></#if><#if postalAddress.postalCode?has_content>${postalAddress.postalCode}</#if>
+</fo:block>
+               </fo:table-cell>
+             </#if>
+             </#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>
+            <fo:table-row>
+                <fo:table-cell><fo:block>${uiLabelMap.AccountingPaymentInformation}</fo:block></fo:table-cell>
+                <fo:table-cell><fo:block>
+                   <#if orderPaymentPreferences?has_content>
+                      <#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>
+                   </#if>
+                         </fo:block>
+                 </fo:table-cell>
+            </fo:table-row>
+        <#-- 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>${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>
+                      ${shipGroup.shipmentMethodTypeId?if_exists}
+                     </fo:block>
+                   </#list>
+                  </#if>
+               </fo:table-cell>
+             </fo:table-row>
+           </#if>
+       <#-- order terms information -->
+             <#if orderTerms?has_content>
+             <fo:table-row>
+               <fo:table-cell><fo:block>${uiLabelMap.OrderOrderTerms}: </fo:block></fo:table-cell>
+               <fo:table-cell white-space-collapse="false"><fo:block><#list orderTerms as orderTerm>${orderTerm.getRelatedOne("TermType").get("description",locale)} ${orderTerm.termValue?default("")} ${orderTerm.termDays?default("")}
+</#list></fo:block></fo:table-cell>
+             </fo:table-row>
+             </#if>
+          </fo:table-body>
+       </fo:table>
+
+<fo:block space-after="10pt"/>
\ No newline at end of file

Propchange: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportContactMechs.fo.ftl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportContactMechs.fo.ftl
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportContactMechs.fo.ftl
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportHeaderInfo.fo.ftl
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportHeaderInfo.fo.ftl?rev=432302&view=auto
==============================================================================
--- incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportHeaderInfo.fo.ftl (added)
+++ incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportHeaderInfo.fo.ftl Thu Aug 17 10:38:38 2006
@@ -0,0 +1,44 @@
+<#--
+
+Copyright 2001-2006 The Apache Software Foundation
+
+Licensed 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.
+-->
+                  <fo:table>
+                    <fo:table-column column-width="1.5in"/>
+                    <fo:table-column column-width="1.5in"/>
+                    <fo:table-body>
+                    <fo:table-row>
+                      <fo:table-cell>
+                         <fo:block number-columns-spanned="2" font-weight="bold">${orderHeader.getRelatedOne("OrderType").get("description",locale)} ${uiLabelMap.OrderOrder}</fo:block>
+                      </fo:table-cell>
+                    </fo:table-row>
+                    
+                    <fo:table-row>
+                      <fo:table-cell><fo:block>${uiLabelMap.OrderDateOrdered}</fo:block></fo:table-cell>
+                      <#assign dateFormat = Static["java.text.DateFormat"].LONG>
+                      <#assign orderDate = Static["java.text.DateFormat"].getDateInstance(dateFormat).format(orderHeader.get("orderDate"))>
+                      <fo:table-cell><fo:block>${orderDate}</fo:block></fo:table-cell>
+                    </fo:table-row>
+                                  
+                    <fo:table-row>
+                      <fo:table-cell><fo:block>${uiLabelMap.OrderOrder} #</fo:block></fo:table-cell>
+                      <fo:table-cell><fo:block>${orderId}</fo:block></fo:table-cell>
+                    </fo:table-row>
+
+                    <fo:table-row>
+                      <fo:table-cell><fo:block>${uiLabelMap.OrderCurrentStatus}</fo:block></fo:table-cell>
+                      <fo:table-cell><fo:block font-weight="bold">${currentStatus.get("description",locale)}</fo:block></fo:table-cell>
+                    </fo:table-row>
+                  </fo:table-body>
+                </fo:table>

Propchange: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportHeaderInfo.fo.ftl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportHeaderInfo.fo.ftl
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/order/orderReportHeaderInfo.fo.ftl
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/ofbiz/trunk/applications/order/widget/ordermgr/OrderPrintForms.xml
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/widget/ordermgr/OrderPrintForms.xml?rev=432302&r1=432301&r2=432302&view=diff
==============================================================================
--- incubator/ofbiz/trunk/applications/order/widget/ordermgr/OrderPrintForms.xml (original)
+++ incubator/ofbiz/trunk/applications/order/widget/ordermgr/OrderPrintForms.xml Thu Aug 17 10:38:38 2006
@@ -29,14 +29,48 @@
                 <property-map resource="OrderUiLabels" map-name="uiLabelMap" global="true"/>
                 <property-map resource="AccountingUiLabels" map-name="uiLabelMap" global="true"/>
                 <property-map resource="ProductUiLabels" map-name="uiLabelMap" global="true"/>
-                <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
                 
                 <script location="component://order/webapp/ordermgr/WEB-INF/actions/order/orderview.bsh"/>
             </actions>
             <widgets>
-                <platform-specific>
-                    <html><html-template location="component://order/webapp/ordermgr/order/orderView.fo.ftl"/></html>
-                </platform-specific>                
+                <decorator-screen name="FoReportDecorator" location="component://common/widget/CommonScreens.xml">
+                    <!-- at the top left of every page we put the logo and company information -->
+                    <decorator-section name="topLeft">
+                        <section>
+                            <widgets>
+                                <include-screen name="CompanyLogo" location="component://order/widget/ordermgr/OrderPrintForms.xml"/>
+                            </widgets>
+                        </section>
+                    </decorator-section>
+                    <!-- at the top right of every page we put the order information -->
+                    <decorator-section name="topRight">
+                        <section>
+                            <widgets>
+                                <platform-specific>
+                                    <html><html-template location="component://order/webapp/ordermgr/order/orderReportHeaderInfo.fo.ftl"/></html>
+                                </platform-specific>
+                            </widgets>
+                        </section>
+                    </decorator-section>
+                    <decorator-section name="body">
+                        <section>
+                            <widgets>
+                                <!-- the contach mechanisms, terms, payment and shipping methods are shown in the first page -->
+                                <platform-specific>
+                                    <html><html-template location="component://order/webapp/ordermgr/order/orderReportContactMechs.fo.ftl"/></html>
+                                </platform-specific>
+                                <!-- order items and totals -->
+                                <platform-specific>
+                                    <html><html-template location="component://order/webapp/ordermgr/order/orderReportBody.fo.ftl"/></html>
+                                </platform-specific>
+                                <!-- return policies and notes are shown in the last page -->
+                                <platform-specific>
+                                    <html><html-template location="component://order/webapp/ordermgr/order/orderReportConditions.fo.ftl"/></html>
+                                </platform-specific>
+                            </widgets>
+                        </section>
+                    </decorator-section>
+                </decorator-screen>
             </widgets>
         </section>
     </screen>

Added: incubator/ofbiz/trunk/framework/common/webcommon/includes/reportTemplate.fo.ftl
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/framework/common/webcommon/includes/reportTemplate.fo.ftl?rev=432302&view=auto
==============================================================================
--- incubator/ofbiz/trunk/framework/common/webcommon/includes/reportTemplate.fo.ftl (added)
+++ incubator/ofbiz/trunk/framework/common/webcommon/includes/reportTemplate.fo.ftl Thu Aug 17 10:38:38 2006
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<#--
+
+Copyright 2001-2006 The Apache Software Foundation
+
+Licensed 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.
+-->
+
+<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
+    <fo:layout-master-set>
+        <fo:simple-page-master master-name="main-page"
+              page-width="8.5in" page-height="11in"
+              margin-top="0.4in" margin-bottom="0.4in"
+              margin-left="0.6in" margin-right="0.4in">
+            <#-- main body -->
+            <fo:region-body margin-top="1.2in" margin-bottom="0.4in"/>
+            <#-- the header -->
+            <fo:region-before extent="1.2in"/>
+            <#-- the footer -->
+            <fo:region-after extent="0.4in"/>
+        </fo:simple-page-master>
+    </fo:layout-master-set>
+  
+    <fo:page-sequence master-reference="main-page">
+
+        <#-- the header -->
+        <fo:static-content flow-name="xsl-region-before">
+            <fo:table>
+                <fo:table-column column-width="3.5in"/>
+                <fo:table-column column-width="3in"/>
+                <fo:table-body>
+                    <fo:table-row>
+                        <fo:table-cell>
+${sections.render("topLeft")}
+                        </fo:table-cell>
+                        <fo:table-cell>
+${sections.render("topRight")}
+                        </fo:table-cell>
+                    </fo:table-row>
+                </fo:table-body>
+            </fo:table>
+        </fo:static-content>
+
+        <#-- the footer -->
+        <fo:static-content flow-name="xsl-region-after">
+            <fo:block font-size="10pt" text-align="center" space-before="10pt">
+                Page <fo:page-number/> of <fo:page-number-citation ref-id="theEnd"/>
+            </fo:block>
+        </fo:static-content>
+
+        <#-- the body -->
+        <fo:flow flow-name="xsl-region-body">
+${sections.render("body")}
+            <fo:block id="theEnd"/>  <#-- marks the end of the pages and used to identify page-number at the end -->
+        </fo:flow>
+    </fo:page-sequence>
+</fo:root>

Propchange: incubator/ofbiz/trunk/framework/common/webcommon/includes/reportTemplate.fo.ftl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/ofbiz/trunk/framework/common/webcommon/includes/reportTemplate.fo.ftl
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: incubator/ofbiz/trunk/framework/common/webcommon/includes/reportTemplate.fo.ftl
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: incubator/ofbiz/trunk/framework/common/widget/CommonScreens.xml
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/framework/common/widget/CommonScreens.xml?rev=432302&r1=432301&r2=432302&view=diff
==============================================================================
--- incubator/ofbiz/trunk/framework/common/widget/CommonScreens.xml (original)
+++ incubator/ofbiz/trunk/framework/common/widget/CommonScreens.xml Thu Aug 17 10:38:38 2006
@@ -162,6 +162,20 @@
         </section>
     </screen>
 
+    <!-- fo decorator for pdf documents (invoices, sales orders, purchase orders etc...). -->
+    <screen name="FoReportDecorator">
+        <section>
+            <actions>
+                <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
+                <set field="logoImageUrl" value="http://localhost:8080/images/ofbiz_logo.jpg"/>
+            </actions>
+            <widgets>
+                <platform-specific><html><html-template location="component://common/webcommon/includes/reportTemplate.fo.ftl"/></html></platform-specific>
+            </widgets>
+        </section>
+    </screen>
+
+
     <!-- Simple fo decorator for pdf reports. -->
     <screen name="FoDecorator">
         <section>