Author: jacopoc
Date: Mon Oct 14 10:58:33 2013 New Revision: 1531849 URL: http://svn.apache.org/r1531849 Log: Applied fix from trunk for revision: 1531848 === Fixed bug reported by Simon Maskell in OFBIZ-5344 with a slightly different patch than the one provided by Simon. Also added a TODO comment to warn that the current logic doesn't work well for LIFO/FIFO. Modified: ofbiz/branches/release13.07/ (props changed) ofbiz/branches/release13.07/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml Propchange: ofbiz/branches/release13.07/ ------------------------------------------------------------------------------ Merged /ofbiz/trunk:r1531848 Modified: ofbiz/branches/release13.07/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/release13.07/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml?rev=1531849&r1=1531848&r2=1531849&view=diff ============================================================================== --- ofbiz/branches/release13.07/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml (original) +++ ofbiz/branches/release13.07/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml Mon Oct 14 10:58:33 2013 @@ -1415,9 +1415,11 @@ under the License. </simple-method> <simple-method method-name="createAcctgTransForInventoryItemCostChange" short-description="Create accounting transaction when item cost is changed (D: INV_ADJ_VAL, C: INVENTORY_ACCOUNT)"> + <!-- TODO: the logic in this service needs to be reimplemented to properly implement FIFO/LIFO valuation methods --> <!-- retrieve ledger rounding properties --> <call-simple-method method-name="getGlArithmeticSettingsInline"/> <entity-one entity-name="InventoryItemDetail" value-field="newInventoryItemDetail"/> + <get-related-one value-field="newInventoryItemDetail" relation-name="InventoryItem" to-value-field="inventoryItem"/> <entity-condition entity-name="InventoryItemDetail" list="inventoryItemDetails"> <condition-list> <condition-expr field-name="inventoryItemId" operator="equals" from-field="newInventoryItemDetail.inventoryItemId"/> @@ -1429,7 +1431,7 @@ under the License. <first-from-list list="inventoryItemDetails" entry="oldInventoryItemDetail"/> <if-not-empty field="oldInventoryItemDetail"> <calculate field="origAmount" decimal-scale="${ledgerDecimals}" rounding-mode="${roundingMode}"> - <calcop operator="multiply" field="newinventoryItem.quantityOnHandTotal"> + <calcop operator="multiply" field="inventoryItem.quantityOnHandTotal"> <calcop operator="subtract"> <calcop operator="get" field="oldInventoryItemDetail.unitCost"/> <calcop operator="get" field="newInventoryItemDetail.unitCost"/> @@ -1438,7 +1440,6 @@ under the License. </calculate> <!-- if originAmount is equals to 0 do not create transaction, this is causing error in postAcctgTrans --> <if-compare operator="not-equals" field="origAmount" value="0"> - <get-related-one value-field="newInventoryItemDetail" relation-name="InventoryItem" to-value-field="inventoryItem"/> <!-- Credit --> <make-value entity-name="AcctgTransEntry" value-field="creditEntry"/> <set field="creditEntry.debitCreditFlag" value="C"/> |
Free forum by Nabble | Edit this page |