Skip to content

Operations & Routing Costing

Operations and routing define the manufacturing process steps and their associated costs. This is the core of the conversion cost calculation in CostEngine.


Overview

Operations are the individual manufacturing steps (cutting, turning, threading, etc.) that transform raw material into finished parts.

Routing is the sequence of operations, defining the complete manufacturing path from raw material to finished product.


Operation Data Model

Core Fields

Field Data Type Required Description Source
operation_number Integer Yes Sequence number (1, 2, 3...) Excel
operation_name String Yes Human-readable name (e.g., "Turning") Excel
machine_type String Yes Machine category for MHR lookup Excel
setup_time Decimal (hrs) No One-time setup per batch Excel
cycle_time Decimal (hrs) Yes Time per piece Excel
machine_rate Decimal (₹/hr) No Override default MHR Excel or Master
efficiency_percent Decimal No Machine efficiency (default: 100%) Excel
scrap_percent Decimal No Expected scrap rate for this op Excel
tool_cost_per_piece Decimal No Consumable tool cost Excel
notes Text No Special instructions Excel

Cost Calculation Formula

Per-Operation Cost

\[ \text{Operation Cost} = \text{Setup Cost per Piece} + \text{Cycle Cost} + \text{Tool Cost} \]

Where:

\[ \text{Setup Cost per Piece} = \frac{\text{Setup Time} \times \text{Machine Rate}}{\text{Batch Quantity}} \]
\[ \text{Cycle Cost} = \frac{\text{Cycle Time} \times \text{Machine Rate}}{\text{Efficiency \%}} \]

Example Calculation

Given: - Operation: Threading - Setup Time: 0.30 hrs - Cycle Time: 0.98 hrs - Machine Rate: ₹140/hr - Batch Quantity: 500 pcs - Efficiency: 100% - Tool Cost: ₹2.00/pc

Calculation: 1. Setup Cost per Piece = (0.30 × ₹140) / 500 = ₹0.08 2. Cycle Cost = (0.98 × ₹140) / 1.00 = ₹137.20 3. Tool Cost = ₹2.00 4. Total Operation Cost = ₹0.08 + ₹137.20 + ₹2.00 = ₹139.28


Routing Logic

Sequential Processing

Operations are executed in sequence, with output from one operation feeding into the next:

graph LR
    RM[Raw Material] -->|1000 pcs| Op1[Op 1: Cutting]
    Op1 -->|970 pcs| Op2[Op 2: Turning]
    Op2 -->|951 pcs| Op3[Op 3: Threading]
    Op3 -->|932 pcs| Op4[Op 4: Heat Treat]
    Op4 -->|923 pcs| Op5[Op 5: Coating]
    Op5 -->|914 pcs| Final[Finished Parts]

    style RM fill:#fff3e0
    style Final fill:#c8e6c9

Scrap adjusts quantities at each stage - see Scrap & Yield for details.


Machine Hour Rate (MHR) Lookup

Default Rates from Master Data

Operations reference a Machine Master table for default rates:

Machine Type Default MHR (₹/hr) Overhead Included?
Band Saw ₹120 Yes
CNC Lathe ₹140 Yes
Manual Lathe ₹100 Yes
Drilling Machine ₹90 Yes
Heat Treatment Furnace ₹100 No (external)

Override Logic

  1. Check Excel: If machine_rate specified → use override
  2. Lookup Master: Else, lookup by machine_type
  3. Fallback: If not found → flag error, require manual entry

Batch Economics

Setup Amortization

Setup time is a one-time cost amortized across the batch:

Batch Size Setup Time Cost/Piece Impact
100 pcs 0.30 hrs @ ₹140/hr ₹0.42 High
500 pcs 0.30 hrs @ ₹140/hr ₹0.08 Medium
2000 pcs 0.30 hrs @ ₹140/hr ₹0.02 Low

Key Insight: Larger batches reduce per-piece cost significantly.

Use Case UC-401: When customer changes quantity, setup cost per piece recalculates automatically.


Efficiency Adjustments

Actual vs. Theoretical Time

Machines rarely run at 100% efficiency due to: * Operator breaks * Tool changes * Quality checks * Downtime

Formula:

\[ \text{Effective Cycle Time} = \frac{\text{Theoretical Cycle Time}}{\text{Efficiency %}} \]

