A demand forecasting calendar to solve the problems of "overproduction" and "shortage" in make-to-stock production.

This explains the mechanism of the demand forecasting calendar that runs on ERPNext. It automatically calculates the optimal production increase quantity for e-commerce sales, reducing waste and lost sales opportunities.

8 min

Demand forecast calendar for make-to-stock production

Introduction — Common challenges of make-to-stock production

"How many more should we produce for next month's sale?"

Food, cosmetics, consumer goods, parts—all companies that manufacture to make-to-stock face this question.

According to a survey by the Ministry of Economy, Trade and Industry, lost sales and waste due to inventory management errors in the manufacturing industry amount to several percent of sales. Despite this, many workplaces still rely heavily on the experience and intuition of veteran employees when deciding how to increase production.

For companies where e-commerce sales are becoming the main source of revenue, the situation is even more serious. With Rakuten, Amazon, Yahoo!, and Furusato Nozei (hometown tax donation) programs, more than 30 sales events occur annually. Managing all of this mentally is simply impossible.

In this column, we will introduce the functions and technology of the demand forecasting calendar built on ERPNext, specifically for business leaders.


1. What you can do with this feature


🗓️ 1-1. Dashboard for centralized management of business information

The demand forecast calendar is not just a forecasting tool, but a company-wide dashboard that aggregates information essential for business management.

The main components are the following three tabs:

TabContentBusiness Benefits
🔥 Demand EventsMonthly calendar of e-commerce sales and seasonal eventsSee at a glance when and what will happen
🏭 ProductionDaily Production Results vs. PlanInstantly check if production is progressing according to plan
📈 Prediction AccuracyAI prediction accuracy displayed by itemConfirm prediction reliability numerically

In addition, it also features tabs for sales/orders, accounting, and purchasing/inventory, allowing you to get a comprehensive overview of data from each module of ERPNext.

▼ This is a screenshot of the actual demand forecast calendar interface.


🤖 1-2. AI-powered automated demand forecasting

Behind the scenes, Prophet, an open-source time-series prediction AI developed by Meta (formerly Facebook), is running. Three prediction engines are available, which can be used depending on the application.

EngineForecast PeriodMain Applications
Preliminary Notice Forecast8 weeks aheadManufacturing plan development
EC Forecast2 weeks aheadDecision on replenishing inventory
Company-wide forecast3 months aheadManagement decisions and financial planning

Our preliminary forecasts are used for manufacturing planning, our e-commerce forecasts for inventory replenishment, and our company-wide forecasts for management decision-making—each providing forecasts with the optimal level of detail and timeframe.


🛒 1-3. Automatically calculate the impact of e-commerce sales.

🌐 Automatically collect events using web scraping

Users simply register keywords such as "Rakuten Sale" or "Amazon Prime Day," and the system automatically scrapes event information from the internet. This information is then reflected in the ERPNext calendar via an ICS (International Calendar Standard) hub. More than 30 e-commerce sales events per year are imported without manual input.

The system automatically calculates the effective impact of each event captured. The key point is to "avoid uniformly increasing production." Instead, it allocates the impact based on the actual sales channel composition ratio over the past 90 days.

Example: During the Rakuten Super Sale (adjustment rate +30%), if Rakuten accounts for 73% of sales, the effective impact is +21.9%. This can be used as a guideline for actual production increases.

If we uniformly increase production by 30%, we'll end up producing too much for channels other than Rakuten, leading to waste and losses. This system automatically eliminates that risk.

🔁 AI automatically learns the impact of events

The system compares the predicted impact of each event with the actual increase or decrease in sales, and the difference is automatically reflected in the next suggestion. For example, if the previous Rakuten SALE predicted a +25% increase but the actual increase was +30%, the next suggestion will be adjusted towards +30%. The accuracy of the production volume prediction improves autonomously with each iteration.


⏪ 1-4. Lead Time Calculation and Alert Notifications

The system automatically calculates the lead time backward from the event start date and sends incremental alert notifications.

Example: Regarding the start of the sale on March 4th

  • February 20th — Deadline for ordering raw materials (procurement lead time: 7 days)
  • February 27th — Manufacturing start deadline (manufacturing lead time 3 days)
  • March 2nd — Deadline for preparing shipments (shipping lead time: 2 days)

You will receive an alert bell 🔔 three days before each deadline, so in this example, you will be reminded gradually starting 12 days before the event. Lead time settings can be customized to suit your company's specific needs.


🛡️ 1-5. Visualization of prediction accuracy and safety measures

"Are AI predictions really accurate?"

To answer this question, the MAPE (Mean Absolute Percent Error) for each item is calculated in real time and displayed in a list with a signal indicator (🟢 within 20% / 🟡 within 30% / 🔴 needs improvement).

Furthermore, we have also put in place safety measures in case our predictions are wrong.

