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 2007/12/16 19:11:01 UTC

svn commit: r604666 - /ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml

Author: jacopoc
Date: Sun Dec 16 10:10:59 2007
New Revision: 604666

URL: http://svn.apache.org/viewvc?rev=604666&view=rev
Log:
Fixed bug found while testing the new gl posting service for inventory cost change.

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=604666&r1=604665&r2=604666&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 Sun Dec 16 10:10:59 2007
@@ -951,7 +951,8 @@
         <entity-one entity-name="InventoryItemDetail" value-name="newInventoryItemDetail"/>
         <entity-condition entity-name="InventoryItemDetail" list-name="inventoryItemDetails">
             <condition-list>
-                <condition-expr field-name="unitCost" operator="not-equals" value="0.00"/>
+                <condition-expr field-name="inventoryItemId" operator="equals" env-name="newInventoryItemDetail.inventoryItemId"/>
+                <condition-expr field-name="unitCost" operator="not-equals" env-name="nullField"/>
                 <condition-expr field-name="inventoryItemDetailSeqId" operator="not-equals" env-name="parameters.inventoryItemDetailSeqId"/>
             </condition-list>
             <order-by field-name="-effectiveDate"/>
@@ -966,36 +967,36 @@
                     </calcop>
                 </calcop>
             </calculate>
-        </if-not-empty>
-        <get-related-one value-name="newInventoryItemDetail" relation-name="InventoryItem" to-value-name="inventoryItem"/>
-        <!-- Credit -->
-        <make-value entity-name="AcctgTransEntry" value-name="creditEntry"/>
-        <set field="creditEntry.debitCreditFlag" value="C"/>
-        <set field="creditEntry.glAccountTypeId" value="INVENTORY_ACCOUNT"/>
-        <set field="creditEntry.organizationPartyId" from-field="inventoryItem.ownerPartyId"/>
-        <set field="creditEntry.productId" from-field="inventoryItem.productId"/>
-        <set field="creditEntry.origAmount" from-field="origAmount"/>
-        <set field="creditEntry.origCurrencyUomId" from-field="inventoryItem.currencyUomId"/>
-        <!-- Debit -->
-        <make-value entity-name="AcctgTransEntry" value-name="debitEntry"/>
-        <set field="debitEntry.debitCreditFlag" value="D"/>
-        <set field="debitEntry.glAccountTypeId" value="INV_ADJ_VAL"/>
-        <set field="debitEntry.organizationPartyId" from-field="inventoryItem.ownerPartyId"/>
-        <set field="debitEntry.productId" from-field="inventoryItem.productId"/>
-        <set field="debitEntry.origAmount" from-field="origAmount"/>
-        <set field="debitEntry.origCurrencyUomId" from-field="inventoryItem.currencyUomId"/>
+            <get-related-one value-name="newInventoryItemDetail" relation-name="InventoryItem" to-value-name="inventoryItem"/>
+            <!-- Credit -->
+            <make-value entity-name="AcctgTransEntry" value-name="creditEntry"/>
+            <set field="creditEntry.debitCreditFlag" value="C"/>
+            <set field="creditEntry.glAccountTypeId" value="INVENTORY_ACCOUNT"/>
+            <set field="creditEntry.organizationPartyId" from-field="inventoryItem.ownerPartyId"/>
+            <set field="creditEntry.productId" from-field="inventoryItem.productId"/>
+            <set field="creditEntry.origAmount" from-field="origAmount"/>
+            <set field="creditEntry.origCurrencyUomId" from-field="inventoryItem.currencyUomId"/>
+            <!-- Debit -->
+            <make-value entity-name="AcctgTransEntry" value-name="debitEntry"/>
+            <set field="debitEntry.debitCreditFlag" value="D"/>
+            <set field="debitEntry.glAccountTypeId" value="INV_ADJ_VAL"/>
+            <set field="debitEntry.organizationPartyId" from-field="inventoryItem.ownerPartyId"/>
+            <set field="debitEntry.productId" from-field="inventoryItem.productId"/>
+            <set field="debitEntry.origAmount" from-field="origAmount"/>
+            <set field="debitEntry.origCurrencyUomId" from-field="inventoryItem.currencyUomId"/>
+
+            <set field="acctgTransEntries[]" from-field="creditEntry" type="Object"/>
+            <set field="acctgTransEntries[]" from-field="debitEntry" type="Object"/>
 
-        <set field="acctgTransEntries[]" from-field="creditEntry" type="Object"/>
-        <set field="acctgTransEntries[]" from-field="debitEntry" type="Object"/>
-      
-        <set field="createAcctgTransAndEntriesInMap.glFiscalTypeId" value="ACTUAL"/>
-        <set field="createAcctgTransAndEntriesInMap.acctgTransTypeId" value="INVENTORY"/>
-        <set field="createAcctgTransAndEntriesInMap.shipmentId" from-field="parameters.InventoryItemId"/>
-        <set field="createAcctgTransAndEntriesInMap.acctgTransEntries" from-field="acctgTransEntries"/>
-        <call-service service-name="createAcctgTransAndEntries" in-map-name="createAcctgTransAndEntriesInMap">
-            <result-to-field result-name="acctgTransId"/>
-        </call-service>
-        <field-to-result field-name="acctgTransId" result-name="acctgTransId"/>
+            <set field="createAcctgTransAndEntriesInMap.glFiscalTypeId" value="ACTUAL"/>
+            <set field="createAcctgTransAndEntriesInMap.acctgTransTypeId" value="INVENTORY"/>
+            <set field="createAcctgTransAndEntriesInMap.shipmentId" from-field="parameters.InventoryItemId"/>
+            <set field="createAcctgTransAndEntriesInMap.acctgTransEntries" from-field="acctgTransEntries"/>
+            <call-service service-name="createAcctgTransAndEntries" in-map-name="createAcctgTransAndEntriesInMap">
+                <result-to-field result-name="acctgTransId"/>
+            </call-service>
+            <field-to-result field-name="acctgTransId" result-name="acctgTransId"/>
+        </if-not-empty>
     </simple-method>
 
     <simple-method method-name="createAcctgTransForPhysicalInventoryVariance" short-description="Create an Account Transaction For Physical Inventory Variance">