svn commit: r432830 - in /incubator/ofbiz/trunk/applications/order: webapp/ordermgr/return/ widget/ordermgr/

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

svn commit: r432830 - in /incubator/ofbiz/trunk/applications/order: webapp/ordermgr/return/ widget/ordermgr/

jacopoc
Author: jacopoc
Date: Sat Aug 19 04:54:59 2006
New Revision: 432830

URL: http://svn.apache.org/viewvc?rev=432830&view=rev
Log:
Applied patch from Christian Geisert (OFBIZ-167) to refactor the return pdf into smaller fo.ftl templates included into the new fo global decorator.
There are still some minor layout issues mostly due to the different page dimension of the global decorator template.

Added:
    incubator/ofbiz/trunk/applications/order/webapp/ordermgr/return/returnReportBody.fo.ftl   (with props)
    incubator/ofbiz/trunk/applications/order/webapp/ordermgr/return/returnReportConditions.fo.ftl   (with props)
    incubator/ofbiz/trunk/applications/order/webapp/ordermgr/return/returnReportContactMechs.fo.ftl   (with props)
    incubator/ofbiz/trunk/applications/order/webapp/ordermgr/return/returnReportHeaderInfo.fo.ftl   (with props)
Removed:
    incubator/ofbiz/trunk/applications/order/webapp/ordermgr/return/returnView.fo.ftl
Modified:
    incubator/ofbiz/trunk/applications/order/widget/ordermgr/OrderPrintForms.xml

