Forecast Management System

Overview

The Forecast Management System provides comprehensive statistical demand forecasting capabilities for inventory planning, production scheduling, and materials requirements planning (MRP). This system implements 12 proven statistical forecasting methods to help predict future demand with accuracy.

The system enables you to:

Quick Start Guide

Step 1: Extract Sales History

Before generating forecasts, you must extract historical sales data into the forecast system's cache:

  1. Navigate to Forecasting → Extract Sales Actuals
  2. Set the From Date to 24 months ago (recommended minimum)
  3. Set the To Date to today
  4. Click "Extract Sales Actuals"
  5. Wait for the extraction to complete

This creates an optimized cache of sales history aggregated by month, which enables fast forecast calculations.

Step 2: Generate Your First Forecast

Option A: Single Item Forecast

  1. Navigate to Forecasting → Generate Forecast
  2. Select "Single Item" radio button (default)
  3. Enter a Stock Item Code (or use the Select button)
  4. Select a Location (optional)
  5. Click "Find Best Fit Method" to automatically select the optimal forecasting method
  6. Review the recommended method and parameters
  7. Click "Generate Forecast"
  8. View the generated forecast data with period-by-period quantities

Option B: Category Forecast (Recommended for Multiple Items)

  1. Navigate to Forecasting → Generate Forecast
  2. Select "Entire Category" radio button
  3. Choose a Stock Category from the dropdown
  4. Click "Find Best Fit Method" to analyze all items and get a recommendation
  5. Review the method recommendation and results
  6. Select the recommended method and click "Generate Forecast"
  7. View the summary (e.g., "47 successful, 3 failed")

Time Savings: Forecasting a category of 50 items takes 2-3 minutes vs 30-60 minutes for individual items (95% time reduction).

Step 3: Review the Forecast

  1. Navigate to Forecasting → Forecast Review
  2. Search for the item(s) you just forecasted
  3. Review the forecast quantities
  4. Make manual revisions if needed
  5. Save changes

Congratulations! You've created your first forecast. For ongoing use, consider processing entire categories at once using the category forecasting feature - it's much faster than processing items individually.

The 12 Forecasting Methods

The system provides 12 statistical forecasting methods, each suited for different demand patterns:

Method 1: Percent Over Last Year

Formula: Forecast = Last Year × (1 + Percentage/100)

Use When: You expect steady, predictable growth or decline

Parameters: Percentage increase (e.g., 5% = 5.0)

Example: If last year's sales were 1,000 units and you expect 10% growth, the forecast will be 1,100 units.

Minimum History: 12 months

Method 2: Calculated Percent Over Last Year

Formula: System automatically calculates the growth percentage from historical trends

Use When: You want the system to determine the growth rate based on past performance

Parameters: None (automatically calculated)

Example: If sales grew from 900 to 1,000 units last year (11.1%), the system will apply 11.1% growth to this year.

Minimum History: 24 months

Method 3: Last Year to This Year

Formula: This Year Forecast = Last Year Actual

Use When: Demand is stable with no growth or seasonal patterns

Parameters: None

Example: If January last year had 100 units, January this year is forecasted at 100 units.

Minimum History: 12 months

Method 4: Moving Average

Formula: Average of the last N periods

Use When: Recent demand is the best predictor of future demand

Parameters: Number of periods to average (typically 3-6)

Example: With 4-period average and recent months of 90, 100, 110, 120, forecast = (90+100+110+120)/4 = 105 units.

Minimum History: 4 months

Method 5: Linear Approximation

Formula: y = mx + b using two historical points

Use When: Clear linear trend exists in demand

Parameters: Uses first and last periods of history

Example: If sales are consistently increasing by 10 units per month, the forecast extends this trend forward.

Minimum History: 6 months

Method 6: Least Squares Regression

Formula: Statistical linear regression (y = mx + b) using all historical data

Use When: You want the most statistically accurate linear trend

Parameters: None (calculated from all history)

Example: Finds the best-fit line through all historical points to project future demand.

Minimum History: 12 months

Method 7: Second Degree Approximation

Formula: Polynomial regression y = a + bx + cx²

Use When: Demand has a curved (accelerating or decelerating) trend

Parameters: None (calculated from history)

Example: Product in rapid growth phase that's starting to level off (S-curve pattern).

