Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 92F04200D18 for ; Wed, 11 Oct 2017 09:40:33 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 911E41609E4; Wed, 11 Oct 2017 07:40:33 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 888BD1609CA for ; Wed, 11 Oct 2017 09:40:32 +0200 (CEST) Received: (qmail 20850 invoked by uid 500); 11 Oct 2017 07:40:31 -0000 Mailing-List: contact notifications-help@ofbiz.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ofbiz.apache.org Delivered-To: mailing list notifications@ofbiz.apache.org Received: (qmail 20841 invoked by uid 99); 11 Oct 2017 07:40:31 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Oct 2017 07:40:31 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 7F0611A50E5 for ; Wed, 11 Oct 2017 07:27:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -98.689 X-Spam-Level: X-Spam-Status: No, score=-98.689 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, URI_HEX=1.313, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id XITtHZNmWNlG for ; Wed, 11 Oct 2017 07:27:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id D35455FD33 for ; Wed, 11 Oct 2017 07:27:00 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 54BBDE05C1 for ; Wed, 11 Oct 2017 07:27:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 0EAB224386 for ; Wed, 11 Oct 2017 07:27:00 +0000 (UTC) Date: Wed, 11 Oct 2017 07:27:00 +0000 (UTC) From: "Paul Foxworthy (JIRA)" To: notifications@ofbiz.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (OFBIZ-9500) Maintain accountingQuantity for all COGS valuation methods MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 11 Oct 2017 07:40:33 -0000 [ https://issues.apache.org/jira/browse/OFBIZ-9500?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Paul Foxworthy updated OFBIZ-9500: ---------------------------------- Description: From http://ofbiz.135035.n4.nabble.com/AccountingQuantity-COGS-method-and-inventory-valuation-td4700867.html *Why accounting quantity?* When inventory is shipped, there's an accounting transaction that debits the inventory on hand value and credits Cost of Goods Sold (COGS). There's more than one way of deciding what value is added to COGS. First and most obvious is the actual cost of the inventory item. But companies may prefer other strategies. OFBiz has the option of three others: average cost, first-in-first-out or last-in-first-out. There's a nice survey of _why_ you might choose one of these at http://www.dummies.com/business/operations-management/choosing-an-accounting-method-for-the-cost-of-goods-sold-expense/, http://www.dummies.com/business/accounting/the-fifo-method-for-cost-of-goods-sold/, http://www.dummies.com/business/accounting/the-lifo-method-for-cost-of-goods-sold/ Note that if you choose anything other than inventory item cost, the money amount transferred to the COGS account may be *different* to the cost price of the inventory items being shipped. When you choose FIFO or LIFO, the amount may have originated from a different inventory item, received at a different time. *Current situation in OFBiz* The cogsMethodId field in the PartyAcctgPreference entity is a enum with four possible values: COGS_INV_COST, COGS_AVG_COST, COGS_FIFO, COGS_LIFO.. The accountingQuantity field in the InventoryItem entity and accountingQuantityDiff in the InventoryItemDetail entity track the quantity of an item still "live" for the purpose of inventory valuation and COGS. In the service createAcctgTransForShipmentReceipt implemented in /applications/accounting/minilang/ledger/GeneralLedgerServices.xml (http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/minilang/ledger/GeneralLedgerServices.xml?view=markup#l1306) the accountingQuantity is always set to the same value as the quantity received (i.e. the same as the quantityOnHand) for a newly received inventory item regardless of the COGS method. When items are shipped, the service createAcctgTransForSalesShipmentIssuance will only reduce the accounting quantity if the COGS method is FIFO or LIFO (http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/minilang/ledger/GeneralLedgerServices.xml?view=markup#l1127). With FIFO, when an item is shipped, inventory items for the product with a non-zero accounting quantity are found sorted from earliest to latest received. The quantity of the item shipped must be decremented from the accounting quantities, starting with the earliest. Similarly, with LIFO, items are sorted from latest to earliest, and the latest item or items are decremented. In other words, if you have chosen a COGS method of COGS_INV_COST or COGS_AVG_COST, the accounting quantity is meaningless and in OFBiz as of now, should be ignored. And yet, the Inventory Valuation report uses accounting quantity, regardless of the the COGS method (http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryForms.xml?view=markup#l535). In other words, the Inventory Valuation report is broken for COGS methods of COGS_INV_COST or COGS_AVG_COST. *What should happen* The Inventory Valuation report, and anybody else who cares, should always be able to trust the accounting quantity. For COGS_INV_COST and COGS_AVG_COST, maintaining the accounting quantity is simple - createAcctgTransForSalesShipmentIssuanceit should just adjust it to match the remaining quantity on hand. No matter what the COGS method, the total accounting quantity for a product across all inventory items should always be equal to the total QOH. was: From http://ofbiz.135035.n4.nabble.com/AccountingQuantity-COGS-method-and-inventory-valuation-td4700867.html *Why accounting quantity?* When inventory is shipped, there's an accounting transaction that debits the inventory on hand value and credits Cost of Goods Sold (COGS). There's more than one way of deciding what value is added to COGS. First and most obvious is the actual cost of the inventory item. But companies may prefer other strategies. OFBiz has the option of three others: average cost, first-in-first-out or last-in-first-out. There's a nice survey of _why_ you might choose one of these at http://www.dummies.com/business/operations-management/choosing-an-accounting-method-for-the-cost-of-goods-sold-expense/, http://www.dummies.com/business/accounting/the-fifo-method-for-cost-of-goods-sold/, http://www.dummies.com/business/accounting/the-lifo-method-for-cost-of-goods-sold/ Note that if you choose anything other than inventory item cost, the money amount transferred to the COGS account may be *different* to the cost price of the inventory items being shipped. When you choose FIFO or LIFO, the amount may have originated from a different inventory item, received at a different time. *Current situation in OFBiz* The cogsMethodId field in the PartyAcctgPreference entity is a enum with four possible values: COGS_INV_COST, COGS_AVG_COST, COGS_FIFO, COGS_LIFO.. The accountingQuantity field in the InventoryItem entity and accountingQuantityDiff in the InventoryItemDetail entity track the quantity of an item still "live" for the purpose of inventory valuation and COGS. In the service createAcctgTransForShipmentReceipt implemented in /applications/accounting/minilang/ledger/GeneralLedgerServices.xml (http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/minilang/ledger/GeneralLedgerServices.xml?view=markup#l1306) the accountingQuantity is always set to the same value as the quantity received (i.e. the same as the quantityOnHand) for a newly received inventory item regardless of the COGS method. When items are shipped, the service createAcctgTransForSalesShipmentIssuance will only reduce the accounting quantity if the COGS method is FIFO or LIFO (http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/minilang/ledger/GeneralLedgerServices.xml?view=markup#l1127). With FIFO, when an item is shipped, inventory items for the product with a non-zero accounting quantity are found sorted from earliest to latest received. The quantity of the item shipped must be decremented from the accounting quantities, starting with the earliest. Similarly, with LIFO, items are sorted from latest to earliest, and the latest item or items are decremented. In other words, if you have chosen a COGS method of COGS_INV_COST or COGS_AVG_COST, the accounting quantity is meaningless and in OFBiz as of now, should be ignored. And yet, the Inventory Valuation report uses accounting quantity, regardless of the the COGS method (http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryForms.xml?view=markup#l535). In other words, the Inventory Valuation report is broken for COGS methods of COGS_INV_COST or COGS_AVG_COST. *What should happen* The Inventory Valuation report, and anybody else who cares, should always be able to trust the accounting quantity. For COGS_INV_COST and COGS_AVG_COST, maintaining the accounting quantity is simple - createAcctgTransForSalesShipmentIssuanceit should just adjust it to match the remaining quantity on hand. No matter what the COGS method, the total accounting quantity for a product across all inventory items should always be equal to the total QOH. Changed viewvc URLs to reflect new directory structure > Maintain accountingQuantity for all COGS valuation methods > ---------------------------------------------------------- > > Key: OFBIZ-9500 > URL: https://issues.apache.org/jira/browse/OFBIZ-9500 > Project: OFBiz > Issue Type: Improvement > Components: accounting, order, product > Affects Versions: Trunk > Reporter: Paul Foxworthy > Assignee: Paul Foxworthy > Labels: accounting, inventory, stock, valuation > > From http://ofbiz.135035.n4.nabble.com/AccountingQuantity-COGS-method-and-inventory-valuation-td4700867.html > *Why accounting quantity?* > When inventory is shipped, there's an accounting transaction that debits the inventory on hand value and credits Cost of Goods Sold (COGS). > There's more than one way of deciding what value is added to COGS. > First and most obvious is the actual cost of the inventory item. But companies may prefer other strategies. OFBiz has the option of three others: average cost, first-in-first-out or last-in-first-out. There's a nice survey of _why_ you might choose one of these at http://www.dummies.com/business/operations-management/choosing-an-accounting-method-for-the-cost-of-goods-sold-expense/, http://www.dummies.com/business/accounting/the-fifo-method-for-cost-of-goods-sold/, http://www.dummies.com/business/accounting/the-lifo-method-for-cost-of-goods-sold/ > Note that if you choose anything other than inventory item cost, the money amount transferred to the COGS account may be *different* to the cost price of the inventory items being shipped. When you choose FIFO or LIFO, the amount may have originated from a different inventory item, received at a different time. > *Current situation in OFBiz* > The cogsMethodId field in the PartyAcctgPreference entity is a enum with four possible values: COGS_INV_COST, COGS_AVG_COST, COGS_FIFO, COGS_LIFO.. > The accountingQuantity field in the InventoryItem entity and accountingQuantityDiff in the InventoryItemDetail entity track the quantity of an item still "live" for the purpose of inventory valuation and COGS. > In the service createAcctgTransForShipmentReceipt implemented in /applications/accounting/minilang/ledger/GeneralLedgerServices.xml > (http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/minilang/ledger/GeneralLedgerServices.xml?view=markup#l1306) > the accountingQuantity is always set to the same value as the quantity received (i.e. the same as the quantityOnHand) for a newly received inventory item regardless of the COGS method. > When items are shipped, the service createAcctgTransForSalesShipmentIssuance will only reduce the accounting quantity if the COGS method is FIFO or LIFO (http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/minilang/ledger/GeneralLedgerServices.xml?view=markup#l1127). With FIFO, when an item is shipped, inventory items for the product with a non-zero accounting quantity are found sorted from earliest to latest received. The quantity of the item shipped must be decremented from the accounting quantities, starting with the earliest. Similarly, with LIFO, items are sorted from latest to earliest, and the latest item or items are > decremented. > In other words, if you have chosen a COGS method of COGS_INV_COST or COGS_AVG_COST, the accounting quantity is meaningless and in OFBiz as of > now, should be ignored. > And yet, the Inventory Valuation report uses accounting quantity, regardless of the the COGS method (http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/ReportFinancialSummaryForms.xml?view=markup#l535). In other words, the Inventory Valuation report is broken for COGS methods of COGS_INV_COST or COGS_AVG_COST. > *What should happen* > The Inventory Valuation report, and anybody else who cares, should always be able to trust the accounting quantity. For COGS_INV_COST and COGS_AVG_COST, maintaining the accounting quantity is simple - createAcctgTransForSalesShipmentIssuanceit should just adjust it to match the remaining quantity on hand. > No matter what the COGS method, the total accounting quantity for a product across all inventory items should always be equal to the total QOH. -- This message was sent by Atlassian JIRA (v6.4.14#64029)