Added: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/return/returnReportBody.fo.ftl
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/webapp/ordermgr/return/returnReportBody.fo.ftl?rev=432830&view=auto
==============================================================================
--- incubator/ofbiz/trunk/applications/order/webapp/ordermgr/return/returnReportBody.fo.ftl (added)
+++ incubator/ofbiz/trunk/applications/order/webapp/ordermgr/return/returnReportBody.fo.ftl Sat Aug 19 04:54:59 2006
@@ -0,0 +1,114 @@
+<#--
+
+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.
+-->
+<#macro displayReturnAdjustment returnAdjustment>
+    <#assign returnHeader = returnAdjustment.getRelatedOne("ReturnHeader")>
+    <#assign adjReturnType = returnAdjustment.getRelatedOne("ReturnType")?if_exists>
+    <fo:table-row>
+    <fo:table-cell padding="1mm"/>
+    <fo:table-cell padding="1mm"/>
+    <fo:table-cell number-columns-spanned="3" padding="1mm">
+      <fo:block wrap-option="wrap">
+        <#if returnAdjustment.comments?has_content>${returnAdjustment.comments}<#else>${returnAdjustment.description?default("N/A")}</#if>
+      </fo:block>
+    </fo:table-cell>
+    <fo:table-cell padding="1mm" text-align="right"><fo:block><@ofbizCurrency amount=returnAdjustment.amount isoCode=returnHeader.currencyUomId/></fo:block></fo:table-cell>
+    </fo:table-row>
+    <#assign total = total + returnAdjustment.get("amount")>
+</#macro>
+
+      <#-- Items returned -->
+      <fo:block font-size="10pt">
+        <fo:table border-style="solid" border-width="0.2pt" height="5in">
+          <fo:table-column column-width="0.85in"/>
+          <fo:table-column column-width="0.85in"/>
+          <fo:table-column column-width="2in"/>
+          <fo:table-column column-width="0.5in"/>
+          <fo:table-column column-width="0.85in"/>
+          <fo:table-column column-width="0.85in"/>
+          <fo:table-body>
+
+            <fo:table-row text-align="center" font-weight="bold">
+              <fo:table-cell padding="1mm" border-style="solid" border-width="0.2pt" display-align="after"><fo:block>${uiLabelMap.OrderOrderId}</fo:block></fo:table-cell>
+              <fo:table-cell padding="1mm" border-style="solid" border-width="0.2pt" display-align="after"><fo:block>${uiLabelMap.ProductProductId}</fo:block></fo:table-cell>
+              <fo:table-cell padding="1mm" border-style="solid" border-width="0.2pt" display-align="after"><fo:block>${uiLabelMap.CommonDescription}</fo:block></fo:table-cell>
+              <fo:table-cell padding="1mm" border-style="solid" border-width="0.2pt" display-align="after"><fo:block>${uiLabelMap.OrderQty}</fo:block></fo:table-cell>
+              <fo:table-cell padding="1mm" border-style="solid" border-width="0.2pt" display-align="after"><fo:block>${uiLabelMap.OrderUnitPrice}</fo:block></fo:table-cell>
+              <fo:table-cell padding="1mm" border-style="solid" border-width="0.2pt" display-align="after"><fo:block>${uiLabelMap.OrderAmount}</fo:block></fo:table-cell>
+            </fo:table-row>
+
+            <#-- each item -->
+            <#assign total = 0.0/>
+            <#list returnItems as returnItem>
+              <fo:table-row>
+                <fo:table-cell padding="1mm" font-size="8pt">
+                  <fo:block>${returnItem.orderId}</fo:block>
+                </fo:table-cell>
+                <fo:table-cell padding="1mm" font-size="8pt">
+                  <fo:block>
+                    <#if returnItem.orderItemSeqId?exists>${returnItem.getRelatedOne("OrderItem").getString("productId")}</#if>
+                  </fo:block>
+                </fo:table-cell>
+                <fo:table-cell padding="1mm"><fo:block wrap-option="wrap">${returnItem.description}</fo:block></fo:table-cell>
+                <fo:table-cell padding="1mm" text-align="right"><fo:block>${returnItem.returnQuantity}</fo:block></fo:table-cell>
+                <fo:table-cell padding="1mm" text-align="right"><fo:block><@ofbizCurrency amount=returnItem.returnPrice isoCode=returnHeader.currencyUomId/></fo:block></fo:table-cell>
+                <fo:table-cell padding="1mm" text-align="right"><fo:block><@ofbizCurrency amount=(returnItem.returnPrice * returnItem.returnQuantity) isoCode=returnHeader.currencyUomId/></fo:block></fo:table-cell>
+              </fo:table-row>
+              <#assign total = total + returnItem.returnQuantity.doubleValue() * returnItem.returnPrice.doubleValue()/>
+              
+              <#assign returnItemAdjustments = returnItem.getRelated("ReturnAdjustment")>
+              <#if (returnItemAdjustments?has_content)>
+                  <#list returnItemAdjustments as returnItemAdjustment>
+                     <@displayReturnAdjustment returnAdjustment=returnItemAdjustment/>
+                  </#list>
+              </#if>
+            </#list>
+            
+            <#-- order level adjustments -->
+            <#if (returnAdjustments?has_content)>                  
+                <#list returnAdjustments as returnAdjustment>
+                    <@displayReturnAdjustment returnAdjustment=returnAdjustment/>
+                </#list>
+            </#if>
+
+        </fo:table-body>
+        </fo:table>
+      </fo:block>
+
+      <#-- total -->
+        <fo:table space-before="5mm" font-size="10pt">
+          <fo:table-column column-width="0.85in"/>
+          <fo:table-column column-width="0.85in"/>
+          <fo:table-column column-width="2in"/>
+          <fo:table-column column-width="0.5in"/>
+          <fo:table-column column-width="0.85in"/>
+          <fo:table-column column-width="0.85in"/>
+          <fo:table-body>
+            <fo:table-row>
+              <fo:table-cell/>
+              <fo:table-cell/>
+              <fo:table-cell/>
+              <fo:table-cell/>
+              <fo:table-cell padding="1mm" border-style="solid" border-width="0.2pt">
+                <fo:block font-weight="bold" text-align="center">${uiLabelMap.CommonTotal}</fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="right" padding="1mm" border-style="solid" border-width="0.2pt">
+                <fo:block><@ofbizCurrency amount=total isoCode=returnHeader.currencyUomId/></fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+          </fo:table-body>
+        </fo:table>
+

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

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

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

Added: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/return/returnReportConditions.fo.ftl
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/webapp/ordermgr/return/returnReportConditions.fo.ftl?rev=432830&view=auto
==============================================================================
--- incubator/ofbiz/trunk/applications/order/webapp/ordermgr/return/returnReportConditions.fo.ftl (added)
+++ incubator/ofbiz/trunk/applications/order/webapp/ordermgr/return/returnReportConditions.fo.ftl Sat Aug 19 04:54:59 2006
@@ -0,0 +1,21 @@
+<#--
+
+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"/>
+<fo:block font-size="8pt">
+  Here is a good place to put boilerplate terms and conditions for a return.
+</fo:block>
+

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

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

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

