svn commit: r452879 - in /incubator/ofbiz/trunk/applications/order: webapp/ordermgr/quote/ 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: r452879 - in /incubator/ofbiz/trunk/applications/order: webapp/ordermgr/quote/ widget/ordermgr/

jacopoc
Author: jacopoc
Date: Wed Oct  4 06:09:15 2006
New Revision: 452879

URL: http://svn.apache.org/viewvc?view=rev&rev=452879
Log:
Refactored the quote pdf report to share the common report template.

Added:
    incubator/ofbiz/trunk/applications/order/webapp/ordermgr/quote/quoteReportBody.fo.ftl   (with props)
    incubator/ofbiz/trunk/applications/order/webapp/ordermgr/quote/quoteReportContactMechs.fo.ftl   (with props)
    incubator/ofbiz/trunk/applications/order/webapp/ordermgr/quote/quoteReportHeaderInfo.fo.ftl   (with props)
Removed:
    incubator/ofbiz/trunk/applications/order/webapp/ordermgr/quote/QuoteReport.fo.ftl
Modified:
    incubator/ofbiz/trunk/applications/order/widget/ordermgr/QuoteScreens.xml

Added: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/quote/quoteReportBody.fo.ftl
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/webapp/ordermgr/quote/quoteReportBody.fo.ftl?view=auto&rev=452879
==============================================================================
--- incubator/ofbiz/trunk/applications/order/webapp/ordermgr/quote/quoteReportBody.fo.ftl (added)
+++ incubator/ofbiz/trunk/applications/order/webapp/ordermgr/quote/quoteReportBody.fo.ftl Wed Oct  4 06:09:15 2006
@@ -0,0 +1,151 @@
+<#--
+
+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>
+            <fo:table font-size="9pt">
+                <fo:table-column column-width="40pt"/>
+                <fo:table-column column-width="160pt"/>
+                <fo:table-column column-width="58pt"/>
+                <fo:table-column column-width="58pt"/>
+                <fo:table-column column-width="58pt"/>
+                <fo:table-column column-width="58pt"/>
+                <fo:table-column column-width="58pt"/>
+                <fo:table-header>
+                    <fo:table-row>
+                        <fo:table-cell border-bottom="thin solid grey"><fo:block font-weight="bold">${uiLabelMap.ProductItem}</fo:block></fo:table-cell>
+                        <fo:table-cell border-bottom="thin solid grey"><fo:block font-weight="bold">${uiLabelMap.ProductProduct}</fo:block></fo:table-cell>
+                        <fo:table-cell border-bottom="thin solid grey"><fo:block font-weight="bold" text-align="right">${uiLabelMap.ProductQuantity}</fo:block></fo:table-cell>
+                        <fo:table-cell border-bottom="thin solid grey"><fo:block font-weight="bold" text-align="right">${uiLabelMap.OrderAmount}</fo:block></fo:table-cell>
+                        <fo:table-cell border-bottom="thin solid grey"><fo:block font-weight="bold" text-align="right">${uiLabelMap.OrderOrderQuoteUnitPrice}</fo:block></fo:table-cell>
+                        <fo:table-cell border-bottom="thin solid grey"><fo:block font-weight="bold" text-align="right">${uiLabelMap.OrderAdjustments}</fo:block></fo:table-cell>
+                        <fo:table-cell border-bottom="thin solid grey"><fo:block font-weight="bold" text-align="right">${uiLabelMap.CommonSubtotal}</fo:block></fo:table-cell>
+                    </fo:table-row>
+                </fo:table-header>
+                <fo:table-body>
+                    <#assign rowColor = "white">
+                    <#assign totalQuoteAmount = 0.0>
+                    <#list quoteItems as quoteItem>
+                        <#if quoteItem.productId?exists>
+                            <#assign product = quoteItem.getRelatedOne("Product")>
+                        </#if>
+                        <#assign quoteItemAmount = quoteItem.quoteUnitPrice?default(0) * quoteItem.quantity?default(0)>
+                        <#assign quoteItemAdjustments = quoteItem.getRelated("QuoteAdjustment")>
+                        <#assign totalQuoteItemAdjustmentAmount = 0.0>
+                        <#list quoteItemAdjustments as quoteItemAdjustment>
+                            <#assign totalQuoteItemAdjustmentAmount = quoteItemAdjustment.amount?default(0) + totalQuoteItemAdjustmentAmount>
+                        </#list>
+                        <#assign totalQuoteItemAmount = quoteItemAmount + totalQuoteItemAdjustmentAmount>
+                        <#assign totalQuoteAmount = totalQuoteAmount + totalQuoteItemAmount>
+
+                        <fo:table-row>
+                            <fo:table-cell padding="2pt" background-color="${rowColor}">
+                                <fo:block>${quoteItem.quoteItemSeqId}</fo:block>
+                            </fo:table-cell>
+                            <fo:table-cell padding="2pt" background-color="${rowColor}">
+                                <fo:block>${(product.internalName)?xml?if_exists} [${quoteItem.productId?if_exists}]</fo:block>
+                            </fo:table-cell>
+                            <fo:table-cell padding="2pt" background-color="${rowColor}">
+                                <fo:block text-align="right">${quoteItem.quantity?if_exists}</fo:block>
+                            </fo:table-cell>
+                            <fo:table-cell padding="2pt" background-color="${rowColor}">
+                                <fo:block text-align="right">${quoteItem.selectedAmount?if_exists}</fo:block>
+                            </fo:table-cell>
+                            <fo:table-cell padding="2pt" background-color="${rowColor}">
+                                <fo:block text-align="right"><@ofbizCurrency amount=quoteItem.quoteUnitPrice isoCode=quote.currencyUomId/></fo:block>
+                            </fo:table-cell>
+                            <fo:table-cell padding="2pt" background-color="${rowColor}">
+                                <fo:block text-align="right"><@ofbizCurrency amount=totalQuoteItemAdjustmentAmount isoCode=quote.currencyUomId/></fo:block>
+                            </fo:table-cell>
+                            <fo:table-cell padding="2pt" background-color="${rowColor}">
+                                <fo:block text-align="right"><@ofbizCurrency amount=totalQuoteItemAmount isoCode=quote.currencyUomId/></fo:block>
+                            </fo:table-cell>
+
+                        </fo:table-row>
+                        <#list quoteItemAdjustments as quoteItemAdjustment>
+                            <#assign adjustmentType = quoteItemAdjustment.getRelatedOne("OrderAdjustmentType")>
+                            <fo:table-row>
+                                <fo:table-cell padding="2pt" background-color="${rowColor}">
+                                </fo:table-cell>
+                                <fo:table-cell padding="2pt" background-color="${rowColor}">
+                                </fo:table-cell>
+                                <fo:table-cell padding="2pt" background-color="${rowColor}">
+                                </fo:table-cell>
+                                <fo:table-cell padding="2pt" background-color="${rowColor}">
+                                </fo:table-cell>
+                                <fo:table-cell padding="2pt" background-color="${rowColor}">
+                                    <fo:block font-size="7pt" text-align="right">${adjustmentType.get("description",locale)?if_exists}</fo:block>
+                                </fo:table-cell>
+                                <fo:table-cell padding="2pt" background-color="${rowColor}">
+                                    <fo:block font-size="7pt" text-align="right"><@ofbizCurrency amount=quoteItemAdjustment.amount isoCode=quote.currencyUomId/></fo:block>
+                                </fo:table-cell>
+                                <fo:table-cell padding="2pt" background-color="${rowColor}">
+                                </fo:table-cell>
+                            </fo:table-row>
+                        </#list>
+
+                        <#if rowColor == "white">
+                            <#assign rowColor = "#D4D0C8">
+                        <#else>
+                            <#assign rowColor = "white">
+                        </#if>        
+                    </#list>          
+                </fo:table-body>
+            </fo:table>
+            
+            
+            
+            
+            <fo:block text-align="right">
+                <fo:table>
+                    <fo:table-column column-width="100pt"/>
+                    <fo:table-column column-width="100pt"/>
+                    <fo:table-body>
+                        <fo:table-row>
+                            <fo:table-cell padding="2pt">
+                                <fo:block font-weight="bold" text-align="right">${uiLabelMap.CommonSubtotal}</fo:block>
+                            </fo:table-cell>
+                            <fo:table-cell padding="2pt">
+                                <fo:block text-align="right"><@ofbizCurrency amount=totalQuoteAmount isoCode=quote.currencyUomId/></fo:block>
+                            </fo:table-cell>
+                        </fo:table-row>
+                        <#assign totalQuoteHeaderAdjustmentAmount = 0.0>
+                        <#list quoteAdjustments as quoteAdjustment>
+                            <#assign adjustmentType = quoteAdjustment.getRelatedOne("OrderAdjustmentType")>
+                            <#if !quoteAdjustment.quoteItemSeqId?exists>
+                                <#assign totalQuoteHeaderAdjustmentAmount = quoteAdjustment.amount?default(0) + totalQuoteHeaderAdjustmentAmount>
+                                <fo:table-row>
+                                    <fo:table-cell padding="2pt">
+                                        <fo:block font-weight="bold" text-align="right">${adjustmentType.get("description", locale)?if_exists}</fo:block>
+                                    </fo:table-cell>
+                                    <fo:table-cell padding="2pt">
+                                        <fo:block text-align="right"><@ofbizCurrency amount=quoteAdjustment.amount isoCode=quote.currencyUomId/></fo:block>
+                                    </fo:table-cell>
+                                </fo:table-row>
+                            </#if>
+                        </#list>
+                        <#assign grandTotalQuoteAmount = totalQuoteAmount + totalQuoteHeaderAdjustmentAmount>
+                        <fo:table-row>
+                            <fo:table-cell padding="2pt">
+                                <fo:block font-weight="bold" text-align="right">${uiLabelMap.OrderGrandTotal}</fo:block>
+                            </fo:table-cell>
+                            <fo:table-cell padding="2pt">
+                                <fo:block text-align="right"><@ofbizCurrency amount=grandTotalQuoteAmount isoCode=quote.currencyUomId/></fo:block>
+                            </fo:table-cell>
+                        </fo:table-row>
+                    </fo:table-body>
+                </fo:table>
+            </fo:block>
+        </fo:block>

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

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

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

