You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ja...@apache.org on 2012/04/27 11:11:29 UTC

svn commit: r1331308 - in /ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting: ledger/GeneralLedgerServices.xml test/AutoAcctgTransTestsSales.xml

Author: jacopoc
Date: Fri Apr 27 09:11:29 2012
New Revision: 1331308

URL: http://svn.apache.org/viewvc?rev=1331308&view=rev
Log:
Patch from Scott Gray to fix a bug that prevented to post the invoice transaction to the proper "sales" subledger.

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

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=1331308&r1=1331307&r2=1331308&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 Apr 27 09:11:29 2012
@@ -598,6 +598,18 @@ under the License.
                 </and>
             </condition>
             <then>
+                <call-simple-method method-name="getInvoiceItemTypeGlAccountInline"/>
+                <if-not-empty field="invoiceItemTypeGlAccount.glAccountId">
+                    <field-to-result field="invoiceItemTypeGlAccount.glAccountId" result-name="glAccountId"/>
+                    <return/>
+                </if-not-empty>
+                <entity-one entity-name="InvoiceItemType" value-field="invoiceItemType">
+                    <field-map field-name="invoiceItemTypeId" from-field="parameters.glAccountTypeId"/>
+                </entity-one>
+                <if-not-empty field="invoiceItemType.defaultGlAccountId">
+                    <field-to-result field="invoiceItemType.defaultGlAccountId" result-name="glAccountId"/>
+                    <return/>
+                </if-not-empty>
 
                 <if-not-empty field="parameters.productId">
                     <if-compare field="parameters.acctgTransTypeId" operator="equals" value="PURCHASE_INVOICE">
@@ -620,18 +632,6 @@ under the License.
                         <return/>
                     </if-not-empty>
                 </if-not-empty>
-                <call-simple-method method-name="getInvoiceItemTypeGlAccountInline"/>
-                <if-not-empty field="invoiceItemTypeGlAccount.glAccountId">
-                    <field-to-result field="invoiceItemTypeGlAccount.glAccountId" result-name="glAccountId"/>
-                    <return/>
-                </if-not-empty>
-                <entity-one entity-name="InvoiceItemType" value-field="invoiceItemType">
-                    <field-map field-name="invoiceItemTypeId" from-field="parameters.glAccountTypeId"/>
-                </entity-one>
-                <if-not-empty field="invoiceItemType.defaultGlAccountId">
-                    <field-to-result field="invoiceItemType.defaultGlAccountId" result-name="glAccountId"/>
-                    <return/>
-                </if-not-empty>
                 <return/>
             </then>
         </if>

Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoAcctgTransTestsSales.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoAcctgTransTestsSales.xml?rev=1331308&r1=1331307&r2=1331308&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoAcctgTransTestsSales.xml (original)
+++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/test/AutoAcctgTransTestsSales.xml Fri Apr 27 09:11:29 2012
@@ -152,7 +152,7 @@ under the License.
         <assert><not><if-empty field="accountsReceivableEntries"></if-empty></not></assert>
 
         <clear-field field="acctgTransEntryFilter"/>
-        <set field="acctgTransEntryFilter.glAccountId" value="400000"/>
+        <set field="acctgTransEntryFilter.glAccountId" value="401000"/>
         <filter-list-by-and list="acctgTransEntryList" to-list="salesAccountEntries" map="acctgTransEntryFilter"/>
         <assert><not><if-empty field="salesAccountEntries"></if-empty></not></assert>