Added: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/return/returnReportContactMechs.fo.ftl
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/webapp/ordermgr/return/returnReportContactMechs.fo.ftl?rev=432830&view=auto
==============================================================================
--- incubator/ofbiz/trunk/applications/order/webapp/ordermgr/return/returnReportContactMechs.fo.ftl (added)
+++ incubator/ofbiz/trunk/applications/order/webapp/ordermgr/return/returnReportContactMechs.fo.ftl Sat Aug 19 04:54:59 2006
@@ -0,0 +1,68 @@
+<#--
+
+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.
+-->
+
+        <#assign fromPartyNameResult = dispatcher.runSync("getPartyNameForDate", Static["org.ofbiz.base.util.UtilMisc"].toMap("partyId", returnHeader.fromPartyId, "compareDate", returnHeader.entryDate, "userLogin", userLogin))/>
+        <#assign toPartyNameResult = dispatcher.runSync("getPartyNameForDate", Static["org.ofbiz.base.util.UtilMisc"].toMap("partyId", returnHeader.toPartyId, "compareDate", returnHeader.entryDate, "userLogin", userLogin))/>
+        
+        <fo:table>
+          <fo:table-column column-width="2.75in"/>
+          <fo:table-column column-width="0.5in"/>
+          <fo:table-column column-width="2.75in"/>
+          <fo:table-body>
+          <fo:table-row>
+
+            <fo:table-cell>
+            <fo:table border-style="solid" border-width="0.2pt" height="1in">
+              <fo:table-column column-width="2.75in"/>
+              <fo:table-body>
+                <fo:table-row><fo:table-cell border-style="solid" border-width="0.2pt" padding="1mm"><fo:block font-weight="bold">${uiLabelMap.OrderReturnFromAddress}</fo:block></fo:table-cell></fo:table-row>
+                <fo:table-row><fo:table-cell padding="1mm">
+                  <fo:block white-space-collapse="false"><#if fromPartyNameResult.fullName?has_content>${fromPartyNameResult.fullName}<#else/><#if postalAddressFrom?exists><#if (postalAddressFrom.toName)?has_content>${postalAddressFrom.toName}</#if><#if (postalAddressFrom.attnName)?has_content>
+${postalAddressFrom.attnName}</#if></#if></#if><#if postalAddressFrom?exists>
+${postalAddressFrom.address1}<#if (postalAddressFrom.address2)?has_content>
+${postalAddressFrom.address2}</#if>
+${postalAddressFrom.city}<#if (postalAddressFrom.stateProvinceGeoId)?has_content>, ${postalAddressFrom.stateProvinceGeoId}</#if><#if (postalAddressFrom.postalCode)?has_content>, ${postalAddressFrom.postalCode}</#if></#if>
+                  </fo:block>
+
+                </fo:table-cell></fo:table-row>
+              </fo:table-body>
+            </fo:table>
+            </fo:table-cell>
+
+            <fo:table-cell/>
+
+            <fo:table-cell>
+            <fo:table border-style="solid" border-width="0.2pt" height="1in">
+              <fo:table-column column-width="2.75in"/>
+              <fo:table-body>
+                <fo:table-row><fo:table-cell padding="1mm" border-style="solid" border-width="0.2pt"><fo:block font-weight="bold">${uiLabelMap.OrderReturnToAddress}</fo:block></fo:table-cell></fo:table-row>
+                <fo:table-row><fo:table-cell padding="1mm">
+                  <fo:block white-space-collapse="false"><#if toPartyNameResult.fullName?has_content>${toPartyNameResult.fullName}<#else/><#if postalAddressTo?exists><#if (postalAddressTo.toName)?has_content>${postalAddressTo.toName}</#if><#if (postalAddressTo.attnName)?has_content>
+${postalAddressTo.attnName}</#if></#if></#if><#if postalAddressTo?exists>
+${postalAddressTo.address1}<#if (postalAddressTo.address2)?has_content>
+${postalAddressTo.address2}</#if>
+${postalAddressTo.city}<#if (postalAddressTo.stateProvinceGeoId)?has_content>, ${postalAddressTo.stateProvinceGeoId}</#if><#if (postalAddressTo.postalCode)?has_content>, ${postalAddressTo.postalCode}</#if></#if></fo:block>
+                </fo:table-cell></fo:table-row>
+              </fo:table-body>
+            </fo:table>
+            </fo:table-cell>
+              
+          </fo:table-row>
+          </fo:table-body>
+          </fo:table>
+
+          <fo:block space-after="10pt"/>

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

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

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

