Author: lektran
Date: Wed Nov 18 12:02:02 2009
New Revision: 881738
URL:
http://svn.apache.org/viewvc?rev=881738&view=revLog:
There is currently no way of determining what glAccountTypeId should be used when a CostComponent has been created based on a FixedAsset's FixedAssetStdCost records, hard-coding it as OPERATING_EXPENSE until that is resolved.
Prior to this all Fixed Asset derived CostComponent GL entries were ending up in the error journal.
Fixes the testAcctgTransForActualManufacturingCost test.
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=881738&r1=881737&r2=881738&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 Wed Nov 18 12:02:02 2009
@@ -1674,7 +1674,17 @@
<!-- Credit -->
<make-value entity-name="AcctgTransEntry" value-field="creditEntry"/>
<set field="creditEntry.debitCreditFlag" value="C"/>
- <set field="creditEntry.glAccountTypeId" from-field="costComponentCalc.costGlAccountTypeId"/>
+ <if-not-empty field="costComponentCalc.costGlAccountTypeId">
+ <set field="creditEntry.glAccountTypeId" from-field="costComponentCalc.costGlAccountTypeId"/>
+ <else>
+ <if-not-empty field="costComponent.fixedAssetId">
+ <!-- FIXME: 20091119 There is currently no way of determining what glAccountTypeId should be used when a
+ CostComponent has been created based on a FixedAsset's FixedAssetStdCost records,
+ hard-coding as OPERATING_EXPENSE until that is resolved. -->
+ <set field="creditEntry.glAccountTypeId" value="OPERATING_EXPENSE"/>
+ </if-not-empty>
+ </else>
+ </if-not-empty>
<set field="creditEntry.organizationPartyId" from-field="facility.ownerPartyId"/>
<set field="creditEntry.productId" from-field="workEffortGoodStandard.productId"/>
<set field="creditEntry.origAmount" from-field="costComponent.cost"/>