svn commit: r593745 - in /ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger: AcctgTransServices.xml 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: r593745 - in /ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger: AcctgTransServices.xml GeneralLedgerServices.xml

jacopoc
Author: jacopoc
Date: Fri Nov  9 23:15:43 2007
New Revision: 593745

URL: http://svn.apache.org/viewvc?rev=593745&view=rev
Log:
Fixed validation errors, including the ones reported in OFBIZ-1394: thanks to Skip Dever for the bug report and to Scott Gray for the suggested fix.

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

Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/AcctgTransServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/AcctgTransServices.xml?rev=593745&r1=593744&r2=593745&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/AcctgTransServices.xml (original)
+++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/AcctgTransServices.xml Fri Nov  9 23:15:43 2007
@@ -99,9 +99,9 @@
         <check-errors/>
       
         <property-to-field resource="arithmetic" property="ledger.decimals" field-name="ledgerDecimals"/>
-        <property-to-field resource="arithmetic" property="ledger.rounding" field-name="ledgerRounding"/>
+        <property-to-field resource="arithmetic" property="ledger.rounding" field-name="roundingMode"/>
 
-        <log level="info" message="Using ledger decimals [${ledgerDecimals}] and rounding [${ledgerRounding}]"/>
+        <log level="info" message="Using ledger decimals [${ledgerDecimals}] and rounding [${roundingMode}]"/>
 
         <!-- get all AcctgTransEntry for this trans, for each if debit add to debits total if credit add to credits total -->
         <entity-condition entity-name="AcctgTransEntry" list-name="acctgTransEntryList">
@@ -112,7 +112,7 @@
         <calculate field-name="creditTotal" type="BigDecimal"><number value="0"/></calculate>
         <iterate entry-name="acctgTransEntry" list-name="acctgTransEntryList">
             <if-compare field-name="debitCreditFlag" map-name="acctgTransEntry" operator="equals" value="D">
-               <calculate field-name="debitTotal" type="BigDecimal" decimal-scale="${ledgerDecimals}" rounding-mode="${ledgerRounding}">
+               <calculate field-name="debitTotal" type="BigDecimal" decimal-scale="${ledgerDecimals}" rounding-mode="${roundingMode}">
                         <calcop operator="add">
                             <calcop operator="get" field-name="debitTotal"/>
                             <calcop operator="get" field-name="acctgTransEntry.amount"/>
@@ -120,7 +120,7 @@
                </calculate>
             <else>
                 <if-compare field-name="debitCreditFlag" map-name="acctgTransEntry" operator="equals" value="C">
-                    <calculate field-name="creditTotal" type="BigDecimal" decimal-scale="${ledgerDecimals}" rounding-mode="${ledgerRounding}">
+                    <calculate field-name="creditTotal" type="BigDecimal" decimal-scale="${ledgerDecimals}" rounding-mode="${roundingMode}">
                         <calcop operator="add">
                             <calcop operator="get" field-name="creditTotal"/>
                             <calcop operator="get" field-name="acctgTransEntry.amount"/>
@@ -139,10 +139,10 @@
         <check-errors/>
         
         <!-- should now have the debitTotal and creditTotal, calculate the debitCreditDifference -->
-        <calculate field-name="debitCreditDifference" type="BigDecimal"  decimal-scale="${ledgerDecimals}" rounding-mode="${ledgerRounding}">
+        <calculate field-name="debitCreditDifference" type="BigDecimal"  decimal-scale="${ledgerDecimals}" rounding-mode="${roundingMode}">
             <calcop operator="add">
-                <calcop operator="get" field-name="debitTotal" type="BigDecimal"/>
-                <calcop operator="negative" field-name="creditTotal" type="BigDecimal"/>
+                <calcop operator="get" field-name="debitTotal"/>
+                <calcop operator="negative" field-name="creditTotal"/>
             </calcop>
         </calculate>
         

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=593745&r1=593744&r2=593745&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 Nov  9 23:15:43 2007
@@ -299,8 +299,8 @@
     <simple-method method-name="createAcctgTransAndEntries" short-description="Verifies and posts a set of AcctgTransEntries">
         <!-- retrieve ledger rounding properties -->
         <property-to-field resource="arithmetic" property="ledger.decimals" field-name="ledgerDecimals"/>
-        <property-to-field resource="arithmetic" property="ledger.rounding" field-name="ledgerRounding"/>
-        <log level="info" message="Using ledger decimals [${ledgerDecimals}] and rounding [${ledgerRounding}]"/>        
+        <property-to-field resource="arithmetic" property="ledger.rounding" field-name="roundingMode"/>
+        <log level="info" message="Using ledger decimals [${ledgerDecimals}] and rounding [${roundingMode}]"/>        
 
         <!-- first loop through and make sure all the entries are valid  -->
         <iterate list-name="parameters.acctgTransEntries" entry-name="acctgTransEntry">
@@ -316,19 +316,19 @@
             </if-empty>
             <!-- add up debits and credits -->
             <if-compare field-name="acctgTransEntry.debitCreditFlag" operator="equals" value="D">
-                <calculate field-name="debitTotal" decimal-scale="${ledgerDecimals}" rounding-mode="${ledgerRounding}">
+                <calculate field-name="debitTotal" decimal-scale="${ledgerDecimals}" rounding-mode="${roundingMode}">
                     <calcop operator="get" field-name="acctgTransEntry.amount"/>
                     <calcop operator="get" field-name="debitTotal"/>
                 </calculate>
             </if-compare>
             <if-compare field-name="acctgTransEntry.debitCreditFlag" operator="equals" value="C">
-                <calculate field-name="creditTotal" decimal-scale="${ledgerDecimals}" rounding-mode="${ledgerRounding}">
+                <calculate field-name="creditTotal" decimal-scale="${ledgerDecimals}" rounding-mode="${roundingMode}">
                     <calcop operator="get" field-name="acctgTransEntry.amount"/>
                     <calcop operator="get" field-name="creditTotal"/>
                 </calculate>
             </if-compare>
         </iterate>
-        <calculate field-name="debitCreditDifference" decimal-scale="${ledgerDecimals}" rounding-mode="${ledgerRounding}">
+        <calculate field-name="debitCreditDifference" decimal-scale="${ledgerDecimals}" rounding-mode="${roundingMode}">
             <calcop operator="get" field-name="debitTotal"/>
             <calcop operator="negative" field-name="creditTotal"/>
         </calculate>