Added: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/return/returnReportHeaderInfo.fo.ftl
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/webapp/ordermgr/return/returnReportHeaderInfo.fo.ftl?rev=432830&view=auto
==============================================================================
--- incubator/ofbiz/trunk/applications/order/webapp/ordermgr/return/returnReportHeaderInfo.fo.ftl (added)
+++ incubator/ofbiz/trunk/applications/order/webapp/ordermgr/return/returnReportHeaderInfo.fo.ftl Sat Aug 19 04:54:59 2006
@@ -0,0 +1,56 @@
+<#--
+
+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="0.3in"/><fo:table-body><fo:table-row><fo:table-cell>
+            <fo:table font-size="10pt">
+            <fo:table-column column-width="1in"/>
+            <fo:table-column column-width="1in"/>
+            <fo:table-column column-width="1in"/>
+            <fo:table-body>
+
+            <fo:table-row>
+              <fo:table-cell number-columns-spanned="3">
+                <fo:block space-after="2mm" font-size="14pt" font-weight="bold" text-align="right">${uiLabelMap.OrderReturnSummary}</fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+
+            <fo:table-row>
+              <fo:table-cell text-align="center" border-style="solid" border-width="0.2pt">
+                <fo:block padding="1mm" font-weight="bold">${uiLabelMap.CommonDate}</fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" border-style="solid" border-width="0.2pt">
+                <fo:block padding="1mm" font-weight="bold">${uiLabelMap.OrderReturnId}</fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" border-style="solid" border-width="0.2pt">
+                <fo:block padding="1mm" font-weight="bold">${uiLabelMap.CommonStatus}</fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+                                  
+            <fo:table-row>
+              <fo:table-cell text-align="center" border-style="solid" border-width="0.2pt">
+                <fo:block padding="1mm">${entryDate?string("yyyy-MM-dd")}</fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" border-style="solid" border-width="0.2pt">
+                <fo:block padding="1mm">${returnId}</fo:block>
+              </fo:table-cell>
+              <fo:table-cell text-align="center" border-style="solid" border-width="0.2pt">
+                <fo:block padding="1mm">${currentStatus.get("description",locale)}</fo:block>
+              </fo:table-cell>
+            </fo:table-row>
+
+          </fo:table-body></fo:table>
+        </fo:table-cell></fo:table-row></fo:table-body></fo:table>
+

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

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

Propchange: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/return/returnReportHeaderInfo.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=432830&r1=432829&r2=432830&view=diff
==============================================================================
--- incubator/ofbiz/trunk/applications/order/widget/ordermgr/OrderPrintForms.xml (original)
+++ incubator/ofbiz/trunk/applications/order/widget/ordermgr/OrderPrintForms.xml Sat Aug 19 04:54:59 2006
@@ -91,14 +91,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/return/returnHeader.bsh"/>
                 <script location="component://order/webapp/ordermgr/WEB-INF/actions/return/returnItems.bsh"/>
             </actions>
             <widgets>
-                <platform-specific>
-                    <html><html-template location="component://order/webapp/ordermgr/return/returnView.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/return/returnReportHeaderInfo.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/return/returnReportContactMechs.fo.ftl"/></html>
+                                </platform-specific>
+                                <!-- order items and totals -->
+                                <platform-specific>
+                                    <html><html-template location="component://order/webapp/ordermgr/return/returnReportBody.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/return/returnReportConditions.fo.ftl"/></html>
+                                </platform-specific>
+                            </widgets>
+                        </section>
+                    </decorator-section>
+                </decorator-screen>
             </widgets>
         </section>
     </screen>