svn commit: r790219 - in /ofbiz/trunk/applications/accounting: webapp/accounting/WEB-INF/controller.xml widget/ReportFinancialSummaryForms.xml widget/ReportFinancialSummaryScreens.xml

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

svn commit: r790219 - in /ofbiz/trunk/applications/accounting: webapp/accounting/WEB-INF/controller.xml widget/ReportFinancialSummaryForms.xml widget/ReportFinancialSummaryScreens.xml

mor-2
Author: mor
Date: Wed Jul  1 15:32:28 2009
New Revision: 790219

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

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=790219&r1=790218&r2=790219&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:32:28 2009
@@ -2099,7 +2099,17 @@
     <request-map uri="BalanceSheet.pdf">
         <security auth="true" https="true"/>
         <response name="success" type="view" value="BalanceSheetPdf"/>
-    </request-map>
+    </request-map>
+
+    <request-map uri="TrialBalanceSearchResultsPdf.pdf">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="TrialBalanceSearchResultsPdf"/>
+    </request-map>
+
+    <request-map uri="TrialBalanceSearchResultsCsv.csv">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="TrialBalanceSearchResultsCsv"/>
+    </request-map>
     <!-- end of request mappings -->
 
     <!-- View Mappings -->
@@ -2360,6 +2370,8 @@
     <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"/>
+    <view-map name="TrialBalanceSearchResultsPdf" type="screenfop" page="component://accounting/widget/ReportFinancialSummaryScreens.xml#TrialBalanceSearchResultsPdf" content-type="application/pdf" encoding="none"/>
+    <view-map name="TrialBalanceSearchResultsCsv" type="screentext" page="component://accounting/widget/ReportFinancialSummaryScreens.xml#TrialBalanceSearchResultsCsv" 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=790219&r1=790218&r2=790219&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryForms.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryForms.xml Wed Jul  1 15:32:28 2009
@@ -94,12 +94,13 @@
             <set field="parameters.debitTotal" value="${bsh:(showDebit ? (debitTotal.add(absolutePostedBalance)) : (debitTotal))}" type="BigDecimal"/>
             <set field="parameters.creditTotal" value="${bsh:(showCredit ? (creditTotal.add(absolutePostedBalance)) : (creditTotal))}" type="BigDecimal"/>
         </row-actions>
-        <field name="glAccountId" use-when="!showTotals">
+        <field name="glAccountId" use-when="!showTotals || 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="debit" use-when="showDebit"><display description="${absolutePostedBalance}" type="currency" currency="${currencyUomId}"/></field>
         <field name="debit" use-when="showCredit"><display/></field>
         <field name="credit" use-when="showCredit"><display description="${absolutePostedBalance}" type="currency" currency="${currencyUomId}"/></field>
@@ -372,4 +373,39 @@
         <field name="totalAmount"><display type="currency" currency="${currencyUomId}"/></field>
         <field name="quot3" title="&quot;"><display description="&quot;"/></field>
     </form>
+
+    <form name="TrialBalanceSearchResultsCsv" type="list" list-name="trialBalances"
+        odd-row-style="alternate-row" default-table-style="basic-table hover-bar">
+        <row-actions>
+            <entity-one entity-name="GlAccount" value-field="glAccount">
+                <field-map field-name="glAccountId"/>
+            </entity-one>
+            <set field="showDebit" value="${bsh:(postedBalance.compareTo(java.math.BigDecimal.ZERO) &gt;= 0 &amp;&amp; org.ofbiz.accounting.util.UtilAccounting.isDebitAccount(glAccount)) || (postedBalance.compareTo(java.math.BigDecimal.ZERO) &lt; 0 &amp;&amp; org.ofbiz.accounting.util.UtilAccounting.isCreditAccount(glAccount))}" type="Boolean"/>
+            <set field="showCredit" value="${bsh:(postedBalance.compareTo(java.math.BigDecimal.ZERO) &gt;= 0 &amp;&amp; org.ofbiz.accounting.util.UtilAccounting.isCreditAccount(glAccount)) || (postedBalance.compareTo(java.math.BigDecimal.ZERO) &lt; 0 &amp;&amp; org.ofbiz.accounting.util.UtilAccounting.isDebitAccount(glAccount))}" type="Boolean"/>
+            <set field="absolutePostedBalance" value="${bsh:(postedBalance.abs())}" type="BigDecimal"/>
+            <set field="showTotals" value="${bsh:(isLastRow != null &amp;&amp; isLastRow==true)}" type="Boolean"/>
+            <set field="debitTotal" from-field="parameters.debitTotal" type="BigDecimal"/>
+            <set field="creditTotal" from-field="parameters.creditTotal" type="BigDecimal"/>
+            <set field="noValue" value="0" type="BigDecimal"/>
+            <set field="parameters.debitTotal" value="${bsh:(showDebit ? (debitTotal.add(absolutePostedBalance)) : (debitTotal))}" type="BigDecimal"/>
+            <set field="parameters.creditTotal" value="${bsh:(showCredit ? (creditTotal.add(absolutePostedBalance)) : (creditTotal))}" type="BigDecimal"/>
+        </row-actions>
+        <field name="glAccountId" use-when="!showTotals"><display description="[${glAccountId}] [${glAccount.accountCode}] ${glAccount.accountName}"/></field>
+        <field name="separator0" title=","><display description=","/></field>
+
+        <field name="quot0" title="&quot;"><display/></field>
+        <field name="debit" use-when="showDebit"><display description="${absolutePostedBalance}" type="currency" currency="${currencyUomId}"/></field>
+        <field name="debit" use-when="showCredit"><display description="${noValue}"/></field>
+        <field name="quot1" title="&quot;"><display/></field>
+        <field name="separator1" title=","><display description=","/></field>
+
+        <field name="quot2" title="&quot;"><display/></field>
+        <field name="credit" use-when="showCredit"><display description="${absolutePostedBalance}" type="currency" currency="${currencyUomId}"/></field>
+        <field name="credit" use-when="showDebit"><display description="${noValue}"/></field>
+        <field name="quot3" title="&quot;"><display/></field>
+        <field name="glAccountId" use-when="showTotals"><display description="${uiLabelMap.Total}"/></field>
+        <field name="separator2" title="," use-when="showTotals"><display description=","/></field>
+        <field name="debit" use-when="showTotals"><display description="${parameters.debitTotal}" type="currency" currency="${currencyUomId}"/></field>
+        <field name="credit" use-when="showTotals"><display description="${parameters.creditTotal}" type="currency" currency="${currencyUomId}"/></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=790219&r1=790218&r2=790219&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryScreens.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryScreens.xml Wed Jul  1 15:32:28 2009
@@ -308,6 +308,12 @@
                                 </container>
                             </container>
                             <container style="screenlet-body">
