[OFBiz] SVN: r6089 - in trunk/applications/order:
webapp/ordermgr/WEB-INF/actions/quote webapp/ordermgr/quote
widget/ordermgr
jacopo at svn.ofbiz.org
jacopo at svn.ofbiz.org
Mon Nov 7 16:42:41 EST 2005
Author: jacopo
Date: 2005-11-07 15:42:28 -0600 (Mon, 07 Nov 2005)
New Revision: 6089
Added:
trunk/applications/order/webapp/ordermgr/WEB-INF/actions/quote/getPartyAddress.bsh
Modified:
trunk/applications/order/webapp/ordermgr/quote/QuoteReport.fo.ftl
trunk/applications/order/widget/ordermgr/QuoteScreens.xml
Log:
Improvements to the quote PDF report.
Added: trunk/applications/order/webapp/ordermgr/WEB-INF/actions/quote/getPartyAddress.bsh
===================================================================
--- trunk/applications/order/webapp/ordermgr/WEB-INF/actions/quote/getPartyAddress.bsh 2005-11-07 21:14:02 UTC (rev 6088)
+++ trunk/applications/order/webapp/ordermgr/WEB-INF/actions/quote/getPartyAddress.bsh 2005-11-07 21:42:28 UTC (rev 6089)
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2003-2005 The Open For Business Project - www.ofbiz.org
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
+ * OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ *@author Jacopo Cappellato (tiz at sastau.it)
+*/
+
+import org.ofbiz.entity.util.EntityUtil;
+import org.ofbiz.party.contact.ContactHelper;
+
+if (party != null) {
+ address = EntityUtil.getFirst(ContactHelper.getContactMech(party, "GENERAL_LOCATION", "POSTAL_ADDRESS", false));
+ if (address != null) {
+ toPostalAddress = address.getRelatedOne("PostalAddress");
+ context.put("toPostalAddress", toPostalAddress);
+ }
+}
+
Property changes on: trunk/applications/order/webapp/ordermgr/WEB-INF/actions/quote/getPartyAddress.bsh
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ "Date Rev Author URL Id"
Name: svn:eol-style
+ native
Modified: trunk/applications/order/webapp/ordermgr/quote/QuoteReport.fo.ftl
===================================================================
--- trunk/applications/order/webapp/ordermgr/quote/QuoteReport.fo.ftl 2005-11-07 21:14:02 UTC (rev 6088)
+++ trunk/applications/order/webapp/ordermgr/quote/QuoteReport.fo.ftl 2005-11-07 21:42:28 UTC (rev 6089)
@@ -20,29 +20,139 @@
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*@author Jacopo Cappellato (tiz at sastau.it)
- *@version $Rev:$
+ *@version $Rev$
-->
<?xml version="1.0" encoding="UTF-8" ?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<#--${Static["org.ofbiz.party.party.PartyHelper"].getPartyName(delegator, quote.partyId, false)}-->
<fo:layout-master-set>
- <fo:simple-page-master master-name="main" page-height="11in" page-width="8.5in"
+ <fo:simple-page-master master-name="main"
margin-top="0.5in" margin-bottom="1in" margin-left="1in" margin-right="1in">
- <fo:region-body margin-top="1in"/>
- <fo:region-before extent="1in"/>
+ <fo:region-body margin-top="3.5in"/>
+ <fo:region-before extent="3.5in"/>
<fo:region-after extent="1in"/>
</fo:simple-page-master>
</fo:layout-master-set>
<#if quote?exists>
- <fo:page-sequence master-reference="main">
- <fo:flow flow-name="xsl-region-body" font-family="Helvetica">
- <fo:block font-size="12pt">Quote Report</fo:block>
- <fo:block font-size="10pt">${uiLabelMap.OrderOrderQuoteId} ${quote.quoteId}</fo:block>
- <fo:block font-size="10pt">Customer: </fo:block>
- <fo:block font-size="10pt">Order Status:</fo:block>
- <fo:block space-after.optimum="10pt" font-size="8pt">
+<fo:page-sequence master-reference="main">
+
+ <fo:static-content flow-name="xsl-region-before" font-size="9pt">
+ <#-- a nest of tables to put company information on left and invoice information on the right -->
+ <fo:table>
+ <fo:table-column column-width="3.5in"/>
+ <fo:table-column column-width="3in"/>
+ <fo:table-body>
+ <fo:table-row>
+ <#-- Top Left cell -->
+ <fo:table-cell>
+ ${screens.render("component://order/widget/ordermgr/OrderPrintForms.xml#CompanyLogo")}
+ </fo:table-cell>
+ <#-- Top Right cell -->
+ <fo:table-cell>
+ <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 white-space-collapse="false"> </fo:block></fo:table-cell>
+ <fo:table-cell><fo:block white-space-collapse="false"> </fo:block></fo:table-cell>
+ </fo:table-row>
+ <fo:table-row>
+ <fo:table-cell><fo:block white-space-collapse="false"> </fo:block></fo:table-cell>
+ <fo:table-cell><fo:block white-space-collapse="false"> </fo:block></fo:table-cell>
+ </fo:table-row>
+ <fo:table-row>
+ <fo:table-cell><fo:block>${uiLabelMap.CommonType}</fo:block></fo:table-cell>
+ <fo:table-cell><fo:block>${(quoteType.description)?default(quote.quoteTypeId?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-body>
+ </fo:table>
+ </fo:table-cell>
+ </fo:table-row>
+ </fo:table-body>
+ </fo:table>
+
+ <#-- Inserts a newline. white-space-collapse="false" specifies that the stuff inside fo:block is to repeated verbatim -->
+ <fo:block white-space-collapse="false"> </fo:block>
+
+ <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">${Static["org.ofbiz.party.party.PartyHelper"].getPartyName(delegator, quote.partyId, false)}</fo:block>
+ </fo:block>
+ </fo:table-cell>
+ </fo:table-row>
+ <fo:table-row>
+ <fo:table-cell>
+ <fo:block>
+ <fo:block font-weight="bold">Address: </fo:block>
+ <fo:block font-weight="bold">${toPostalAddress.address1?if_exists}</fo:block>
+ <fo:block font-weight="bold">${toPostalAddress.address2?if_exists}</fo:block>
+ <fo:block font-weight="bold">${toPostalAddress.city}<#if toPostalAddress.stateProvinceGeoId?has_content>, ${toPostalAddress.stateProvinceGeoId}</#if> ${toPostalAddress.postalCode?if_exists}</fo:block>
+ </fo:block>
+ </fo:table-cell>
+ </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.5in"/>
+ <fo:table-column column-width="3.75in"/>
+ <fo:table-body>
+ <fo:table-row>
+ <fo:table-cell><fo:block font-weight="bold">${uiLabelMap.CommonStatus}</fo:block></fo:table-cell>
+ <fo:table-cell><fo:block>${(statusItem.get("description", locale))?default(quote.statusId?if_exists)}</fo:block></fo:table-cell>
+ </fo:table-row>
+ <fo:table-row>
+ <fo:table-cell><fo:block font-weight="bold">${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 font-weight="bold">${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 font-weight="bold">${uiLabelMap.CommonCurrency}</fo:block></fo:table-cell>
+ <fo:table-cell><fo:block><#if currency?exists>${currency.description?default(quote.currencyUomId?if_exists)}</#if></fo:block></fo:table-cell>
+ </fo:table-row>
+ <fo:table-row>
+ <fo:table-cell><fo:block font-weight="bold">${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 font-weight="bold">${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 font-weight="bold">${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>
+
+
+ </fo:static-content>
+
+ <#-- Footer -->
+ <fo:static-content flow-name="xsl-region-after">
+ <#-- displays page number. "theEnd" is an id of a fo:block at the very end -->
+ <fo:block font-size="10pt" text-align="center">Page <fo:page-number/> of <fo:page-number-citation ref-id="theEnd"/></fo:block>
+ </fo:static-content>
+
+ <fo:flow flow-name="xsl-region-body" font-family="Helvetica">
+ <fo:block space-after.optimum="10pt" font-size="8pt">
<fo:table>
<fo:table-column column-width="40pt"/>
<fo:table-column column-width="200pt"/>
@@ -132,17 +242,65 @@
</#list>
</fo:table-body>
</fo:table>
+
+
+
+
+ <fo:block space-after.optimum="10pt" font-size="8pt">
+ <fo:table>
+ <fo:table-column column-width="390pt"/>
+ <fo:table-column column-width="50pt"/>
+ <fo:table-column column-width="50pt"/>
+ <fo:table-body>
+ <fo:table-row>
+ <fo:table-cell></fo:table-cell>
+ <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 font-weight="bold" 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></fo:table-cell>
+ <fo:table-cell padding="2pt">
+ <fo:block font-weight="bold" text-align="right">${adjustmentType.description?if_exists}</fo:block>
+ </fo:table-cell>
+ <fo:table-cell padding="2pt">
+ <fo:block font-weight="bold" 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></fo:table-cell>
+ <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 font-weight="bold" 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:flow>
- </fo:page-sequence>
+ </fo:block>
+ <#-- marks the end of the pages and used to identify page-number at the end -->
+ <fo:block id="theEnd"/>
+ </fo:flow>
+</fo:page-sequence>
<#else>
- <fo:page-sequence master-reference="main">
+<fo:page-sequence master-reference="main">
<fo:flow flow-name="xsl-region-body" font-family="Helvetica">
- <fo:block font-size="14pt">
- Quote Not Found.
- </fo:block>
+ <fo:block font-size="14pt">Quote Not Found.</fo:block>
</fo:flow>
- </fo:page-sequence>
+</fo:page-sequence>
</#if>
</fo:root>
Modified: trunk/applications/order/widget/ordermgr/QuoteScreens.xml
===================================================================
--- trunk/applications/order/widget/ordermgr/QuoteScreens.xml 2005-11-07 21:14:02 UTC (rev 6088)
+++ trunk/applications/order/widget/ordermgr/QuoteScreens.xml 2005-11-07 21:42:28 UTC (rev 6089)
@@ -208,9 +208,12 @@
<get-related-one value-name="quote" relation-name="StatusItem" to-value-name="statusItem"/>
<get-related-one value-name="quote" relation-name="Uom" to-value-name="currency"/>
<get-related-one value-name="quote" relation-name="ProductStore" to-value-name="store"/>
+ <get-related-one value-name="quote" relation-name="Party" to-value-name="party"/>
<get-related value-name="quote" relation-name="QuoteItem" list-name="quoteItems"/>
<get-related value-name="quote" relation-name="QuoteAdjustment" list-name="quoteAdjustments"/>
+
+ <script location="component://order/webapp/ordermgr/WEB-INF/actions/quote/getPartyAddress.bsh"/>
<!--
<get-related value-name="quote" relation-name="QuoteRole" list-name="quoteRoles"/>
<get-related value-name="quote" relation-name="QuoteAttribute" list-name="quoteAttributes"/>
More information about the Svn
mailing list