Added: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/quote/quoteReportContactMechs.fo.ftl
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/webapp/ordermgr/quote/quoteReportContactMechs.fo.ftl?view=auto&rev=452879
==============================================================================
--- incubator/ofbiz/trunk/applications/order/webapp/ordermgr/quote/quoteReportContactMechs.fo.ftl (added)
+++ incubator/ofbiz/trunk/applications/order/webapp/ordermgr/quote/quoteReportContactMechs.fo.ftl Wed Oct  4 06:09:15 2006
@@ -0,0 +1,77 @@
+<#--
+
+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>
+                    <fo:table-cell>
+                        <fo:block>
+                            <fo:block font-weight="bold">${uiLabelMap.OrderAddress}: </fo:block>
+                            <#if quote.partyId?exists>
+                                <#assign quotePartyNameResult = dispatcher.runSync("getPartyNameForDate", Static["org.ofbiz.base.util.UtilMisc"].toMap("partyId", quote.partyId, "compareDate", quote.issueDate, "userLogin", userLogin))/>
+                                <fo:block>${quotePartyNameResult.fullName?default("[${uiLabelMap.OrderPartyNameNotFound}]")}</fo:block>
+                            <#else>
+                                <fo:block>[${uiLabelMap.OrderPartyNameNotFound}]</fo:block>
+                            </#if>
+                        </fo:block>
+                    </fo:table-cell>
+                </fo:table-row>
+                <fo:table-row>
+                    <fo:table-cell>
+                        <fo:block>
+                            <#if toPostalAddress?exists>
+                            <fo:block>${toPostalAddress.address1?if_exists}</fo:block>
+                            <fo:block>${toPostalAddress.address2?if_exists}</fo:block>
+                            <fo:block>${toPostalAddress.city}<#if toPostalAddress.stateProvinceGeoId?has_content>, ${toPostalAddress.stateProvinceGeoId}</#if> ${toPostalAddress.postalCode?if_exists}</fo:block>
+                            </#if>
+                        </fo:block>
+                    </fo:table-cell>
+                </fo:table-row>
+            </fo:table-body>
+        </fo:table>
+
+
+        <fo:table border-spacing="3pt" space-before="0.5in" space-after="0.5in">
+            <fo:table-column column-width="1.5in"/>
+            <fo:table-column column-width="3.75in"/>
+            <fo:table-body>
+                <fo:table-row>
+                    <fo:table-cell><fo:block>${uiLabelMap.OrderOrderQuoteName}:</fo:block></fo:table-cell>
+                    <fo:table-cell><fo:block>${quote.quoteName?if_exists}</fo:block></fo:table-cell>
+                </fo:table-row>
+                <fo:table-row>
+                    <fo:table-cell><fo:block>${uiLabelMap.CommonDescription}:</fo:block></fo:table-cell>
+                    <fo:table-cell><fo:block>${quote.description?if_exists}</fo:block></fo:table-cell>
+                </fo:table-row>
+                <fo:table-row>
+                    <fo:table-cell><fo:block>${uiLabelMap.CommonCurrency}:</fo:block></fo:table-cell>
+                    <fo:table-cell><fo:block><#if currency?exists>${currency.get("description",locale)?default(quote.currencyUomId?if_exists)}</#if></fo:block></fo:table-cell>
+                </fo:table-row>
+                <fo:table-row>
+                    <fo:table-cell><fo:block>${uiLabelMap.CommonValidFromDate}:</fo:block></fo:table-cell>
+                    <fo:table-cell><fo:block>${(quote.validFromDate.toString())?if_exists}</fo:block></fo:table-cell>
+                </fo:table-row>
+                <fo:table-row>
+                    <fo:table-cell><fo:block>${uiLabelMap.CommonValidThruDate}:</fo:block></fo:table-cell>
+                    <fo:table-cell><fo:block>${(quote.validThruDate.toString())?if_exists}</fo:block></fo:table-cell>
+                </fo:table-row>
+            </fo:table-body>
+        </fo:table>
+        

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

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

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