Minimum History: 12 months

Method 8: Flexible Method

Formula: Custom weighted formula combining different periods

Use When: You want to apply custom business logic or weighting

Parameters: Custom weights per period

Example: Weight most recent month at 50%, prior month at 30%, and earlier months at 20%.

Minimum History: 12 months

Method 9: Weighted Moving Average

Formula: Moving average with higher weight on recent periods

Use When: Recent demand is more important than older data

Parameters: Number of periods and weighting scheme

Example: 4-period average weighted 40%, 30%, 20%, 10% (most recent to oldest).

Minimum History: 4 months

Method 10: Linear Smoothing (Simple Exponential Smoothing)

Formula: Ft+1 = α × At + (1-α) × Ft

Use When: Demand is relatively stable without strong trends

Parameters: Alpha (α) smoothing constant (0.1 to 0.9)

Example: With α=0.3, the forecast is 30% of last period's actual plus 70% of last period's forecast.

Minimum History: 12 months

Recommended α values:

Method 11: Exponential Smoothing (Holt's Method)

Formula: Double exponential smoothing with level and trend components

Use When: Demand has a clear upward or downward trend

Parameters: Alpha (α) for level, Beta (β) for trend

Example: Sales are growing by 50 units per month. This method captures both the current level and the growth rate.

Minimum History: 12 months

Method 12: Exponential Smoothing with Trend and Seasonality (Holt-Winters)

Formula: Triple exponential smoothing with level, trend, and seasonal components

Use When: Demand has both trend and seasonal patterns (e.g., higher sales in summer)

Parameters: Alpha (α), Beta (β), Gamma (γ), Season Length (e.g., 12 for monthly data)

Example: A product that sells more in December every year, with overall growth trend.

Minimum History: 24 months (2 full seasonal cycles recommended)

Forecast Management Dashboard

Forecast Dashboard

The Forecast Management Dashboard is the central hub for all forecasting functions. Access it via Forecasting → Dashboard (ForecastDashboard.php).

The dashboard displays:

Generating Forecasts

The Forecast Generation screen provides three ways to generate forecasts: single-item, entire category, or batch processing. The single-item and category modes are accessible from a unified interface.

Forecast Generation Screen

Navigate to Forecasting → Generate Forecast (ForecastGeneration.php).

Forecast Generation

Choosing Forecast Scope

At the top of the screen, select your forecast scope:

The form fields change automatically based on your selection.

Single Item Forecast Generation

When to use: For detailed analysis of individual items, testing new methods, or items requiring special attention.

  1. Select "Single Item" radio button (default)
  2. Stock Item: Enter the stock code or click "Select" to choose from a list
  3. Location: Select a specific location or leave blank for all locations
  4. Forecast Method: Choose from the dropdown (1-12) or click "Find Best Fit Method"
  5. Number of Periods: How many future periods to forecast (typically 6-12)
  6. Method Parameters: These fields change based on the selected method:
    • Methods 1-2: Percentage increase
    • Methods 4, 9: Number of periods to average
    • Methods 10-12: Smoothing constants (α, β, γ)
  7. Periods of History: How many past periods to analyze (12-24 recommended)
  8. Click "Generate Forecast"

Result: A detailed table showing forecast quantities period-by-period with calculated metrics.

Using "Find Best Fit Method" for Single Items

The Best Fit Analysis feature tests all 12 methods against your historical data and recommends the method with the highest accuracy (POA). This is the recommended approach for new items where you're unsure which method to use.

  1. Enter the stock item and location
  2. Click "Find Best Fit Method"
  3. The system will:
    • Test all 12 methods against historical actuals
    • Calculate MAD and POA for each method
    • Automatically select the method with highest POA
    • Pre-fill the optimal parameters
  4. Review the recommendation and click "Generate Forecast"

Category Forecast Generation (New!)

When to use: For processing multiple related items at once, monthly forecast updates, initial system setup, or ensuring consistency across a product line.

Benefits:

Generating Category Forecasts

  1. Select "Entire Category" radio button
  2. Stock Category: Choose a category from the dropdown (e.g., "Electronics")
  3. Location: Select a specific location or leave blank for all locations
  4. Forecast Method: Choose from the dropdown (1-12) or use Best Fit
  5. Number of Periods: How many future periods to forecast (typically 6-12)
  6. Method Parameters: Set parameters appropriate for the method
  7. Periods of History: How far back to look (12-24 recommended)
  8. Click "Generate Forecast"

Processing: The system will:

Result: A summary message showing how many items were successfully forecasted and how many failed (e.g., "Category forecast complete: 47 successful, 3 failed"). Navigate to Forecast Inquiry to view detailed results for all items.

Using "Find Best Fit Method" for Categories

This powerful feature analyzes the best forecasting method for each item in the category and recommends the most commonly optimal method.

  1. Select "Entire Category" radio button
  2. Choose a Stock Category from the dropdown
  3. Click "Find Best Fit Method"
  4. The system will:
    • Test all 12 methods for each item in the category
    • Calculate POA (accuracy) for each method per item
    • Identify the best method for each individual item
    • Count method frequency across the category
    • Recommend the most common best-fit method
  5. Review the detailed results table showing:
    • Stock ID and description
    • Best method for each item
    • POA accuracy percentage
    • Most common recommended method for the category
  6. Use the recommended method to generate forecasts for the entire category

Performance Note: Category best-fit analysis is limited to 50 items for web performance. For larger categories, use Batch Generation (see below).

Category Forecasting Examples

Example 1: Monthly Update

Update all forecasts for "Electronics" category (75 items):

Example 2: Initial System Setup

Company has 500 items across 10 categories:

Example 3: Method Selection

New "Office Supplies" category (40 items), unsure which method to use:

  1. Run category best-fit analysis
  2. Review results: "Method 6 is best for 28 items, Method 4 for 8 items, Method 10 for 4 items"
  3. Most common recommendation: Method 6
  4. Generate category forecast using Method 6
  5. Result: Data-driven decision with 70% of items using their optimal method

Batch Forecast Generation (Alternative for Large Categories)

Navigate to Forecasting → Batch Generation (ForecastBatchGeneration.php).

For very large categories (100+ items) or command-line processing, use the dedicated batch generation screen:

  1. Select a Stock Category
  2. Select a Location (or all locations)
  3. Choose a Forecast Method
  4. Set Number of Periods to forecast
  5. Click "Generate Batch Forecasts"
  6. The system processes all items in the category and displays progress

Note: If forecast constants are configured for specific items, the system will use those item-specific parameters instead of the default method settings.

Which Generation Method to Use?

Situation Recommended Method Reason
Single item analysis Single Item mode Detailed results and full control
Testing new methods Single Item mode See period-by-period details
Small category (1-50 items) Category mode Fast, convenient, single screen
Medium category (50-100 items) Category mode or Batch Either works well
Large category (100+ items) Batch Generation Better performance, progress tracking
Unknown best method Category Best Fit Data-driven recommendation
Initial system setup Category mode (per category) Process categories one at a time
Monthly regeneration Category mode Quick updates per category
Automated scheduling Batch Generation (cron) Command-line compatible

Reviewing and Revising Forecasts

Forecast Review Screen

Navigate to Forecasting → Forecast Review (ForecastReview.php).

Forecast Review

This screen allows you to:

Making Manual Revisions

  1. Search for and select a forecast
  2. In the detail grid, enter revised quantities in the "Revised Qty" column
  3. Click "Save Revisions"
  4. The system will use revised quantities instead of calculated forecasts in all reports and integrations

Understanding Variance Colors

The variance column is color-coded to help identify forecast accuracy:

Summary Forecasts

Summary forecasts aggregate individual item forecasts into higher-level groupings for executive reporting and planning.

Creating a Summary Forecast

Navigate to Forecasting → Summary Forecasts (ForecastSummary.php).

  1. Click "Add New Summary"
  2. Enter a Summary Code (e.g., "ELEC-Q1")
  3. Enter a Description (e.g., "Electronics Q1 Forecast")
  4. Select aggregation criteria:
    • Category: Aggregate all items in a category
    • Customer Type: Aggregate by customer segment
    • Area: Aggregate by geographical area
    • Sales Person: Aggregate by salesperson
  5. Set the Start Date and Number of Periods
  6. Click "Generate Summary"

The system will automatically sum all detail forecasts matching your criteria into period-by-period summary totals.

Reviewing Summary Forecasts

Click the "Review" link next to any summary forecast to view and edit the period details (ForecastSummaryReview.php).

The summary review screen shows:

Forecast Accuracy Tracking

Accuracy Report

Navigate to Forecasting → Accuracy Report (ForecastAccuracy.php).

This report helps you monitor how well your forecasts are performing by comparing them against actual sales.

Understanding Accuracy Metrics

MAD (Mean Absolute Deviation)

POA (Percent of Accuracy)

RMSE (Root Mean Squared Error)

What to Do When Accuracy is Low

  1. Try a different forecasting method (use Method Comparison tool)
  2. Adjust smoothing constants in Forecast Constants
  3. Check for outliers in historical sales data
  4. Consider if demand pattern has changed (seasonal, promotional events)
  5. Make manual revisions for critical periods
  6. Ensure sufficient historical data exists (minimum 12-24 months)

Method Comparison Tool

Navigate to Forecasting → Method Comparison (ForecastComparison.php).

This unique tool allows you to visually compare multiple forecasting methods side-by-side for the same item:

  1. Enter a stock item code
  2. Select multiple methods to compare (use checkboxes)
  3. Click "Compare Methods"
  4. View the results in a comparative table showing:
    • Each period's forecast by each method
    • Highest and lowest forecasts highlighted
    • Total forecast per method
    • Average per period
    • Standard deviation across methods

Use this tool to understand the range of possible outcomes and select the most appropriate method for your business needs.

Configuring Forecast Constants

Navigate to Forecasting → Forecast Constants (ForecastConstants.php).

Forecast constants allow you to configure item-specific parameters that override default settings:

Smoothing Constants

Other Parameters

Querying Forecasts

Navigate to Forecasting → Forecast Inquiry (ForecastInquiry.php).

Use this screen to query and view forecasts across multiple items and time periods:

Extracting Sales History

Navigate to Forecasting → Extract Sales Actuals (ForecastExtractActuals.php).

Why Extract Sales History?

The forecast system uses a cached, aggregated view of sales history for optimal performance. The extraction process:

How Often to Extract

Extraction Process

  1. Select From Date (e.g., 24 months ago)
  2. Select To Date (e.g., today)
  3. Click "Extract Sales Actuals"
  4. Wait for completion
  5. Review statistics displayed (records processed, date range)

Performance Tip: Schedule extraction during off-hours using a cron job for automated processing.

Integration with Other Systems

MRP Integration

Forecasts can be used as independent demand in the Material Requirements Planning (MRP) system:

// Example: Create MRP demands from active forecasts
$sql = "SELECT fh.stockid, fd.perioddate,
               COALESCE(fd.revisedqty, fd.forecastqty) as quantity
        FROM forecastheader fh
        INNER JOIN forecastdetails fd ON fh.forecastid = fd.forecastid
        WHERE fh.active = 1
          AND fd.perioddate >= CURDATE()
          AND fd.perioddate <= DATE_ADD(CURDATE(), INTERVAL 6 MONTH)";

$result = DB_query($sql);

while ($row = DB_fetch_array($result)) {
    // Create MRP demand
    $insertSQL = "INSERT INTO mrpdemands
                  (stockid, mrpdemandtype, quantity, duedate)
                  VALUES (
                  '" . $row['stockid'] . "',
                  'FCT',
                  " . $row['quantity'] . ",
                  '" . $row['perioddate'] . "'
                  )";
    DB_query($insertSQL);
}

Reorder Level Calculation

Use forecasts to automatically calculate reorder points:

// Reorder Level = Forecast + Safety Stock
$forecast = getNextPeriodForecast($stockid, $location);
$safetyStock = getSafetyStockFromConstants($stockid, $location);
$reorderLevel = $forecast + $safetyStock;

Purchase Planning

Calculate net requirements for purchasing:

// Net Requirement = Forecast - On Hand - On Order
$forecast = getForecastTotal($stockid, $startdate, $enddate);
$onHand = getCurrentStock($stockid, $location);
$onOrder = getPurchaseOrderQty($stockid);
$netRequirement = max(0, $forecast - $onHand - $onOrder);

Best Practices

Getting Started

  1. Start with a pilot: Choose one product category to test the system
  2. Extract sufficient history: Minimum 12 months, 24-36 months recommended
  3. Use category forecasting: Process entire categories instead of individual items (saves 95%+ time)
  4. Use Best Fit: Let the system recommend methods initially (works for both items and categories)
  5. Review regularly: Check accuracy monthly and adjust as needed

Ongoing Operations

Category vs. Single Item Forecasting

Method Selection Guidelines

Demand Pattern Recommended Method Alternative Method
Stable, no trend Method 3 (Last Year to This Year) Method 10 (Linear Smoothing)
Growing steadily Method 6 (Least Squares Regression) Method 11 (Exponential Smoothing)
Declining Method 6 (Least Squares Regression) Method 11 (Exponential Smoothing)
Seasonal pattern Method 12 (Holt-Winters) Method 1 with seasonal %
Erratic/volatile Method 9 (Weighted Moving Average) Method 4 (Moving Average)
New product Method 1 (Percent Over LY) Similar item + adjustment
Unknown pattern Use "Find Best Fit" Method 4 (safe default)

Critical Items

For high-value or strategic items:

Troubleshooting

Problem: No forecast generated

Solutions:

Problem: Forecast accuracy is low (POA < 60%)

Solutions:

Problem: Batch generation is slow

Solutions:

Problem: Forecast is all zeros

Solutions:

Advanced Topics

Seasonal Forecasting (Method 12)

For products with seasonal patterns:

Promotional Events

For forecasting during promotional periods:

New Product Introduction

For items without sales history:

Automating Forecast Generation

Set up automated forecast generation using cron jobs:

# Extract sales history monthly (1st of month at 2 AM)
0 2 1 * * php /path/to/webERP/ForecastExtractActuals.php extract

# Generate forecasts weekly (Sunday at 3 AM)
0 3 * * 0 php /path/to/webERP/batch_forecast.php

# Email accuracy report monthly (5th of month at 8 AM)
0 8 5 * * php /path/to/webERP/email_forecast_accuracy.php

Database Table Reference

forecastheader

Master table containing one record per forecast. Links to stockmaster and locations.

forecastdetails

Period-by-period forecast data. Multiple records per forecast (one per period). Stores forecast quantity, actual quantity, revised quantity, and metrics.

forecastsummary

Summary forecast definitions. Specifies aggregation criteria (category, customer type, area, salesperson).

forecastsummarydetails

Period-by-period summary data. Stores both quantity and value forecasts.

forecastconstants

Item-specific parameters. One record per stock item/location combination. Stores smoothing constants and safety stock settings.

forecastsaleshistory

Cached sales history for fast calculations. Pre-aggregated by month with dimensions for summary forecasting.

forecastmethods

Lookup table of the 12 forecasting methods with descriptions and requirements.

forecastmetrics

Calculated accuracy metrics (MAD, POA, RMSE, MSE) stored per forecast and period.

forecastprices

Historical and projected pricing for value-based forecasting.

forecastinclusionrules

Rules defining which transaction types to include in forecasts.

forecastsimulation

What-if scenarios for testing forecast adjustments before committing.

Frequently Asked Questions

Q: How much historical data do I need?

A: Minimum 6 months for basic methods (4, 9), 12 months recommended for most methods, and 24 months for seasonal methods (12). More history generally produces better forecasts.

Q: Can I forecast new products with no sales history?

A: Yes, use Method 1 (Percent Over Last Year) with estimates based on similar products, or manually enter forecast quantities.

Q: What's the difference between detail and summary forecasts?

A: Detail forecasts are item-specific. Summary forecasts aggregate multiple items for higher-level planning (e.g., total sales for electronics category).

Q: Should I forecast by location or for all locations combined?

A: If demand patterns differ by location, forecast separately. If locations have similar patterns, combined forecasting may be simpler.

Q: When should I use manual revisions?

A: Use manual revisions when you have knowledge of future events that aren't reflected in historical data (promotions, market changes, new customers, etc.).

Q: Can I use multiple methods for the same item?

A: Yes, you can generate forecasts with different methods and compare them. However, only one forecast per item/location can be marked as "active" for MRP integration.

Q: How do I know which method to use?

A: Use the "Find Best Fit Method" feature in Forecast Generation, or use the Method Comparison tool to compare multiple methods visually.

Q: What if my forecast accuracy is low?

A: Try different methods, adjust smoothing constants, check for data quality issues, ensure sufficient historical data, and consider manual adjustments for known future events.

Glossary of Terms

Detail Forecast
Item-level forecast for a specific product and location
Summary Forecast
Aggregated forecast combining multiple items by category, customer type, area, or salesperson
MAD (Mean Absolute Deviation)
Average magnitude of forecast errors, regardless of direction
POA (Percent of Accuracy)
Percentage accuracy measure (0-100%), with higher being better
Alpha (α)
Smoothing constant controlling responsiveness to recent changes (0.1-0.9)
Beta (β)
Smoothing constant for trend component in exponential smoothing
Gamma (γ)
Smoothing constant for seasonal component in Holt-Winters method
Seasonality
Repeating patterns in demand over time (e.g., higher sales in December)
Outlier
Data point significantly different from other observations, potentially skewing forecasts
Best Fit
Automated analysis to determine which forecasting method performs most accurately for an item

Screen Reference

Screen File Purpose
Forecast Dashboard ForecastDashboard.php Central hub with navigation and statistics
Generate Forecast ForecastGeneration.php Create forecasts for individual items or entire categories
Forecast Review ForecastReview.php Review and revise detail forecasts
Method Comparison ForecastComparison.php Compare multiple methods side-by-side
Summary Forecasts ForecastSummary.php Create and manage summary forecasts
Summary Review ForecastSummaryReview.php Review and edit summary details
Extract Actuals ForecastExtractActuals.php Import sales history into cache
Accuracy Report ForecastAccuracy.php Monitor forecast accuracy metrics
Forecast Inquiry ForecastInquiry.php Query and view forecasts
Forecast Constants ForecastConstants.php Configure item-specific parameters
Batch Generation ForecastBatchGeneration.php Generate forecasts for categories

Integrating Forecasts with MRP

The Forecast Management System directly integrates with webERP's Material Requirements Planning (MRP) system, allowing forecasted demand to drive production planning and purchasing decisions. This creates a complete demand-driven planning cycle from historical sales through statistical forecasting to materials requirements.

Complete Workflow: Forecast to MRP

The integration follows a five-step workflow:

Step 1: Extract Sales History → Forecast Sales History Table

File: ForecastExtractActuals.php

Purpose: Pull historical sales data from sales orders into the forecast system's optimized cache.

Process:

How to Use:

  1. Navigate to Forecasting → Extract Sales Actuals
  2. Select date range (e.g., last 12-24 months)
  3. Click "Extract"
  4. Wait for completion

Step 2: Generate Forecasts → Forecast Header and Details Tables

File: ForecastGeneration.php

Purpose: Create statistical forecasts based on historical sales patterns.

Process:

How to Use:

  1. Navigate to Forecasting → Generate Forecast
  2. Select stock item or entire category
  3. Choose location (optional)
  4. Select forecast method or use "Find Best Fit"
  5. Set number of periods to forecast (e.g., 3 months)
  6. Click "Generate Forecast"

Step 3: Review and Adjust Forecasts → Update Revised Quantities

File: ForecastReview.php

Purpose: Review generated forecasts and make manual adjustments based on business knowledge.

Process:

How to Use:

  1. Navigate to Forecasting → Forecast Review
  2. Search for forecasts to review
  3. View period-by-period forecast quantities
  4. Enter adjusted quantities in "Revised Qty" column (e.g., for known promotions)
  5. Add notes to document adjustments
  6. Click "Save Changes"

Step 4: Convert Forecasts to MRP Demands → MRP Demands Table (NEW)

File: ForecastToMRP.php

Purpose: Convert active forecasts into MRP demand records that drive material requirements planning.

Process:

How to Use:

  1. Navigate to MRP → Forecast to MRP Demands
  2. Set From Date and To Date (e.g., next 3 months)
  3. Select MRP Demand Type (create "FORECAST" type if needed)
  4. Select Location (or "All Locations")
  5. Select Stock Categories to include
  6. Check "Replace Existing" to clear old forecast demands first
  7. Click "Generate MRP Demands"
  8. Review confirmation: "X MRP Demands created"

Example: If you have a forecast showing 45 units in April, 48 in May, and 75 in June (revised), the system creates three MRP demand records with these quantities and dates.

Step 5: Run MRP → Planned Purchase and Work Orders

File: MRP.php

Purpose: Calculate material requirements based on all demands including forecasts.

Process:

How to Use:

  1. Navigate to MRP → Run MRP
  2. Select location
  3. Select manufacturing calendar
  4. Set planning horizon
  5. Click "Run MRP"
  6. MRP calculates requirements based on all demands (sales orders + forecasts)
  7. Review planned orders under MRP → Planned Purchase Orders
  8. Review planned work orders under MRP → Planned Work Orders

Complete Example Scenario

Scenario: Forecast and plan for electronic components for the next 3 months

Step Action Result
1. Extract History ForecastExtractActuals.php
From: 2025-03-01
To: 2026-03-01
5,974 historical sales records loaded into forecastsaleshistory
2. Generate Forecast ForecastGeneration.php
Item: ELEC-0001
Location: MAIN
Method: Exponential Smoothing
Periods: 3
Forecast created:
• April 2026: 45 units
• May 2026: 48 units
• June 2026: 50 units
3. Review & Adjust ForecastReview.php
June revised to 75 units
(Known promotion)
Revised forecast:
• April: 45 units
• May: 48 units
• June: 75 units (revised)
4. Convert to MRP ForecastToMRP.php
From: 2026-04-01
To: 2026-06-30
Type: FORECAST
3 MRP demand records created:
• 2026-04-30: 45 units
• 2026-05-31: 48 units
• 2026-06-30: 75 units
5. Run MRP MRP.php
Planning horizon: 3 months
MRP calculates requirements:
• Total demand: 168 units
• Current stock: 20 units
• Net requirement: 148 units
• Planned purchase orders generated

Key Integration Features

Priority System: Revised Over Calculated

The system uses a priority hierarchy for forecast quantities:

COALESCE(forecastdetails.revisedqty, forecastdetails.forecastqty)

This means:

Multiple Demand Sources

The MRP system combines demands from multiple sources:

Demand Source MRP Demand Type Description
Sales Orders SO Actual customer orders (firm demands)
Forecasts FC Statistical predictions (planned demands)
Work Orders WO Production requirements for assemblies
Manual MAN Manually entered demands

Incremental vs. Replace Modes

Replace Mode (Recommended for weekly/monthly updates):

Incremental Mode (For adding new forecasts):

Best Practices for Forecast-to-MRP Integration

1. Regular Update Schedule

Activity Recommended Frequency Timing
Extract Actuals Monthly After closing each period
Regenerate Forecasts Monthly Same day as actuals extraction
Review & Adjust Weekly Before converting to MRP
Convert to MRP Weekly Before running MRP
Run MRP Weekly or Daily After converting forecasts

2. Review Process

Always review forecasts before converting to MRP demands:

3. Accuracy Monitoring

Track forecast performance over time:

4. Planning Horizon

Set appropriate forecast and MRP horizons:

Configuration and Setup

Create MRP Demand Type for Forecasts

Before first use, create a demand type for forecasts:

  1. Navigate to MRP → MRP Demand Types
  2. Click "Add New"
  3. Enter code: FC
  4. Enter description: Forecast Demand
  5. Click "Save"

Or using SQL:

INSERT INTO mrpdemandtypes (mrpdemandtype, description)
VALUES ('FC', 'Forecast Demand');

Recommended Demand Type Setup

Code Description Priority
SO Sales Order 1 (Highest - firm demand)
FC Forecast 2 (Planned demand)
WO Work Order 3 (Production requirement)
MAN Manual 4 (As needed)

Troubleshooting

No MRP Demands Created

Possible causes and solutions:

Duplicate Demands

Solution:

Forecasts Don't Update in MRP

Solution:

Database Table Flow

salesorders + salesorderdetails
           ↓
    forecastsaleshistory (via ForecastExtractActuals.php)
           ↓
forecastheader + forecastdetails (via ForecastGeneration.php)
           ↓
      mrpdemands (via ForecastToMRP.php) ← NEW
           ↓
   MRP planned orders (via MRP.php)

Integration Summary

The Forecast-to-MRP integration provides:

This creates a complete closed-loop system from historical sales analysis through statistical forecasting to production planning and material requirements.

Getting Help

For additional support and resources:

Back to top