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

Implement an automatic GL posting service triggered when InventoryItem.unitCost is changed

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Trunk
    • None
    • accounting
    • 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

      Attachments

        1. glPostingService.patch
          7 kB
          Vikas Mayur
        2. glPostingService.patch
          7 kB
          Jyotsna Rathore
        3. glPostingService.patch
          7 kB
          Jyotsna Rathore

        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: