You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This document describes the business rules that generate quotes and pricing for the fence configurator system. The system calculates prices based on fence specifications, materials, beams, gates, and accessories.
The beam height is determined by fence height + base height + 60cm (in-ground depth):
Round Beams
Normal beams (48mm): 180, 200, 210, 220, 240, 260, 280cm
Normal beams (60mm) & End beams: 180, 200, 230, 260, 280, 300, 320, 380, 400cm
Square Beams
All square beams: 170, 190, 230, 250, 270, 320cm
Pricing Components
Main BOM (Bill of Materials) Categories
graph LR
A[Total Quote] --> B[Fence Panels/Mesh]
A --> C[Beams & Posts]
A --> D[Gates]
A --> E[Accessories]
B --> B1[Panel Units]
B --> B2[Wire Materials]
C --> C1[Main Posts]
C --> C2[Support Posts]
E --> E1[Caps & Connectors]
E --> E2[Base Components]
E --> E3[Wire Accessories]
Loading
Fence Material Calculation
Material Type
Unit
Calculation Method
3D/Double Bar Mat Panels
pieces
ceiling(segment_width / (max_beam_span + 5))
Chain-link/Hortaplast
25m rolls
segment_width / 100 / 25
Supporting Materials for Chain-link/Hortaplast
Component
Quantity Calculation
Notes
Tension Wire (spandraad)
width × wire_count / 100 / 100 (100m units)
2 wires if height < 180cm, else 3
Binding Wire (binddraad)
width / 100 / 100 (100m units)
-
Wire Tensioners
non_normal_beams × wire_count / 2
-
Tension Bars
non_normal_beams pieces
Length matches fence height
Tension Bar Holders
ceiling(fence_height / 24) × non_normal_beams
-
Top Bar (if enabled)
width / 600 pieces (6m lengths)
Not used with mat panels
Base Components
Component
When Added
Quantity
Concrete Plinth
When base_height > 0
ceiling(width / (max_beam_span + 5)) pieces
Plinth Holders
When beam has base
1 per normal beam, 2 per corner beam
Self-drilling Screws
With plinth holders
2 per holder
Gate Pricing
Gate Types & Specifications
Gate Type
Fill Options
Size Format
Color Rules
Single Gate
Square part, 2D-DS, 3D-M-DS
Width × Height
RAL color based on style
Double Gate
Standard only
Width × Height
RAL color based on style
Gate Color Mapping
IF fill_type = "2D-DS":
IF base_color = "7016": use "7030"
ELSE: use base_color
ELSE:
IF base_color = "7016": use "9005 (BLACK)"
ELSE: use mapped_color
Calculation Flow
Step-by-Step Process
flowchart TD
A[Start: Fence Configuration] --> B[Calculate Segments]
B --> C[Process Each Segment]
C --> D{Segment > Max Span?}
D -->|Yes| E[Split into Multiple Parts]
D -->|No| F[Keep as Single Part]
E --> G[Calculate Materials per Part]
F --> G
G --> H[Calculate Beams]
H --> I[Merge Beams at Same Position]
I --> J[Determine Beam Properties]
J --> K[Add Accessories]
K --> L[Process Gates]
L --> M[Calculate Unit Prices]
M --> N[Generate Final BOM]
N --> O[Calculate Total Quote]
Loading
Beam Merging Rules
When multiple fence segments meet at a point:
Type Priority (highest to lowest):
Gate > Corner > End > Normal
Fill Type Priority (highest to lowest):
3D Mat > Double Bar Mat > Chain-link/Hortaplast
Height Calculation:
Use maximum height from all connecting segments
Price Calculation Formula
For each BOM item:
unit_price = lookup from product catalog
total = ceiling(amount) × unit_price
Total Quote = sum of all item totals
Special Rules & Constraints
Automatic Adjustments
Scenario
Adjustment
Gate height > fence height
Reduce to nearest standard height below fence
Base height incompatible with span
Adjust to maximum allowed base height
Top bar with mat panels
Automatically disabled
Enforcement Options
Setting
Effect
enforceWideIntermediateBeams
Forces all normal beams to 60mm diameter
enforceSupportBeams
Adds support posts (270cm) at non-normal beam positions
Color & Style Options
Available RAL Colors
RAL Code
Name
Usage
9005
Black
Standard option
6005
Green
Standard option
7016
Anthracite Grey
Maps to black for most components
Complete Price Breakdown
Full Component List with Calculations
This section provides a comprehensive overview of EVERY component that contributes to the final price, including all small items like screws, wire, caps, and connectors.