+                                <link text="${uiLabelMap.AccountingExportAsCsv}" style="buttontext" target="TrialBalanceSearchResultsCsv.csv">
+                                    <parameter param-name="organizationPartyId"/>
+                                </link>
+                                <link text="${uiLabelMap.AccountingExportAsPdf}" style="buttontext" target="TrialBalanceSearchResultsPdf.pdf">
+                                    <parameter param-name="organizationPartyId"/>
+                                </link>
                                  <include-form name="TrialBalanceList" location="component://accounting/widget/ReportFinancialSummaryForms.xml"/>
                             </container>
                         </container>
@@ -779,4 +785,69 @@
             </widgets>
         </section>
     </screen>
+
+    <screen name="TrialBalanceSearchResultsCsv">
+        <section>
+            <actions>
+                <property-map resource="AccountingUiLabels" map-name="uiLabelMap" global="true"/>
+                <set field="organizationPartyId" from-field="parameters.organizationPartyId"/>
+
+                <service service-name="getPartyAccountingPreferences" result-map="result" auto-field-map="true"/>
+                <set field="partyAcctgPreference" from-field="result.partyAccountingPreference"/>
+                <set field="currencyUomId" from-field="partyAcctgPreference.baseCurrencyUomId"/>
+
+                <entity-condition entity-name="GlAccountOrganization" list="trialBalances" filter-by-date="true">
+                    <condition-list>
+                        <condition-expr field-name="organizationPartyId" operator="equals" from-field="organizationPartyId"/>
+                        <condition-expr field-name="postedBalance" operator="not-equals" from-field="null"/>
+                    </condition-list>
+                    <order-by field-name="glAccountId"/>
+                </entity-condition>
+                <set field="totalsRow.isLastRow" value="true" type="Boolean"/>
+                <set field="totalsRow.postedBalance" value="0" type="BigDecimal"/>
+                <set field="trialBalances[]" from-field="totalsRow" type="Object"/>
+                <set field="parameters.debitTotal" value="0" type="BigDecimal"/>
+                <set field="parameters.creditTotal" value="0" type="BigDecimal"/>
+            </actions>
+            <widgets>
+                <container>
+                    <include-form name="TrialBalanceSearchResultsCsv" location="component://accounting/widget/ReportFinancialSummaryForms.xml"/>
+                </container>
+            </widgets>
+        </section>
+    </screen>
+
+    <screen name="TrialBalanceSearchResultsPdf">
+        <section>
+            <actions>
+                <property-map resource="AccountingUiLabels" map-name="uiLabelMap" global="true"/>
+                <set field="organizationPartyId" from-field="parameters.organizationPartyId"/>
+
+                <service service-name="getPartyAccountingPreferences" result-map="result" auto-field-map="true"/>
+                <set field="partyAcctgPreference" from-field="result.partyAccountingPreference"/>
+                <set field="currencyUomId" from-field="partyAcctgPreference.baseCurrencyUomId"/>
+
+                <entity-condition entity-name="GlAccountOrganization" list="trialBalances" filter-by-date="true">
+                    <condition-list>
+                        <condition-expr field-name="organizationPartyId" operator="equals" from-field="organizationPartyId"/>
+                        <condition-expr field-name="postedBalance" operator="not-equals" from-field="null"/>
+                    </condition-list>
+                    <order-by field-name="glAccountId"/>
+                </entity-condition>
+                <set field="totalsRow.isLastRow" value="true" type="Boolean"/>
+                <set field="totalsRow.postedBalance" value="0" type="BigDecimal"/>
+                <set field="trialBalances[]" from-field="totalsRow" type="Object"/>
+                <set field="parameters.debitTotal" value="0" type="BigDecimal"/>
+                <set field="parameters.creditTotal" value="0" type="BigDecimal"/>
+                <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="TrialBalanceList" location="component://accounting/widget/ReportFinancialSummaryForms.xml"/>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
 </screens>
\ No newline at end of file