Apache OFBiz

Production Cost Calculation in Apache OFBiz

by Swapnil Shah |
Production Cost Calculation in Apache OFBiz

Every manufacturing operation raises a critical question once production is complete: what did it actually cost to produce each unit?

Once a Production Run is complete, Apache OFBiz captures the actual costs incurred across every stage of production: the materials consumed, the time spent on each operation, and any additional product-level costs such as packaging or overhead. This gives manufacturers a precise view of their true production costs, not estimates, but what was actually spent.

In Apache OFBiz, production cost calculation is built around the relationship between routing tasks, cost formulas, and inventory values. When set up correctly, the system calculates costs automatically as production progresses, leaving no room for manual guesswork or end-of-month reconciliation surprises.

Types of Production Costs in Apache OFBiz

Before configuring cost calculation, it helps to understand the two main categories of costs Apache OFBiz supports.

Actual Costs

Actual Costs are the real expenses incurred during production. They are calculated after production is complete and reflect what was truly consumed to manufacture the product, covering materials used, labor time logged, and any operational overhead applied. This guide focuses entirely on actual cost calculation.

Standard Costs

Standard Costs are predetermined estimates set before production begins. They serve as a benchmark for measuring efficiency and comparing against actual costs once production is done.

Fixed and Variable Costs

Within actual costs, Apache OFBiz distinguishes between two types:

  • Fixed Costs: Expenses that remain constant regardless of the quantity produced, such as equipment depreciation, facility rent, or base operator wages
  • Variable Costs: Expenses that change in proportion to the quantity produced, such as raw materials, energy consumption, or piece-rate labor. Producing more units means higher total variable costs

How Production Cost Calculation Works in Apache OFBiz

Apache OFBiz calculates actual production costs at two levels: the routing task level and the product level. Together, these cover every component of what it costs to manufacture a finished good.

Routing Task Level Costs

Each routing task in a production run, such as Lamination, Shape Deck, or Final Assembly, can have a cost formula attached to it. This formula defines how the cost of that task is calculated based on the time taken to complete it.

The formula Apache OFBiz uses is:

Fixed Cost + (Variable Cost per Time Slot ÷ Time Slot) × Actual Task Time

Once a routing task is completed and the actual time is logged, Apache OFBiz applies this formula automatically to calculate the task cost. This means the more precisely task times are recorded, the more accurate the cost output.

Product Level Costs

Beyond routing tasks, manufacturers often need to include additional costs that are specific to the product but not tied to any individual operation. Examples include packaging, labeling, quality checks, or overhead percentages.

Apache OFBiz allows these to be defined at the product level using a Cost Component Calc. Once attached to the product, these costs are included in the final production cost calculation alongside material and task costs.

Material Costs

Material costs are fetched automatically from inventory. When components are issued against a production run, Apache OFBiz picks up the inventory item cost for each component. This cost is determined at the time of receiving, based either on the purchase cost from the supplier or the manufacturing cost if the item was produced internally.

Example: Cost Calculation for Skateboard Manufacturing

Let's revisit the skateboard manufacturing example used throughout this series. The finished product, Skateboard (STC1005), is made up of an intermediate sub-assembly, the Deck (STC1004), along with individually sourced components: Sticker (STC1001), Warranty Card (STC1002), and Transfer (STC1003).

Material Cost Breakdown

Apache OFBiz fetches the following material costs from inventory when components are issued against the production run:

Category

Component

Cost

Notes

Deck Components

Glue

$10

Face

$30

Core

$100

Ply

$53

Deck Subtotal

$193

Individual Components

Sticker

$4

2 pieces @ $2 each

Warranty Card

$1

Transfer

$2

Total Material Cost

$200

Routing Task Cost Breakdown

Three routing tasks are performed across the two production runs (Deck and Skateboard). A cost formula is defined for each:

Task

Cost Calc ID

Time Slot (ms)

Fixed Cost

Variable Cost / Slot

Deck Lamination

Costing - Lamination

45,000

$0

$5

Shape Deck

Costing - Shape Deck

45,000

$0

$5

Final Assembly

Costing - Final Assembly

1,800,000

$0

$10

Once actual task times are recorded during the production run, Apache OFBiz applies the formula to each task and calculates the operational cost automatically.

Product Level Cost

For the skateboard, an additional overhead cost is applied at the product level using the GEN_COST_CALC formula available in Apache OFBiz. This represents a 5% overhead on total cost, covering expenses such as packaging and shipping that are not captured at the task level.

Setting Up Cost Calculation in Apache OFBiz

Configuring production cost calculation in Apache OFBiz involves three steps: creating cost formulas, linking them to routing tasks, and attaching any product-level cost formulas to the finished product.

Step 1: Create Cost Component Calcs

Navigate to Manufacturing > Cost Calculation to define the cost formulas. For each routing task, create a Cost Component Calc record specifying the Fixed Cost, Variable Cost per Time Slot, and the Time Slot interval. For product-level costs, create or use an existing formula such as GEN_COST_CALC.

Step 2: Assign Cost Formulas to Routing Tasks

Navigate to Manufacturing > Routing Tasks, open each task, and go to the Routing Task Costs tab. Select the Cost Component Type and link the corresponding Cost Component Calc ID. Set the effective From Date and an optional Through Date.

Step 3: Assign Cost Formulas to Products

Navigate to Catalog > Products, open the finished product, and go to the Costs tab. Attach the product-level Cost Component Calc to capture overhead or additional costs that apply at the product level rather than at individual tasks.

For detailed step-by-step instructions, refer to the Understanding Actual Production Cost Calculation in Apache OFBiz guide on the Apache OFBiz Confluence wiki.

Why Production Cost Calculation Matters

Accurate cost calculation does more than satisfy accounting requirements. In Apache OFBiz, it:

  • Provides the actual cost per unit produced, enabling accurate pricing and margin analysis
  • Captures cost at the task level, showing which operations are most expensive and where efficiency can be improved
  • Feeds into inventory valuation, ensuring finished goods are recorded at their true production cost
  • Supports comparison between actual and standard costs, helping identify variances and improve future estimates
  • Gives management a reliable cost basis for decisions around product pricing, make-or-buy analysis, and capacity planning

Conclusion

Production cost calculation is the final step in the manufacturing cycle. It brings together the material costs from inventory, the operational costs from routing tasks, and any product-level overhead into a single, accurate view of what it cost to produce each unit.

Apache OFBiz handles this through a structured combination of Cost Component Calcs, routing task assignments, and product-level cost formulas, ensuring that every cost is captured, every formula is applied consistently, and every production run produces a reliable cost record.

This completes the Apache OFBiz Manufacturing series, from defining the Bill of Materials and Routing, through MRP, Purchase Orders, Inventory Receiving, and Production Runs, to understanding the true cost of what was manufactured.

Looking to implement and optimize Apache OFBiz manufacturing for your business? Partner with HotWax Systems for a tailored solution built around your operations.

Topic: Apache OFBiz
Swapnil Shah
Swapnil Shah, Vice President of Consulting at HotWax Systems, brings over 21 years of experience in supply chain software development and consulting. He analyzes business and technology challenges, identifies key requirements, and crafts tailored solutions to optimize supply chain efficiency. An expert in Apache OFBiz, Swapnil is also an active contributor to the Apache OFBiz community, powered by the Apache Software Foundation.
Swapnil Shah