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

lektran
Author: lektran
Date: Tue Jan 26 20:25:39 2010
New Revision: 903402

URL: http://svn.apache.org/viewvc?rev=903402&view=rev
Log:
Don't create an unattributed sales tax acctg trans entry for a sales invoice unless the unattributed tax amount comes back as something other zero.

Modified:
    ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.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=903402&r1=903401&r2=903402&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 Tue Jan 26 20:25:39 2010
@@ -1941,17 +1941,20 @@
                 </iterate>
             </iterate-map>
             <!-- Another entry for tax not attributed to a taxAuthPartyId -->
-            <clear-field field="creditEntry"/>
-            <make-value entity-name="AcctgTransEntry" value-field="creditEntry"/>
-            <set field="creditEntry.debitCreditFlag" value="C"/>
-            <set field="creditEntry.organizationPartyId" from-field="invoice.partyIdFrom"/>
             <call-class-method method-name="getInvoiceUnattributedTaxTotal" class-name="org.ofbiz.accounting.invoice.InvoiceWorker"
                     ret-field="taxAmount">
                 <field field="invoice" type="GenericValue"/>
             </call-class-method>
-            <set field="creditEntry.origAmount" from-field="taxAmount"/>
-            <set field="creditEntry.origCurrencyUomId" from-field="invoice.currencyUomId"/>
-            <set field="acctgTransEntries[]" from-field="creditEntry" type="Object"/>
+            <if-compare field="taxAmount" operator="not-equals" value="0" type="BigDecimal">
+                <clear-field field="creditEntry"/>
+                <make-value entity-name="AcctgTransEntry" value-field="creditEntry"/>
+                <set field="creditEntry.debitCreditFlag" value="C"/>
+                <set field="creditEntry.organizationPartyId" from-field="invoice.partyIdFrom"/>
+                <set field="creditEntry.origAmount" from-field="taxAmount"/>
+                <set field="creditEntry.origCurrencyUomId" from-field="invoice.currencyUomId"/>
+                <set field="creditEntry.glAccountTypeId" value="TAX_ACCOUNT"/>
+                <set field="acctgTransEntries[]" from-field="creditEntry" type="Object"/>
+            </if-compare>
 
             <!-- Debit -->
             <make-value entity-name="AcctgTransEntry" value-field="debitEntry"/>