Inventory Management
Inventory Calculations

Inventory Calculations

Configure intelligent inventory deduction rules using the Formula Builder to handle complex product configurations and material requirements.


Overview

TimberCloud's inventory calculation system allows you to define exactly how inventory should be deducted based on product configurations, dimensions, and options. This is essential for businesses that:

  • Sell products by different units than they stock (e.g., sell by sqft, stock by sheet)
  • Need to account for waste/yield in fabrication
  • Have complex material requirements based on customer specifications

The same Formula Builder used for pricing works for inventory calculations — learn it once, use it everywhere.


Using the Formula Builder

The formula builder uses an intuitive approach where you build calculations step by step.

Operand Types

TypeDescriptionExample
FieldReference order valueswidth, height, qty
NumberStatic numeric value144, 1.10, 32
MeasurementPre-built calculationsSquare Feet, Board Feet
GroupParentheses ( )(width + 2) × height
ConditionalIf/Then/Else logicIf width > 48 then 1.15 else 1.10

Operators

SymbolOperation
+Add
Subtract
×Multiply
÷Divide

Available Measurements

Pre-built calculations for common units handle conversions automatically:

MeasurementDescription
Square FeetArea calculation from inches
Board FeetLumber volume calculation
Linear FeetLength conversion from inches
Cubic InchesVolume in cubic inches
Cubic FeetVolume in cubic feet
PerimeterEdge length calculation
Waste FactorApply waste percentage

Input Mapping

When using a measurement, you map which line item fields provide the inputs through the visual interface.


Configuring Formulas

Where to Configure

Inventory formulas are configured on the Product Attribute:

  1. Go to ProductsAttributes
  2. Select your attribute
  3. Find the Inventory Formula section
  4. Click on an inventory field to configure its formula
  5. Build your formula using the visual builder
  6. Save

Common Patterns

Area-Based Calculations

For sheet goods, flooring, fabric, or panel products:

Scenario: Customer orders by square feet, you stock by sheet or unit.

Formula Steps:

  1. Add MeasurementSquare Feet
  2. Map width and height to line item fields
  3. Add Operator× (multiply)
  4. Add Fieldqty

Result: Calculates total square feet ordered.

Linear Calculations

For trim, molding, lumber, or wire products:

Formula Steps:

  1. Add MeasurementLinear Feet
  2. Map length to line item field
  3. Add Operator× (multiply)
  4. Add Fieldqty

Result: Converts length from inches to feet and multiplies by quantity.

Volume Calculations

For concrete, mulch, gravel, or bulk materials:

Formula Steps:

  1. Add MeasurementCubic Feet
  2. Map width, height, depth to line item fields
  3. Add Operator× (multiply)
  4. Add Fieldqty

Result: Calculates total cubic feet ordered.

Board Feet

For lumber inventory and sales:

Formula Steps:

  1. Add MeasurementBoard Feet
  2. Map thickness, width, length to line item fields
  3. Add Operator× (multiply)
  4. Add Fieldqty

Result: Calculates board feet using the lumber industry standard formula.


Adding Waste Factors

Account for material waste in cutting, fabrication, or installation:

Static Multiplier

Add a fixed percentage waste:

  1. Create your base calculation
  2. Add Operator× (multiply)
  3. Add Number1.10 (for 10% waste)

Example: Square Feet × qty × 1.10

Waste Factor Measurement

Use the built-in waste calculation:

  1. Add MeasurementWaste Factor
  2. Map quantity field
  3. Set waste percentage (e.g., 10)

Dynamic Waste with Conditionals

Different waste for different scenarios:

  1. Add your base calculation
  2. Add Operator× (multiply)
  3. Add Conditional:
    • If: width > 48
    • Then: 1.15 (15% waste for large panels)
    • Else: 1.10 (10% waste for standard)

Conditional Logic

Handle different scenarios with If/Then/Else:

Based on Dimensions

If width > 48
  Then: 1.15 (15% waste for large pieces)
  Else: 1.10 (10% waste for standard)

Based on Product Options

Access selected option values using dot notation:

If material.hardness > 5
  Then: 1.20 (20% waste for hard materials)
  Else: 1.10 (10% waste for soft materials)

Comparison Operators

OperatorDescription
>Greater than
<Less than
Greater or equal
Less or equal
=Equals (number)
Not equals
isEquals (text)
containsContains text

Variables Available

Line Item Fields

Direct access to customer-entered values:

  • qty — Quantity ordered
  • width — Item width
  • height — Item height
  • depth — Item depth
  • length — Item length
  • Custom line item fields you've defined

Product Option Values

Access selected attribute values using dot notation:

attribute_name.part_name

Examples:

  • material.thickness — Selected material's thickness value
  • edge_banding.price_per_ft — Edge option's price
  • finish.coverage_sqft — Finish coverage rate

Quick-Start Templates

The builder includes common formula templates:

TemplateUse Case
Quantity OnlySimple products sold by unit
Board Feet × QtyLumber products
Linear Feet × QtyTrim, molding, wire
Square Feet × QtySheet goods, flooring
Field × QtyCustom field deduction

Formula Examples

Plywood Sheets

Deduct sheets based on area (32 sqft per sheet):

Square Feet × qty ÷ 32

Lumber Boards

Calculate board feet for inventory:

Board Feet × qty

Edge Banding (per edge)

Calculate linear footage for edges:

Perimeter × qty ÷ 12

With Dynamic Waste

Panel cutting with size-based waste:

(Square Feet × qty) × (If width > 48 Then 1.15 Else 1.10)

Testing Calculations

Before Going Live

  1. Save your formula
  2. Create a test order with known dimensions
  3. Verify the calculated deduction matches expected
  4. Test edge cases:
    • Minimum values (qty = 1, small dimensions)
    • Maximum values (large orders)
    • Decimal values (10.5, 3.14)
    • Boundary conditions

Debugging Tips

  1. Check field names — Ensure formula references match line item fields exactly
  2. Verify mappings — Confirm measurement inputs map to correct fields
  3. Test simple first — Start with basic formula, add complexity gradually

Troubleshooting

Incorrect Results

  • Verify formula logic step by step
  • Check field mappings in measurements
  • Confirm unit conversions are correct
  • Review operator order — use groups if needed
  • Check for rounding if precise values expected

Formula Not Working

  • Ensure all inputs are mapped — Measurements need all inputs
  • Check for empty fields — Missing values default to 0
  • Verify formula has valid steps — At least one operand needed
  • Test with simple known values first

Best Practices

  1. Start Simple: Begin with basic formulas, add complexity as needed
  2. Use Measurements: Pre-built measurements handle unit conversions correctly
  3. Test Thoroughly: Verify with real order scenarios before going live
  4. Document Logic: Note why specific waste factors or multipliers are used
  5. Group Complex Math: Use parentheses to ensure correct order of operations

Related Topics