SolutionContent
Manual OverrideIndividual values ​​can be manually changed. Changes will not be overwritten when the AI ​​is rerun.
Batch Percentage AdjustmentApply a ±N% adjustment to specific items and periods in a single application.
Automatic RetuningParameters are automatically readjusted weekly when accuracy exceeds a threshold.

AI predictions are a tool to assist in decision-making. The final decision is always made by a human. Especially with new products or unprecedented events, the system is designed to prioritize on-site experience.


2. Overview of the Technology


🧠 2-1. Why Prophet is suitable for forecasting production make-to-stock

The reasons why Prophet is suitable for make-to-order manufacturing are clear.

CharacteristicsMeaning in Manufacturing
Automatically recognizes annual and weekly seasonalityAutomatically learns patterns such as "Frequent shipments on Fridays" and "Increased shipments towards the end of the year"
Can incorporate the impact of holidays and eventsJapanese holidays and e-commerce sales can be added as special days
Multiplicative SeasonalityIf sales double, the fluctuation range also doubles—a model that reflects reality
Lightweight operation without GPUNo cloud AI required. Works perfectly well on your own servers.

Although Meta archived the Prophet repository in 2023, it is still functioning without issues. Its successor, NeuralProphet, is API compatible, making future replacements low-cost. The prediction logic of this system is consolidated into a single method, so the impact of library replacement will be limited.


🔄 2-2. Autonomous Improvement Loop

Typically, machine learning models are periodically tuned by data scientists, but in this system, AI automatically measures accuracy and readjusts parameters.

StepProcessing Details
① Accuracy MeasurementCompare predictions and actual results for the past 2-4 weeks to calculate MAPE
② Threshold DeterminationTuning begins when MAPE exceeds 30%
③ Parameter SearchTry up to 48 combinations of key parameters
④ Save optimal values ​​Automatically adopt the most accurate parameter set

In addition, we automatically calculate daily adjustment rates based on past manufacturing performance (for example, reflecting the practice of manufacturing more on Fridays to include Monday's shipments), and apply post-production adjustments.

No data scientists are needed. The system automatically learns and improves continuously.


🔐 2-3. Security — Data does not go outside.

Sales data and customer information are our most important trade secrets. This system is designed to be completely self-contained on our own servers.

  • Sales, order, and forecast data → Stored in the company's ERPNext DB.
  • AI model → Trains and performs inference using our own CPU (no external APIs used)
  • ICS hub → localhost communication only. No external transmission.
  • Access control → Apply ERPNext's role-based access control.

We have zero reliance on cloud AI services.


⚠️ 2-4. The Limitations of AI — I'll be honest

PatternReasonSolution
New ProductNo historical data availableDisplay "Insufficient Data" and skip prediction
SNS BuzzUnpredictable based on past trendsManually adjust by ±N%
Disaster/PandemicExceeds AI detection rangePartial response through automatic adjustment of trend sensitivity parameters
Sudden termination of business with a trading partnerNo zero assumptionsManual override

These limitations can all be addressed through manual overrides.


3. Installation Guide

📋 Prerequisites

ConditionsDetails
ERPNext v15 or laterNo issues if using the ERPNext.JP environment
Past Sales DataSales Invoices for 30 days or more
EC orders must be stored in ERPNextWe can also discuss EC integration.

📅 Startup Schedule

TimeframeMilestones
Week 1–2Custom app implemented. Sales events automatically generated. Calendar operation started.
Week 5–6Data accumulation enables company-wide forecasting
Week 9–12Monitoring on the accuracy dashboard. Initial automatic tuning.
90 days ~Autonomous tuning fully operational. Accuracy is stable.

💰 Cost

No additional server costs or external cloud services are required. It runs on your existing ERPNext server. Daily operations are fully automated, and it can be operated with only a monthly accuracy review (approximately 15 minutes).


4. Summary — Reinforcing "Experience and Intuition" with "Data and AI"

This system does not negate on-the-job experience. It is a mechanism for quantifying experience and accumulating it as organizational knowledge.

Traditional OperationAfter Implementation
Manually manage sale schedulesAutomatically add to calendar
Determining increased production volume based on experienceAutomatically calculating effective impact based on past performance
You realize it at the last minute and panicGradual alerts starting 12 days in advance
Concerns about AI accuracyConstant monitoring on the dashboard
Experts are needed for adjustmentAI self-tunes
Concerns about data leaksCompletely within our own servers

Technology Stack

ElementsTechnology
Foundation ERPERPNext (Python / Frappe Framework)
Prediction EngineProphet (Open Source Time Series AI)
Event AggregationICS Hub (Microservices)
External CloudNot required (Completely handled on our own servers)

If you have questions like, "Can you make predictions with our products?" or "How much data do we need?", please contact us. 30-minute free online consultation Please feel free to ask us anything. You can start using the calendar function in as little as two weeks.

📚

Related articles