Author: mor
Date: Wed Jul 1 12:20:45 2009
New Revision: 790136
URL: http://svn.apache.org/viewvc?rev=790136&view=rev
Log:
Income Statement report can now be exported to CSV and PDF format.
Applied patch from Brajesh Patel, part of OFBIZ-2676
(https://issues.apache.org/jira/browse/OFBIZ-2676)
Modified:
ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml
ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryForms.xml
ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryScreens.xml
Modified:
ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml?rev=790136&r1=790135&r2=790136&view=diff
==============================================================================
---
ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml
(original)
+++
ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml
Wed Jul 1 12:20:45 2009
@@ -2080,6 +2080,16 @@
<security https="true" auth="true"/>
<response name="success" type="view" value="TransactionTotalsCsv"/>
</request-map>
+
+ <request-map uri="IncomeStatementListPdf.pdf">
+ <security https="true" auth="true"/>
+ <response name="success" type="view" value="IncomeStatementListPdf"/>
+ </request-map>
+
+ <request-map uri="IncomeStatementListCsv.csv">
+ <security https="true" auth="true"/>
+ <response name="success" type="view" value="IncomeStatementListCsv"/>
+ </request-map>
<!-- end of request mappings -->
@@ -2337,6 +2347,8 @@
<view-map name="TransactionTotalsPdf" type="screenfop"
page="component://accounting/widget/ReportFinancialSummaryScreens.xml#TransactionTotalsPdf"
content-type="application/pdf" encoding="none"/>
<view-map name="TransactionTotalsCsv" type="screentext"
page="component://accounting/widget/ReportFinancialSummaryScreens.xml#TransactionTotalsCsv"
content-type="text/csv" encoding="none"/>
+ <view-map name="IncomeStatementListPdf" type="screenfop"
page="component://accounting/widget/ReportFinancialSummaryScreens.xml#IncomeStatementListPdf"
content-type="application/pdf" encoding="none"/>
+ <view-map name="IncomeStatementListCsv" type="screentext"
page="component://accounting/widget/ReportFinancialSummaryScreens.xml#IncomeStatementListCsv"
content-type="text/csv" encoding="none"/>
<!-- end of view mappings -->
</site-conf>
Modified:
ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryForms.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryForms.xml?rev=790136&r1=790135&r2=790136&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryForms.xml
(original)
+++ ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryForms.xml
Wed Jul 1 12:20:45 2009
@@ -131,12 +131,13 @@
<field-map field-name="glAccountId"/>
</entity-one>
</row-actions>
- <field name="glAccountId">
+ <field name="glAccountId" use-when="isPdf != true">
<hyperlink target="FindAcctgTransEntries"
description="[${glAccountId}] [${glAccount.accountCode}]
${glAccount.accountName}">
<parameter param-name="glAccountId"/>
<parameter param-name="organizationPartyId"/>
</hyperlink>
</field>
+ <field name="glAccountId" use-when="isPdf == true"><display
description="[${glAccountId}] [${glAccount.accountCode}]
${glAccount.accountName}"/></field>
<field name="totalAmount"><display type="currency"
currency="${currencyUomId}"/></field>
</form>
@@ -307,4 +308,19 @@
<field name="credit"><display type="currency"
currency="${currencyUomId}"/></field>
<field name="quot5" title="""><display
description="""/></field>
</form>
+
+ <form name="IncomeStatementListCsv" type="list"
list-name="glAccountTotalsList" view-size="99999">
+ <row-actions>
+ <entity-one entity-name="GlAccount" value-field="glAccount"
auto-field-map="true"/>
+ <set field="totalAmount" from-field="${totalAmount}"/>
+ </row-actions>
+ <field name="quot0" title="""><display
description="""/></field>
+ <field name="glAccountId"><display description="[${glAccountId}]
[${glAccount.accountCode}] ${glAccount.accountName}"/></field>
+ <field name="quot1" title="""><display
description="""/></field>
+ <field name="seprator0" title=","><display description=","/></field>
+
+ <field name="quot2" title="""><display
description="""/></field>
+ <field name="totalAmount"><display type="currency"
currency="${currencyUomId}"/></field>
+ <field name="quot3" title="""><display
description="""/></field>
+ </form>
</forms>
\ No newline at end of file
Modified:
ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryScreens.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryScreens.xml?rev=790136&r1=790135&r2=790136&view=diff
==============================================================================
---
ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryScreens.xml
(original)
+++
ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryScreens.xml
Wed Jul 1 12:20:45 2009
@@ -356,6 +356,18 @@
</container>
</container>
<container style="screenlet-body">
+ <link
text="${uiLabelMap.AccountingExportAsCsv}" style="button"
target="IncomeStatementListCsv.csv">
+ <parameter param-name="fromDate"
from-field="parameters.fromDate"/>
+ <parameter param-name="thruDate"
from-field="parameters.thruDate"/>
+ <parameter
param-name="organizationPartyId" from-field="parameters.organizationPartyId"/>
+ <parameter
param-name="glFiscalTypeId" from-field="parameters.glFiscalTypeId"/>
+ </link>
+ <link
text="${uiLabelMap.AccountingExportAsPdf}" style="button"
target="IncomeStatementListPdf.pdf">
+ <parameter param-name="fromDate"
from-field="parameters.fromDate"/>
+ <parameter param-name="thruDate"
from-field="parameters.thruDate"/>
+ <parameter
param-name="organizationPartyId" from-field="parameters.organizationPartyId"/>
+ <parameter
param-name="glFiscalTypeId" from-field="parameters.glFiscalTypeId"/>
+ </link>
<include-form
name="IncomeStatementList"
location="component://accounting/widget/ReportFinancialSummaryForms.xml"/>
<container>
<label style="h3"
text="${uiLabelMap.AccountingNetIncome}: ${parameters.totalNetIncome}"/>
@@ -662,4 +674,53 @@
</widgets>
</section>
</screen>
+
+ <screen name="IncomeStatementListPdf">
+ <section>
+ <actions>
+ <property-map resource="AccountingUiLabels"
map-name="uiLabelMap" global="true"/>
+ <set field="fromDate" from-field="parameters.fromDate"
type="Timestamp"/>
+ <set field="thruDate" from-field="parameters.thruDate"
type="Timestamp"/>
+ <set field="organizationPartyId"
from-field="parameters.organizationPartyId"/>
+ <set field="glFiscalTypeId"
from-field="parameters.glFiscalTypeId"/>
+
+ <service service-name="prepareIncomeStatement"
result-map="result" auto-field-map="true"/>
+ <set field="glAccountTotalsList"
from-field="result.glAccountTotalsList"/>
+ <set field="totalNetIncome"
from-field="result.totalNetIncome"/>
+ <set field="isPdf" value="true" type="Boolean"/>
+ </actions>
+ <widgets>
+ <decorator-screen name="SimpleDecorator"
location="component://common/widget/CommonScreens.xml">
+ <decorator-section name="body">
+ <include-form name="IncomeStatementList"
location="component://accounting/widget/ReportFinancialSummaryForms.xml"/>
+ <container>
+ <label style="h3"
text="${uiLabelMap.AccountingNetIncome}: ${totalNetIncome}"/>
+ </container>
+ </decorator-section>
+ </decorator-screen>
+ </widgets>
+ </section>
+ </screen>
+
+ <screen name="IncomeStatementListCsv">
+ <section>
+ <actions>
+ <property-map resource="AccountingUiLabels"
map-name="uiLabelMap" global="true"/>
+ <set field="fromDate" from-field="parameters.fromDate"
type="Timestamp"/>
+ <set field="thruDate" from-field="parameters.thruDate"
type="Timestamp"/>
+ <set field="organizationPartyId"
from-field="parameters.organizationPartyId"/>
+ <set field="glFiscalTypeId"
from-field="parameters.glFiscalTypeId"/>
+
+ <service service-name="prepareIncomeStatement"
result-map="result" auto-field-map="true"/>
+ <set field="glAccountTotalsList"
from-field="result.glAccountTotalsList"/>
+ <set field="totalNetIncome"
from-field="result.totalNetIncome"/>
+ </actions>
+ <widgets>
+ <include-form name="IncomeStatementListCsv"
location="component://accounting/widget/ReportFinancialSummaryForms.xml"/>
+ <container>
+ <label style="h3" text="${uiLabelMap.AccountingNetIncome}:
${totalNetIncome}"/>
+ </container>
+ </widgets>
+ </section>
+ </screen>
</screens>
\ No newline at end of file