Example: * Theoretical: 1.0 hr * Efficiency: 80% * Effective: 1.0 / 0.80 = 1.25 hrs (25% higher cost)


Special Operation Types

1. Outside Processes

Operations subcontracted to external vendors (e.g., heat treatment, plating).

Different handling: See Outside Processes

2. Multi-Stage Operations

Some operations have sub-steps:

Example: Turning - Roughing pass: 70% of cycle time - Finishing pass: 30% of cycle time

Implementation: Model as separate operations or use notes field.

3. Parallel Operations

If operations can run simultaneously:

Example: - Op 3a: Threading (Part A) - Op 3b: Grinding (Part B)

Implementation: Same operation number (3) with suffix (a, b).


Tooling in Operations

Consumable vs. Durable Tools

Tool Type Costing Method Example
Consumable Cost per piece Threading inserts (₹2/pc)
Durable Amortized over life Cutting blade (₹5000 / 10,000 pcs = ₹0.50/pc)

See Material Cost for detailed tooling logic.


Validation Rules

Pre-Calculation Validation

Rule Severity Check
Operation sequence Error Numbers must be sequential (1, 2, 3...)
Cycle time > 0 Error Cannot be zero or negative
Cycle time < 24 hrs Warning Unusually high, confirm typo
Machine type exists Error Must be in Machine Master
Efficiency 50-100% Warning Outside normal range
Scrap > 30% Warning Unusually high scrap

Edge Cases

1. Zero Setup Time

Scenario: Continuous process (no batch setup)

Handling: Set setup_time = 0, only cycle cost applies

2. Operation Bypass

Scenario: Customer has pre-processed material (e.g., pre-cut bars)

Handling: Set operation cost = 0 and add note explaining bypass

3. Rework Operations

Scenario: Parts require rework after inspection

Handling: Add separate "Rework" operation with own scrap rate


Explainability for Operations

Drill-Down Display

When user clicks on operation cost:

Operation  2: Turning - ₹72.05

Source Data:
✓ Setup Time: 0.20 hrs (from Excel cell E12)
✓ Cycle Time: 0.60 hrs (from Excel cell F12)
✓ Machine Rate: ₹120/hr (from Machine Master: CNC Lathe)
✓ Batch Quantity: 500 pcs

Calculation:
Setup Cost = (0.20 × ₹120) / 500 = ₹0.05
Cycle Cost = (0.60 × ₹120) / 1.00 = ₹72.00
Total = ₹72.05

Assumptions:
• Efficiency: 100% (no adjustment)
• No tooling cost for this operation
• Scrap handled at routing level (3%)

[Override Setup Time] [Override Cycle Time] [Override MHR]

Integration with Other Cost Components

graph TD
    Material[Material Cost] --> Routing{Routing Sequence}
    Routing --> Op1[Operation 1]
    Routing --> Op2[Operation 2]
    Routing --> Op3[Operation 3]

    Op1 --> Scrap1[Apply Scrap %]
    Op2 --> Scrap2[Apply Scrap %]
    Op3 --> Scrap3[Apply Scrap %]

    Scrap1 --> Rollup[Total Conversion Cost]
    Scrap2 --> Rollup
    Scrap3 --> Rollup

    Material --> Rollup
    Rollup --> Overhead[Apply Overheads]
    Overhead --> Final[Total Manufacturing Cost]

    style Routing fill:#e3f2fd
    style Rollup fill:#fff3e0

API Example

Query Operation Costs

GET /api/v1/quotes/{quote_id}/operations

Response:
{
  "quote_id": "Q-2026-0042",
  "operations": [
    {
      "operation_number": 1,
      "name": "Cutting",
      "machine_type": "Band Saw",
      "setup_time": 0.30,
      "cycle_time": 0.12,
      "machine_rate": 120.00,
      "setup_cost_per_piece": 0.07,
      "cycle_cost": 14.40,
      "tool_cost": 0.00,
      "total_cost": 14.47,
      "explainability": {
        "setup_calculation": "(0.30 × 120) / 500",
        "cycle_calculation": "(0.12 × 120) / 1.00",
        "source": {
          "setup_time": "Excel cell E10",
          "cycle_time": "Excel cell F10",
          "machine_rate": "Machine Master: Band Saw"
        }
      }
    }
  ],
  "total_operations_cost": 238.45
}