Costing Server

From InfiniteERP Wiki
Jump to: navigation, search

Template:BackToAlias

Introduction

This document describes how the costing server process calculates the cost of the transactions booked in Openbravo.

The "Costing Server" process is the new "Costing Engine" process in charge of calculating the cost of the material transactions.

This process is used by the Costing Background Process as it searches for material or goods transactions such as "Goods Receipts" or "Goods Movements" for which its cost has not been calculated yet and get it calculated by using the "Costing Server" process.

Upgrading from previous releases

The Costing Server process is included in Openbravo 3 starting from MP13 as part of the new Openbravo costing engine.

Instances that upgrade from previous Openbravo releases can migrate their costs to the new costing engine. Costing migration is not mandatory but it is highly recommended.

You can find detailed information about the migration process in the Costing Migration Process document.

Costs Calculation

A cost is calculated for each material transaction by taking into account:

  • the organization or legal entity it belongs to
  • its "transaction process" date
  • and its "price" if any

Note that costs are calculated in the Organization's currency.

The costing algorithm and the costing dimensions to use for calculating the cost of the products can be configured in a Costing Rule which needs to be assigned to a "legal entity" type organization.

It is possible to use different Costing Algorithms while calculating the cost:

  • Openbravo ships Average and Standard costing algorithms.
  • Other algorithms such as FIFO and LIFO can be implemented by Extension Modules.
Bulbgraph.png   Manufacturing cost calculation through the Costing Server process is not fully implemented yet. The cost of the products set to be used in production are always calculated using the "Average" costing algorithm, besides the cost is calculated at client level. All of that regardless the Costing Rule in use.

Since Openbravo 3.0 MP20 the Standard Algorithm has been modified to better support the Manufacturing Costs and it is not overwritten to use the Average algorithm, although there are some shortcomings yet to be resolved

Cost Calculation Methods

A default method is used to calculate the cost of a transaction which can be overwritten by the costing algorithm used.

Overall there are two methods of calculating costs, the first one applies to "input" transactions such as a "Goods Receipt" and the second one applies to "output" transactions such as a "Goods Shipment".

Input transactions

Input transactions can be cost calculated

  • by using the "product's purchase price"
  • or by using the "default standard cost" defined in the Costing tab of the "Product" window in case of calculating product costs by using an "Standard" costing rule/algorithm.

The Default Cost method is used in those cases when it is not possible to get the price of a transaction for which its cost needs to be calculated.
This method takes into account:

  • either the "product's purchase price list" (or the vendor's purchase price list if the transaction has a business partner related)
  • or the "default standard cost" defined in the Costing tab of the Product, note that is the "Standard" cost defined and not the "Legacy Standard Cost" as this one belongs to the "old" engine:
  • If both values are available this method uses the newer one.
  • If none is available a "Not possible to calculate cost" error is thrown.
  • In case of calculating product costs by using an "Average" costing rule:
    • the average algorithm overrides the behavior of the "Default Cost" method prioritizing the use of the current "Average Cost" if any
      instead of using the product's price list or the standard cost of the product.

Input transactions are:

  • Goods Receipt : the cost of a goods receipt is calculated based on the related purchase order price of the goods, excluding taxes.
    If there is no a related purchase order price the costing server process uses the newer of the following three values:
    • the last purchase order price of the receipt's vendor for the product.
    • the purchase price of the product in the receipt's vendor price list.
    • or the default standard cost of the product.
  • Returned Shipment or Canceled Shipment: the cost of a goods shipment being returned or just cancelled is calculated based on the cost calculated for the original goods shipment.
  • Negative Shipment : the cost is calculated based on the Default Cost method as a negative shipment can be created by just entering negative goods quantity lines in a goods shipment.
  • Physical inventory which increases the stock : if a unit cost is defined in the Physical Inventory lines the total cost amount is calculated using that cost multiplied by the increased stock quantity.
    If there is no cost defined the Default Cost method is used instead.
  • Internal movement to : the cost is the same as the "Internal Movement From" transaction calculated cost
  • Produced BOM Production product: the cost is the sum of the transaction costs of each part used to produce the BOM product.
  • Manufacturing Produced product : it gets the cost from the Work Effort which is calculated using the existing manufacturing cost procedures.
  • Manufacturing Consumed product : it gets the cost from the Work Effort which is calculated using the existing manufacturing cost procedures.
  • Canceled Internal consumption : the cost is calculated based on the cost of the internal consumption transaction being canceled.
  • Negative Internal consumption : the cost is calculated based on the Default Cost method.

Output transactions

Output transactions are cost calculated depending on the costing algorithm used.
For instance:

  • In case of calculating costs by using an "Average" costing rule the cost of a transaction is the average cost calculated for the product multiplied by the movement quantity of the transaction.
  • In case of calculating costs by using an "Standard" costing rule the cost of a transaction is the default standard cost of the product multiplied by the movement quantity of the transaction.

Output transactions are:

  • Goods Shipment
  • Negative Receipt
  • Internal Movement from
  • Used BOM Production part
  • Physical inventory which decreases the stock
  • Internal Consumption
  • Returned Receipt or Canceled Receipt: regardless this can be considered an output type transaction, the cost of a goods receipt being returned or canceled is calculated based on the cost calculated for the original goods receipt.

Costs Review

Once costs are calculated are stored in the corresponding material transaction with the organization's currency and the costing algorithm used.
That cost is used by the Accounting Server and other processes and reports that uses the costs as a source of data.

There are several reports and windows where cost can be checked or can be used:

  • the Transaction tab of the "Product" window:
    • In this tab it is possible to check if the cost of each product transaction has been calculated and if calculated it is possible to check its cost.
  • the Transaction Cost tab of the "Product" window:
    • In this tab it is possible to review all the cost related transaction automatically created by the costing background process, those transactions can be:
      • purely cost calculation related ones, these ones have "Cost Adjustment Line" column empty
      • or cost adjustments related ones, these ones are cost adjustments transaction with the "Cost Adjustment Line" column filled in.
  • the Costing tab of the "Product" window:
    • this tab stores each calculated cost and the date range when the calculated cost is valid whenever the "Average" or the "Standard" costing algorithms have been used.
  • the Valued Stock Report:
    • the costs shown by this report are the ones calculated by the new costing engine.
  • the Sales Invoice Dimensional Report:
    • the margins shown by this report are the ones calculated according to the new way of calculating the costs.