Details
-
Sub-task
-
Status: Closed
-
Major
-
Resolution: Fixed
-
Trunk
-
None
-
None
Description
The name of the service can be "createAcctgTransForInventoryItemCostChange" or similar.
We can use the following template for this service: createAcctgTransForShipmentReceipt in GeneralLedgerServices.xml
The service is triggered by a SECA rule on createInventoryItemDetail with the condition: unitCost is-not-empty and receiptId is-not-empty (we don't want the service to run when the item is received aka created); in this way, every time an InventoryItemDetail with a non null unitCost is created (that means we have changed the cost of the item) we have to run the service to post the following adjustment to the GL:
origAmount = QOH * (oldUnitCost - newUnitCost)
the glAccountTypeId to be used for the double entries are:
INV_ADJ_VAL for D
INVENTORY_ACCOUNT for C
and the acctgTransTypeId is INVENTORY
The newUnitCost is the cost found in the last created InventoryItemDetail, the oldUnitCost is in the most recent InventoryItemDetail (that is not the last one) with unitCost != null