You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Anil K Patel (JIRA)" <ji...@apache.org> on 2007/12/04 03:01:50 UTC

[jira] Assigned: (OFBIZ-1459) Implement an automatic GL posting service triggered when the ownerPartyId of an inventory item is changed

     [ https://issues.apache.org/jira/browse/OFBIZ-1459?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Anil K Patel reassigned OFBIZ-1459:
-----------------------------------

    Assignee: Anil K Patel

> Implement an automatic GL posting service triggered when the ownerPartyId of an inventory item is changed
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-1459
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1459
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: accounting
>    Affects Versions: SVN trunk
>            Reporter: Jacopo Cappellato
>            Assignee: Anil K Patel
>         Attachments: jira_1459_automatic_GL_posting_service_ownerPartyIdchanged.patch
>
>
> The name of the service can be "createAcctgTransForInventoryItemOwnerChange" or similar.
> Input field: inventoryItemId, oldOwnerPartyId
> Output field: acctgTransId 
> We can use the following template for this service: createAcctgTransForShipmentReceipt in GeneralLedgerServices.xml 
> The service will do the following tasks:
> 1) compute the origAmount as: origAmount = inventoryItem.quantityOnHandTotal * inventoryItem.unitCost
> 2) prepare 2 AcctgTransEntry (a debit and a credit) for the oldOwnerPartyId:
> CREDIT: debitCreditFlag=C, glAcctgTransTypeId=INVENTORY_XFER_IN, productId=InventoryItem.productId, origAmount=(the value computed in 1), origCurrencyUomId=InventoryItem.currencyUomId, organizationPartyId=oldOwnerPartyId 
> DEBIT: debitCreditFlag=D, glAcctgTransTypeId=INVENTORY_ACCOUNT, productId=InventoryItem.productId, origAmount=(the value computed in 1), origCurrencyUomId=InventoryItem.currencyUomId, organizationPartyId=oldOwnerPartyId 
> 3) prepare 2 AcctgTransEntry (a debit and a credit) for the inventoryItem.ownerPartyId:
> CREDIT: debitCreditFlag=C, glAcctgTransTypeId=INVENTORY_ACCOUNT, productId=InventoryItem.productId, origAmount=(the value computed in 1), origCurrencyUomId=InventoryItem.currencyUomId, organizationPartyId=inventoryItem.ownerPartyId 
> DEBIT: debitCreditFlag=D, glAcctgTransTypeId=INVENTORY_XFER_OUT, productId=InventoryItem.productId, origAmount=(the value computed in 1), origCurrencyUomId=InventoryItem.currencyUomId, organizationPartyId=inventoryItem.ownerPartyId
> 4) put the 4 entries in a list and call the createAcctgTransAndEntries service with the following fields: acctgTransTypeId=INVENTORY, acctgTransEntries=(the list with the 4 entries), inventoryItemId=parameters.inventoryItemId, glFiscalTypeId=ACTUAL 
> The ECA will be:
> <eca service="updateInventoryItem" event="commit">
>     <condition field-name="ownerPartyId" operator="is-not-empty"/>
>     <condition-field field-name="ownerPartyId" operator="not-equals" to-field-name="oldOwnerPartyId"/>
>     <action service="createAcctgTransForInventoryItemOwnerChange" mode="sync"/>
> </eca>
> You can then test the service when you go into an Inventory Item in the facility, and change the ownerPartyId of an inventory item.

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