[OFBiz] SVN: r6964 - trunk/applications/accounting/script/org/ofbiz/accounting/ledger

sichen@svn.ofbiz.org sichen at svn.ofbiz.org
Thu Mar 9 18:16:35 CST 2006


Author: sichen
Date: 2006-03-09 18:16:32 -0600 (Thu, 09 Mar 2006)
New Revision: 6964

Modified:
   trunk/applications/accounting/script/org/ofbiz/accounting/ledger/AcctgTransServices.xml
Log:
Fixed very bad bug in postAcctgTrans where it was using a legacy technique to test if an account was credit or debit. Updated to use new recursive method.

Modified: trunk/applications/accounting/script/org/ofbiz/accounting/ledger/AcctgTransServices.xml
===================================================================
--- trunk/applications/accounting/script/org/ofbiz/accounting/ledger/AcctgTransServices.xml	2006-03-09 17:59:21 UTC (rev 6963)
+++ trunk/applications/accounting/script/org/ofbiz/accounting/ledger/AcctgTransServices.xml	2006-03-10 00:16:32 UTC (rev 6964)
@@ -247,7 +247,9 @@
             <!-- use the parent of the GlAccountClass, which should either be DEBIT or CREDIT -->
             <get-related-one relation-name="GlAccountClass" value-name="glAccount" to-value-name="glAccountClass"/>
             <get-related-one relation-name="ParentGlAccountClass" value-name="glAccountClass" to-value-name="parentGlAccountClass"/>
-            <if-compare map-name="parentGlAccountClass" field-name="glAccountClassId" operator="equals" value="DEBIT">
+            <!-- test if the account is a DEBIT account -->
+            <set field="isDebit" value="${bsh:org.ofbiz.accounting.util.UtilAccounting.isDebitAccount(glAccount)}"/>
+            <if-compare field-name="isDebit" operator="equals" value="true">
                     <if-compare field-name="debitCreditFlag" map-name="acctgTransEntry" operator="equals" value="D">
                         <set from-field="acctgTransEntry.amount" field="postingAmount"/>
                         <else>
@@ -257,7 +259,9 @@
                         </else>
                     </if-compare>
                 <else>
-                    <if-compare field-name="parentGlAccountClass.glAccountClassId" operator="equals" value="CREDIT">
+                    <!-- otherwise, test if the account is credit -->
+                    <set field="isCredit" value="${bsh:org.ofbiz.accounting.util.UtilAccounting.isCreditAccount(glAccount)}"/>
+                    <if-compare field-name="isCredit" operator="equals" value="true">
                         <if-compare field-name="acctgTransEntry.debitCreditFlag" operator="equals" value="C">
                             <set from-field="acctgTransEntry.amount" field="postingAmount"/>
                             <else>



More information about the Svn mailing list