svn commit: r606153 - in /ofbiz/trunk/applications/accounting: data/DemoGlSetupData.xml script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml

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

svn commit: r606153 - in /ofbiz/trunk/applications/accounting: data/DemoGlSetupData.xml script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml

jacopoc
Author: jacopoc
Date: Fri Dec 21 02:17:48 2007
New Revision: 606153

URL: http://svn.apache.org/viewvc?rev=606153&view=rev
Log:
Demo data for tax accounts mappings.
Fix for auto posting service for sales invoices.
Misc enhancements to the Income Statement report.

Modified:
    ofbiz/trunk/applications/accounting/data/DemoGlSetupData.xml
    ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml

Modified: ofbiz/trunk/applications/accounting/data/DemoGlSetupData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/data/DemoGlSetupData.xml?rev=606153&r1=606152&r2=606153&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/data/DemoGlSetupData.xml (original)
+++ ofbiz/trunk/applications/accounting/data/DemoGlSetupData.xml Fri Dec 21 02:17:48 2007
@@ -177,7 +177,13 @@
     <GlAccountOrganization organizationPartyId="Company" glAccountId="214000" fromDate="2001-01-01 00:00:00.0"/>
     <GlAccountOrganization organizationPartyId="Company" glAccountId="215000" fromDate="2001-01-01 00:00:00.0"/>
     <GlAccountOrganization organizationPartyId="Company" glAccountId="221100" fromDate="2001-01-01 00:00:00.0"/>
+    <GlAccountOrganization organizationPartyId="Company" glAccountId="224000" fromDate="2001-01-01 00:00:00.0"/>
     <GlAccountOrganization organizationPartyId="Company" glAccountId="224100" fromDate="2001-01-01 00:00:00.0"/>
+    <GlAccountOrganization organizationPartyId="Company" glAccountId="224106" fromDate="2001-01-01 00:00:00.0"/>
+    <GlAccountOrganization organizationPartyId="Company" glAccountId="224140" fromDate="2001-01-01 00:00:00.0"/>
+    <GlAccountOrganization organizationPartyId="Company" glAccountId="224151" fromDate="2001-01-01 00:00:00.0"/>
+    <GlAccountOrganization organizationPartyId="Company" glAccountId="224153" fromDate="2001-01-01 00:00:00.0"/>
+    <GlAccountOrganization organizationPartyId="Company" glAccountId="224209" fromDate="2001-01-01 00:00:00.0"/>
     <GlAccountOrganization organizationPartyId="Company" glAccountId="400000" fromDate="2001-01-01 00:00:00.0"/>
     <GlAccountOrganization organizationPartyId="Company" glAccountId="401000" fromDate="2001-01-01 00:00:00.0"/>
     <GlAccountOrganization organizationPartyId="Company" glAccountId="409000" fromDate="2001-01-01 00:00:00.0"/>

Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml?rev=606153&r1=606152&r2=606153&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml (original)
+++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml Fri Dec 21 02:17:48 2007
@@ -902,21 +902,35 @@
             <calculate field-name="totalNetIncome" type="Double">
                 <calcop field-name="totalNetIncome" operator="add"><calcop field-name="amount" operator="get"/></calcop>
             </calculate>
-            <if-empty field-name="glAccountTotalsMap.${glAccount.glAccountId}">
-                <set field="glAccountTotalsMap.${glAccount.glAccountId}" value="0.0" type="Double"/>
-            </if-empty>
-            <calculate field-name="glAccountTotalsMap.${glAccount.glAccountId}" type="Double">
-                <calcop field-name="glAccountTotalsMap.${glAccount.glAccountId}" operator="add"><calcop field-name="amount" operator="get"/></calcop>
-            </calculate>
+            <if-compare field-name="isExpenseAccount" operator="equals" value="true" type="Boolean">
+                <if-empty field-name="glAccountTotalsExpenseMap.${glAccount.glAccountId}">
+                    <set field="glAccountTotalsExpenseMap.${glAccount.glAccountId}" value="0.0" type="Double"/>
+                </if-empty>
+                <calculate field-name="glAccountTotalsExpenseMap.${glAccount.glAccountId}" type="Double">
+                    <calcop field-name="glAccountTotalsExpenseMap.${glAccount.glAccountId}" operator="add"><calcop field-name="amount" operator="get"/></calcop>
+                </calculate>
+            <else>
+                <if-empty field-name="glAccountTotalsProfitMap.${glAccount.glAccountId}">
+                    <set field="glAccountTotalsProfitMap.${glAccount.glAccountId}" value="0.0" type="Double"/>
+                </if-empty>
+                <calculate field-name="glAccountTotalsProfitMap.${glAccount.glAccountId}" type="Double">
+                    <calcop field-name="glAccountTotalsProfitMap.${glAccount.glAccountId}" operator="add"><calcop field-name="amount" operator="get"/></calcop>
+                </calculate>
+            </else>
+            </if-compare>
         </iterate>
-        <iterate-map map-name="glAccountTotalsMap" key-name="glAccountId" value-name="totalAmount">
+        <iterate-map map-name="glAccountTotalsProfitMap" key-name="glAccountId" value-name="totalAmount">
+            <clear-field field-name="glAccountTotalMap"/>
+            <set field="glAccountTotalMap.glAccountId" from-field="glAccountId"/>
+            <set field="glAccountTotalMap.totalAmount" from-field="totalAmount"/>
+            <set field="glAccountTotalsList[]" from-field="glAccountTotalMap"/>
+        </iterate-map>
+        <iterate-map map-name="glAccountTotalsExpenseMap" key-name="glAccountId" value-name="totalAmount">
             <clear-field field-name="glAccountTotalMap"/>
             <set field="glAccountTotalMap.glAccountId" from-field="glAccountId"/>
             <set field="glAccountTotalMap.totalAmount" from-field="totalAmount"/>
             <set field="glAccountTotalsList[]" from-field="glAccountTotalMap"/>
         </iterate-map>
-        <set field="orderByList[]" value="glAccountId"/>
-        <order-value-list list-name="glAccountTotalsList" order-by-list-name="orderByList"/>
 
         <field-to-result field-name="totalNetIncome" result-name="totalNetIncome"/>
         <field-to-result field-name="glAccountTotalsMap" result-name="glAccountTotalsMap"/>
@@ -1660,6 +1674,7 @@
                     <set field="creditEntry.partyId" from-field="invoiceItem.taxAuthPartyId"/>
                     <set field="creditEntry.roleTypeId" value="TAX_AUTHORITY"/>
                 </if-not-empty>
+                <set field="acctgTransEntries[]" from-field="creditEntry" type="Object"/>
             </iterate>        
           
             <!-- Debit -->
@@ -1671,7 +1686,6 @@
             <set field="debitEntry.origCurrencyUomId" from-field="invoice.currencyUomId"/>
             <set field="debitEntry.partyId" from-field="invoice.partyId"/>
             <set field="debitEntry.roleTypeId" value="BILL_TO_CUSTOMER"/>
-            <set field="acctgTransEntries[]" from-field="creditEntry" type="Object"/>
             <set field="acctgTransEntries[]" from-field="debitEntry" type="Object"/>
             <set field="createAcctgTransAndEntriesInMap.glFiscalTypeId" value="ACTUAL"/>
             <set field="createAcctgTransAndEntriesInMap.acctgTransTypeId" value="SALES_INVOICE"/>