Monday, 8:30 am. The planning manager of a garment manufacturer in the Vale do Ave region, with 120 employees, opens three spreadsheets. Two and a half hours later, she has a view of stock that is already 48 hours out of date. This is not a technology problem — it is a data architecture problem. And this is exactly where most AI projects for automatic replenishment fail: they arrive before the house is in order.
The thesis vendors avoid stating
Automatic replenishment without stockouts is not an algorithm problem. It is a problem of clean data and integration between systems. Any Predictive Analytics model applied to stock will fail if the ERP has duplicate items, if the MES does not communicate consumption in real time, or if warehouse receipts are recorded two days late.
A replenishment model trained on dirty data will automate stockouts, not prevent them.
According to INE (2025), only 9.4% of small Portuguese companies with 10 to 49 employees use AI — compared with 49.1% of large ones. The difference is not one of budget. It is one of data maturity and systems integration. An industrial SME that wants to jump straight to automatic replenishment without first resolving the quality of its ERP is building on sand.
What changed to make this relevant now
The cost of stockouts changed scale
For decades, a stockout was an acceptable cost. The customer waited, the sales rep called, the warehouse improvised. Today, international buyers — Inditex, Decathlon, Mango — have delivery-failure penalty clauses that turn a stockout into a financial event, not merely an operational one. In the footwear sector, where a collection of 800 to 1,200 SKUs with three axes of variation — colour, size, last — has delivery windows of weeks, a component stockout on an assembly line in Felgueiras can jeopardise an order of several thousand pairs. The sales rep no longer improvises: they pay.
Forecasting models left the labs
Until five years ago, implementing demand forecasting with machine learning required a team of data scientists and dedicated infrastructure. Today, the leading industrial ERPs expose APIs that allow pre-trained models or cloud forecasting services to be connected without rewriting the core of the system. What used to be an 18-month project is now an 8 to 12-week integration — provided the data is clean. The condition is always the same.
Regulation built the dataset without anyone asking
The requirement for monthly SAF-T reporting (Portaria 195/2020) and software certification by the AT (DL 28/2019) forced companies to keep structured digital records of stock movements. This history — which previously existed only on paper or in spreadsheets — is now the training dataset for any forecasting model. Those who complied with the regulation have, without knowing it, built their data asset. It is one of the few cases in which tax bureaucracy generated real operational value.
The four real technical approaches
There is no single way to connect AI to stock replenishment. There are four architectures with very different cost, complexity and suitability profiles. The wrong choice — typically choosing the most sophisticated one because the vendor presented it first — is the most common cause of projects that stall after the pilot phase.
The simplest approach is the ERP's native module: reorder point, dynamic safety stock, MRP with variable horizon. It is not AI in the strict sense, but it resolves 70% of cases in SMEs with relatively stable demand. The MULTI ERP covers this level of planning for the textile, footwear and metal industries. The usual mistake is to underestimate it because it does not have the word "AI" in the proposal.
The forecasting layer via API is the approach with the best cost/benefit ratio for companies between 50 and 300 employees with a history of two or more years. A forecasting service consumes the ERP's sales and movements history, generates forecasts by item/location/period and returns ordering suggestions that the ERP converts into purchase orders. The integration typically uses Webhooks or REST connectors. The risk lies in the quality of the connection: if the connector fails silently, the model keeps recommending with data from three weeks ago.
For more complex operations — multiple factories, multiple warehouses, extensive subcontracting chains — platforms such as QAD Adaptive ERP integrate machine learning capabilities directly into the planning engine, with low-code configuration. The implementation cost is higher, but model maintenance is done within the ERP itself, without dependence on external systems. The advantage is not the algorithm — it is governance: everything is in one place.
The fourth architecture is the most demanding and the most powerful: MES connected to the ERP with AI fed by shop-floor data in real time. For industries with component consumption by production order — knitted textiles, plastic injection, metalworking — the integration of KORA Productivity with the ERP allows the model to be fed with real consumption, not just warehouse withdrawals. The difference is critical: the warehouse may show stock available while the shop floor has already consumed that material in orders not yet closed. This is the scenario that destroys models that only read the ERP.
| Approach | Technical complexity | Relative cost | Implementation time | Suitability |
|---|---|---|---|---|
| Native ERP module (MRP/reorder point) | Low | € | 4–8 weeks | SME with stable demand, 1 warehouse |
| Forecasting layer via API | Medium | €€ | 8–14 weeks | SME/mid-size company, history ≥2 years |
| ERP with native AI (low-code) | High | €€€ | 16–28 weeks | Multi-site operations, complex chains |
| MES + ERP + shop-floor AI | High | €€€ | 20–36 weeks | Industry with real-time consumption |
The trade-offs the proposal does not show
The cost nobody budgets at the first meeting
The licence or subscription cost is the visible part. What gets left out is the cost of data cleansing: duplicate items, inconsistent units of measure, suppliers with no recorded lead time, stock movements with no associated cause. In companies with ERPs more than eight years old and without systematic data hygiene, this work represents 30 to 40% of the total project effort. It is not an estimate — it is the pattern we see repeated. Budget for it before signing any proposal.
The minimum history the model needs — and what to do when it does not exist
Forecasting models need enough history to learn seasonality, campaign peaks and promotional effects. For most Portuguese industrial sectors, 24 months of clean history is the operational minimum. With less than that, the model will recommend excessive safety stock — better than stockouts, but not the objective. If the available history is shorter, the correct decision is to first implement dynamic safety stock parameterised in the ERP and accumulate history for six to twelve months before moving to forecasting.
The problem of variation axes that general-purpose ERPs do not model
In footwear, an item is not a reference — it is a combination of model × colour × size × last. A collection of 200 models can generate 8,000 active SKUs. General-purpose forecasting models treat each SKU as independent and produce forecasts with enormous variance in low-turnover references. The best ones handle the hierarchy: they forecast at the model level and disaggregate by variant based on historical distribution curves. Before evaluating any solution for the footwear sector or for clothing with extensive collections, check that it supports this hierarchy. If it does not, the model will systematically miss on the least-sold variants — which are frequently the ones that cause line stockouts.
The risk nobody mentions: blind trust in the model
When replenishment is automatic, the buyer stops reviewing the suggestions individually. That is the objective — but it is also the risk. An event not forecast in the history — a port strike, a global raw-material shortage, a collection change brought forward by the customer — can generate wrong purchase orders in volume before anyone notices. The safeguard is not technical: it is a manual approval threshold for orders above a defined value or quantity. Without this threshold, automation turns a forecasting error into a cash-flow problem.
What works in Portuguese industrial practice
Start with dynamic safety stock, not with forecasting
Most Portuguese industrial companies have safety stock set manually, by the intuition of the purchasing manager, and never reviewed since it was parameterised. Before implementing any AI model, calculate the correct safety stock based on the supplier's real lead time and the historical variability of demand. This step — which the ERP already supports with appropriate parameterisation — reduces stockouts significantly with no additional investment. It is the step that AI vendors never suggest because it generates no revenue for them.
Feed the model with confirmed orders, not just history
At a distribution company in the Lousada/Paços de Ferreira corridor, the forecasting model based on warehouse withdrawal history systematically underestimates demand peaks because it does not see confirmed customer orders that have not yet been shipped. The history says 400 units went out last week. The order book says 900 will go out this week. The model does not know. The solution is to feed it not only with history, but also with the open order book — data the ERP has, but which many forecasting integrations do not consume through omission of configuration. The KORA Inventory Suite exposes this data in real time to external analysis layers.
Segment before automating
Automating the replenishment of all items at the same time is the most common mistake. A items — high value, high turnover — deserve human review even with automatic suggestion. C items — low value, low turnover — can be fully automated with minimal risk. B items sit in between: automatic suggestion with simplified approval. This segmentation reduces the volume of human decisions required by 60 to 70% without eliminating control where it matters.
Automating the C items frees the buyer to think about the A items. That is the real productivity gain.
Decision matrix: which approach is right for your context
| Criterion | Native ERP module | Forecasting via API | Native AI ERP | MES + ERP + AI |
|---|---|---|---|---|
| No. of active SKUs | <2,000 | 2,000–15,000 | >10,000 | Any (with variants) |
| Clean data history | 6–12 months | ≥24 months | ≥24 months | ≥18 months + MES data |
| No. of warehouses/locations | 1–2 | 1–5 | ≥3 | ≥2 (factory + warehouse) |
| Marked seasonality | Low | Medium–High | High | High |
| Internal IT team | Not required | 1 technical resource | 1–2 resources | 2+ resources |
| Integration with production | No | Optional | Partial | Mandatory |
How to measure success post-implementation
The indicators that matter — and the ones that mislead
The stockout rate is the obvious indicator. But there are three metrics that most companies do not measure and that reveal whether the model is really working. The first is forecast accuracy by item family: does the model get the A items right more than the C items? If not, the problem is data, not algorithm. The second is stock turnover by category: automatic replenishment can eliminate stockouts by increasing stock — if turnover falls, the financial cost of stock has risen and the gain was illusory. The third is the manual approval rate of suggestions: if the buyer rejects more than 20% of the automatic suggestions, the model is not calibrated for the company's real context and is generating work rather than eliminating it.
There is also a fourth metric that almost no one monitors: the deviation between the lead time recorded in the ERP and the supplier's actual lead time. The difference between the two is frequently the main cause of stockouts. The model forecasts demand correctly, but the supplier delivers later than the system assumes — and the ERP was never updated because no one has time for that at the end of the month.
The dashboard that Qlik Sense should show
Do not build a generic stock dashboard with level traffic lights. Build a deviations dashboard: items where the forecast missed by more than 20%, suppliers with actual lead time longer than recorded, references with stock below the reorder point for more than 48 hours. The objective is to make visible what the model cannot resolve on its own — so that human intervention is surgical, not systematic. A dashboard that shows everything helps no one to decide.
What the AI Act changes in this context
Regulation (EU) 2024/1689 — the AI Act — has been in force since August 2024, with the prohibitions applicable since February 2025. Automatic stock replenishment systems that make decisions with significant financial impact without human intervention may fall into risk categories that require technical documentation and logging of decision records. It is not a threat to the operation — it is a discipline that good practice already required. Document the model, the training data, the manual approval thresholds and the periodic review procedures. Those who already do so out of operational rigour are compliant with no additional effort. For the broader context of this obligation, read AI governance in industrial SMEs: what to document before the AI Act.
The AI Act does not prohibit automatic replenishment. It requires that you can explain why the model decided to order 500 units on a Friday afternoon.
Operational implementation sequence
- Audit the quality of the ERP data — duplicate items, inconsistent units of measure, missing lead times, stock movements with no recorded cause. This step reveals the real effort of the project before signing any contract.
- Define the automation scope — segment the items into A/B/C and decide which will be automated in the first phase. Start with the C items: minimal risk, maximum learning.
- Validate the available history — confirm that you have at least 24 months of clean movements. If not, first implement dynamic safety stock and accumulate history for six to twelve months.
- Integrate future demand data — confirmed orders, sales forecasts, campaign calendar. The forecasting model should see the known future, not just the past.
- Configure manual approval thresholds — define values and quantities above which any automatic suggestion requires human approval before generating a purchase order.
- Monitor deviations weekly during the first three months — recalibrate the model based on actual forecasting errors. No model is calibrated in week one. Vendors who say otherwise have never implemented anything in a working factory.
To go deeper
Automatic replenishment is just one of the applications of AI on the industrial ERP. The article Industrial process automation: where AI starts to pay off maps the areas with the fastest return. For the demand forecasting layer that feeds replenishment, read AI applied to demand forecasting: from the ERP to the automatic purchase order. And if your ERP does not yet communicate correctly with SAF-T, first resolve the problem described in SAF-T in industrial production: extraction errors the ERP does not warn you about — because the same data that feeds SAF-T is what the forecasting model will consume.
The question that remains: does your company have data clean enough for an AI model to be better than the experienced buyer who has already been there for twelve years? If the answer is uncertain, start with the data audit — not with the algorithm. The algorithm is the easy part.
Sources
- INE — Survey on the Use of Information and Communication Technologies in Enterprises, 2025. Available at: ine.pt
- Eurostat — ICT usage in enterprises: Artificial Intelligence, 2025. Available at: ec.europa.eu/eurostat
- European Commission — Regulation (EU) 2024/1689 of the European Parliament and of the Council (AI Act), published in the Official Journal of the EU in August 2024. Available at: eur-lex.europa.eu
- Portaria no. 195/2020, of 13 August — monthly reporting of the SAF-T (PT) file to the Tax and Customs Authority. Available at: dre.pt
- Decree-Law no. 28/2019, of 15 February — electronic invoicing requirements and software certification by the AT. Available at: dre.pt
Frequently asked questions
What causes the failure of most AI automatic replenishment projects?
Most fail because they implement AI without first resolving data quality and integration between systems. A model trained on dirty data — duplicate items in the ERP, consumption not communicated in real time, or delayed records — automates stockouts instead of preventing them. The problem is not the algorithm, it is the data architecture.
What is the difference between small and large companies in AI adoption?
According to INE (2025), only 9.4% of small companies with 10 to 49 employees use AI, compared with 49.1% of large ones. The difference is not budgetary, but one of data maturity and systems integration. An SME that jumps straight to automatic replenishment without resolving ERP quality is building on sand.
Why has a stockout become a critical financial problem?
International buyers — Inditex, Decathlon, Mango — include delivery-failure penalty clauses in their contracts. In footwear, a component stockout on an assembly line can jeopardise orders of thousands of pairs. The stockout has gone from being an operational nuisance to being a serious financial event.
What was the impact of SAF-T regulation and software certification on AI?
The requirement for monthly SAF-T reporting and certification by the AT forced companies to keep structured digital records of stock movements. This history became the training dataset for forecasting models. Those who complied with the regulation built, without knowing it, a valuable data asset for AI.
What is the most suitable approach for an SME with 80 employees?
For companies between 50 and 300 employees with a history of two or more years, the forecasting layer via API offers the best cost/benefit ratio. A service consumes the ERP's history, generates forecasts by item and returns ordering suggestions. Implementation takes 8 to 14 weeks.
What is the difference between an ERP with native AI and forecasting via API?
Forecasting via API connects an external service to the ERP through REST connectors. Native AI (low-code) integrates machine learning capabilities directly into the planning engine. The advantage of native AI is governance: everything is in a single system, without dependence on external platforms.
Why is connecting the MES to the ERP with AI critical for processing industries?
The MES provides real shop-floor consumption data in real time. The warehouse may show stock available while production has already consumed that material in unclosed orders. Models that read only the ERP fail because they do not see this real consumption, destroying the accuracy of automatic replenishment.
