Author: mor
Date: Wed Jul  1 15:10:12 2009
New Revision: 790208

URL: http://svn.apache.org/viewvc?rev=790208&view=rev
Log:
Balance Sheet reports can now be exported to CSV and PDF format.
Applied patch from Brajesh Patel, part of OFBIZ-2673 
(https://issues.apache.org/jira/browse/OFBIZ-2673)

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=790208&r1=790207&r2=790208&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 15:10:12 2009
@@ -2090,7 +2090,16 @@
         <security https="true" auth="true"/>
         <response name="success" type="view" value="IncomeStatementListCsv"/>
     </request-map>
-    
+
+    <request-map uri="BalanceSheet.csv">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="BalanceSheetCsv"/>
+    </request-map>
+
+    <request-map uri="BalanceSheet.pdf">
+        <security auth="true" https="true"/>
+        <response name="success" type="view" value="BalanceSheetPdf"/>
+    </request-map> 
     <!-- end of request mappings -->
 
     <!-- View Mappings -->
@@ -2349,6 +2358,8 @@
     <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"/>
+    <view-map name="BalanceSheetCsv" type="screentext" 
page="component://accounting/widget/ReportFinancialSummaryScreens.xml#BalanceSheetCsv"
 content-type="text/csv" encoding="none"/>
+    <view-map name="BalanceSheetPdf" type="screenfop" 
page="component://accounting/widget/ReportFinancialSummaryScreens.xml#BalanceSheetPdf"
 content-type="application/pdf" 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=790208&r1=790207&r2=790208&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryForms.xml 
(original)
+++ ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryForms.xml 
Wed Jul  1 15:10:12 2009
@@ -183,12 +183,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>
     <form name="BalanceSheetLiabilityList" type="list" 
list-name="liabilityBalancesList"
@@ -198,12 +199,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>
     <form name="BalanceSheetEquityList" type="list" 
list-name="equityBalancesList"
@@ -213,12 +215,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>
 
@@ -323,4 +326,50 @@
         <field name="totalAmount"><display type="currency" 
currency="${currencyUomId}"/></field>
         <field name="quot3" title="&quot;"><display 
description="&quot;"/></field>
     </form>
+
+    <form name="BalanceSheetAssetListCsv" type="list" 
list-name="assetBalancesList" view-size="99999">
+        <row-actions>
+            <entity-one entity-name="GlAccount" value-field="glAccount">
+                <field-map field-name="glAccountId"/>
+            </entity-one>
+        </row-actions>
+        <field name="quot0" title="&quot;"><display 
description="&quot;"/></field>
+        <field name="glAccountId"><display description="[${glAccountId}] 
[${glAccount.accountCode}] ${glAccount.accountName}"/></field>
+        <field name="quot1" title="&quot;"><display 
description="&quot;"/></field>
+        <field name="seprator0" title=","><display description=","/></field>
+
+        <field name="quot2" title="&quot;"><display 
description="&quot;"/></field>
+        <field name="totalAmount"><display type="currency" 
currency="${currencyUomId}"/></field>
+        <field name="quot3" title="&quot;"><display 
description="&quot;"/></field>
+    </form>
+    <form name="BalanceSheetLiabilityListCsv" type="list" 
list-name="liabilityBalancesList" view-size="99999">
+        <row-actions>
+            <entity-one entity-name="GlAccount" value-field="glAccount">
+                <field-map field-name="glAccountId"/>
+            </entity-one>
+        </row-actions>
+        <field name="quot0" title="&quot;"><display 
description="&quot;"/></field>
+        <field name="glAccountId"><display description="[${glAccountId}] 
[${glAccount.accountCode}] ${glAccount.accountName}"/></field>
+        <field name="quot1" title="&quot;"><display 
description="&quot;"/></field>
+        <field name="seprator0" title=","><display description=","/></field>
+
+        <field name="quot2" title="&quot;"><display 
description="&quot;"/></field>
+        <field name="totalAmount"><display type="currency" 
currency="${currencyUomId}"/></field>
+        <field name="quot3" title="&quot;"><display 
description="&quot;"/></field>
+    </form>
+    <form name="BalanceSheetEquityListCsv" type="list" 
list-name="equityBalancesList" view-size="99999">
+        <row-actions>
+            <entity-one entity-name="GlAccount" value-field="glAccount">
+                <field-map field-name="glAccountId"/>
+            </entity-one>
+        </row-actions>
+        <field name="quot0" title="&quot;"><display 
description="&quot;"/></field>
+        <field name="glAccountId"><display description="[${glAccountId}] 
[${glAccount.accountCode}] ${glAccount.accountName}"/></field>
+        <field name="quot1" title="&quot;"><display 
description="&quot;"/></field>
+        <field name="seprator0" title=","><display description=","/></field>
+
+        <field name="quot2" title="&quot;"><display 
description="&quot;"/></field>
+        <field name="totalAmount"><display type="currency" 
currency="${currencyUomId}"/></field>
+        <field name="quot3" title="&quot;"><display 
description="&quot;"/></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=790208&r1=790207&r2=790208&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryScreens.xml 
(original)
+++ 
ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryScreens.xml 
Wed Jul  1 15:10:12 2009
@@ -420,6 +420,16 @@
                                 </or>
                             </condition>
                             <widgets>
+                                <link 
text="${uiLabelMap.AccountingExportAsCsv}" style="button" 
target="BalanceSheet.csv">
+                                    <parameter 
param-name="organizationPartyId"/>
+                                    <parameter param-name="thruDate" 
from-field="parameters.thruDate"/>
+                                    <parameter param-name="glFiscalTypeId" 
from-field="parameters.glFiscalTypeId"/>
+                                </link>
+                                <link 
text="${uiLabelMap.AccountingExportAsPdf}" style="button" 
target="BalanceSheet.pdf">
+                                    <parameter 
param-name="organizationPartyId"/>
+                                    <parameter param-name="thruDate" 
from-field="parameters.thruDate"/>
+                                    <parameter param-name="glFiscalTypeId" 
from-field="parameters.glFiscalTypeId"/>
+                                </link>
                                 <container style="screenlet">
                                     <container style="screenlet-title-bar">
                                         <container style="h3">
@@ -714,4 +724,59 @@
             </widgets>
         </section>
     </screen>
+
+    <screen name="BalanceSheetCsv">
+        <section>
+            <actions>
+                <property-map resource="AccountingUiLabels" 
map-name="uiLabelMap" global="true"/>
+
+                <service service-name="prepareBalanceSheet" 
result-map="result" auto-field-map="true"/>
+                <set field="assetBalancesList" 
from-field="result.assetBalancesList"/>
+                <set field="liabilityBalancesList" 
from-field="result.liabilityBalancesList"/>
+                <set field="equityBalancesList" 
from-field="result.equityBalancesList"/>
+            </actions>
+            <widgets>
+                <container style="h3">
+                    <label text="${uiLabelMap.AccountingAssets}"/>
+                    <include-form name="BalanceSheetAssetListCsv" 
location="component://accounting/widget/ReportFinancialSummaryForms.xml"/>
+                    <label text="${uiLabelMap.AccountingLiabilities}"/>
+                    <include-form name="BalanceSheetLiabilityListCsv" 
location="component://accounting/widget/ReportFinancialSummaryForms.xml"/>
+                    <label text="${uiLabelMap.AccountingEquities}"/>
+                    <include-form name="BalanceSheetEquityListCsv" 
location="component://accounting/widget/ReportFinancialSummaryForms.xml"/>
+                </container>
+            </widgets>
+        </section>
+    </screen>
+
+    <screen name="BalanceSheetPdf">
+        <section>
+            <actions>
+                <property-map resource="AccountingUiLabels" 
map-name="uiLabelMap" global="true"/>
+
+                <service service-name="prepareBalanceSheet" 
result-map="result" auto-field-map="true"/>
+                <set field="assetBalancesList" 
from-field="result.assetBalancesList"/>
+                <set field="liabilityBalancesList" 
from-field="result.liabilityBalancesList"/>
+                <set field="equityBalancesList" 
from-field="result.equityBalancesList"/>
+                <set field="isPdf" value="true" type="Boolean"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="SimpleDecorator" 
location="component://common/widget/CommonScreens.xml">
+                    <decorator-section name="body">
+                        <section>
+                            <widgets>
+                                <container>
+                                    <label 
text="${uiLabelMap.AccountingAssets}"/>
+                                    <include-form name="BalanceSheetAssetList" 
location="component://accounting/widget/ReportFinancialSummaryForms.xml"/>
+                                    <label 
text="${uiLabelMap.AccountingLiabilities}"/>
+                                    <include-form 
name="BalanceSheetLiabilityList" 
location="component://accounting/widget/ReportFinancialSummaryForms.xml"/>
+                                    <label 
text="${uiLabelMap.AccountingEquities}"/>
+                                    <include-form 
name="BalanceSheetEquityList" 
location="component://accounting/widget/ReportFinancialSummaryForms.xml"/>
+                                </container>
+                            </widgets>
+                        </section>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
 </screens>
\ No newline at end of file


Reply via email to