Added: incubator/ofbiz/trunk/applications/order/webapp/ordermgr/quote/quoteReportHeaderInfo.fo.ftl
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/webapp/ordermgr/quote/quoteReportHeaderInfo.fo.ftl?view=auto&rev=452879
==============================================================================
--- incubator/ofbiz/trunk/applications/order/webapp/ordermgr/quote/quoteReportHeaderInfo.fo.ftl (added)
+++ incubator/ofbiz/trunk/applications/order/webapp/ordermgr/quote/quoteReportHeaderInfo.fo.ftl Wed Oct  4 06:09:15 2006
@@ -0,0 +1,39 @@
+<#--
+
+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="1.5in"/>
+            <fo:table-column column-width="3.75in"/>
+            <fo:table-body>
+                <fo:table-row>
+                    <fo:table-cell><fo:block font-weight="bold">${uiLabelMap.OrderQuoteType}</fo:block></fo:table-cell>
+                    <fo:table-cell><fo:block font-weight="bold">${(quoteType.get("description",locale))?default(quote.quoteTypeId?if_exists)}</fo:block></fo:table-cell>
+                </fo:table-row>
+                <fo:table-row>
+                    <fo:table-cell><fo:block>${uiLabelMap.OrderOrderQuoteIssueDate}</fo:block></fo:table-cell>
+                    <fo:table-cell><fo:block>${(quote.issueDate.toString())?if_exists}</fo:block></fo:table-cell>
+                </fo:table-row>
+                <fo:table-row>
+                    <fo:table-cell><fo:block>${uiLabelMap.OrderOrderQuoteId}</fo:block></fo:table-cell>
+                    <fo:table-cell><fo:block>${quote.quoteId}</fo:block></fo:table-cell>
+                </fo:table-row>
+                <fo:table-row>
+                    <fo:table-cell><fo:block>${uiLabelMap.CommonStatus}</fo:block></fo:table-cell>
+                    <fo:table-cell><fo:block font-weight="bold">${(statusItem.get("description", locale))?default(quote.statusId?if_exists)}</fo:block></fo:table-cell>
+                </fo:table-row>
+            </fo:table-body>
+        </fo:table>

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

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

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

