[ 
https://issues.apache.org/jira/browse/OFBIZ-1457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12547795
 ] 

Jacopo Cappellato commented on OFBIZ-1457:
------------------------------------------

Jyotsna,

you are completely right about the condition on receiptId: the service must be 
executed only if receiptId is-empty.
Sorry for the confuusion.


> Implement an automatic GL posting service triggered when 
> InventoryItem.unitCost is changed
> ------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-1457
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1457
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: accounting
>    Affects Versions: SVN trunk
>            Reporter: Jacopo Cappellato
>         Attachments: glPostingService.patch, glPostingService.patch
>
>
> 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

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to