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

Jacopo Cappellato commented on OFBIZ-1481:
------------------------------------------

the eca rule that will trigger the service is:

    <eca service="createWorkEffortInventoryProduced" event="commit">
        <condition field-name="workEffortId" operator="is-not-empty"/>
        <condition field-name="costComponentTypeId" operator="not-equals" 
value="ACTUAL_MAT_COST"/>
        <action service="createAcctgTransForWorkEffortCost" mode="sync"/>
    </eca>

Please include it in the patch.


> Implement an automatic GL posting service triggered when an actual cost 
> record is created for a work effort
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-1481
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1481
>             Project: OFBiz
>          Issue Type: Sub-task
>          Components: accounting
>    Affects Versions: SVN trunk
>            Reporter: Jacopo Cappellato
>
> Name of the service: "createAcctgTransForWorkEffortCost" or similar
> Service definition:
>     <service name="createAcctgTransForWorkEffortCost" engine="simple" 
> auth="true"
>         location="org/ofbiz/accounting/ledger/GeneralLedgerServices.xml" 
> invoke="createAcctgTransForWorkEffortCost">
>         <description>Create an accounting transaction for cost record created 
> for a work effort</description>
>         <attribute name="workEffortId" type="String" mode="IN" 
> optional="false"/>
>         <attribute name="costComponentId" type="String" mode="IN" 
> optional="false"/>
>         <attribute name="acctgTransId" type="String" mode="OUT" 
> optional="true"/>
>     </service>
> 1) get the CostComponent with id parameters.costComponentId and use its 
> fields for the origAmount and origCurrencyUomId: cost and costUomId
> 2) get the CostComponentCalc record associated to the CostComponent and use 
> its fields for the debit/credit account types: costGlAccountTypeId is for the 
> credit, offsettingGlAccountTypeId is for the debit (if this is empty, use 
> "WIP_INVENTORY")
> 3) get the WorkEffort with id parameters.workEffortId and get the Facility 
> associated to it: use the Facility.ownerPartyId for the organizationPartyId
> 4) as we did in OFBIZ-1474, if (WorkEffort.workEffortTypeId == 
> PROD_ORDER_TASK and WorkEffort.workEffortParentId is not empty) then select 
> the first record from WorkEffortGoodStandard where (workEffortId == 
> WorkEffort.workEffortParentId and workEffortGoodStdTypeId == 
> "PRUN_PROD_DELIV")
> 5) use the WorkEffortGoodStandard.productId field of this record to fill the 
> productId of the *Debit* Account Trans entry.
> 6) call the createAcctgTransAndEntries service passing the list with the two 
> debit/credit entries, workEffortId = parameters.workEffortId, 
> acctgTransTypeId = "MANUFACTURING"
> Please add information about this new service to the following wiki page:
> http://docs.ofbiz.org/x/Qw0

-- 
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