Modified: incubator/ofbiz/trunk/applications/order/widget/ordermgr/QuoteScreens.xml
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/widget/ordermgr/QuoteScreens.xml?view=diff&rev=452879&r1=452878&r2=452879
==============================================================================
--- incubator/ofbiz/trunk/applications/order/widget/ordermgr/QuoteScreens.xml (original)
+++ incubator/ofbiz/trunk/applications/order/widget/ordermgr/QuoteScreens.xml Wed Oct  4 06:09:15 2006
@@ -112,6 +112,7 @@
             </widgets>
         </section>
     </screen>
+
     <screen name="QuoteReport">
         <section>
             <actions>
@@ -139,15 +140,46 @@
                 <get-related value-name="quote" relation-name="QuoteAttribute" list-name="quoteAttributes"/>
                 <get-related value-name="quote" relation-name="QuoteCoefficient" list-name="quoteCoefficients"/>
                 -->
-                <property-map resource="OrderUiLabels" map-name="uiLabelMap"/>
             </actions>
             <widgets>
-                <platform-specific>
-                    <html><html-template location="component://order/webapp/ordermgr/quote/QuoteReport.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/quote/quoteReportHeaderInfo.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/quote/quoteReportContactMechs.fo.ftl"/></html>
+                                </platform-specific>
+                                <!-- quote items and totals -->
+                                <platform-specific>
+                                    <html><html-template location="component://order/webapp/ordermgr/quote/quoteReportBody.fo.ftl"/></html>
+                                </platform-specific>
+                            </widgets>
+                        </section>
+                    </decorator-section>
+                </decorator-screen>
             </widgets>
         </section>
     </screen>
+
     <screen name="EditQuote">
         <section>
             <actions>