Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-1434 General Ledger
  3. OFBIZ-1481

Implement an automatic GL posting service triggered when an actual cost record is created for a work effort

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Trunk
    • None
    • accounting
    • None

    Description

      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

      Attachments

        Activity

          People

            anilpatel Anil K Patel
            jacopoc Jacopo Cappellato
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: