If you manufacture, pack, distribute or store food in Spain, traceability is not optional: it has been a legal obligation since 2005 and is the axis around which your entire operation revolves. Yet many companies in the sector still manage batches in spreadsheets or with generic modules of a horizontal ERP that understands neither the best-before date nor the difference between a supplier batch number and your own. The result is manual tracing that consumes hours, product recalls that arrive too late, and customer audits that put access to major retail chains at risk. A sector-specific agri-food ERP solves these problems from the receipt of raw materials to the dispatch of finished goods, with full forward and backward traceability at any time.
What the law requires regarding food traceability
The central regulatory framework is Regulation (EC) No 178/2002, which lays down the general principles of European Union food law. Its Article 18 requires all operators to have systems and procedures in place that allow identification of any supplier of food, feed, food-producing animal or substance incorporated into a food product, as well as identification of the businesses to which they have supplied. In practice, this translates into the obligation to be able to answer in real time the question: «Where did this ingredient come from, and where did the product containing it go?»
In Spain, the Spanish Agency for Food Safety and Nutrition (AESAN) oversees compliance with this regulation and complementary national legislation, including Royal Decree 191/2011 on the General Health Registry of Food Companies and Foods. Audits by major retail customers — Carrefour, Mercadona, Lidl, El Corte Inglés — add an additional layer of demand, since their supplier approval protocols (based on IFS Food, BRC/BRCGS or FSSC 22000 schemes) require traceability demonstrations with response times of four hours or less for any product unit.
In addition to Regulation 178/2002, it is worth noting Regulation (EC) 852/2004 on the hygiene of foodstuffs and, in the case of products of animal origin, Regulation (EC) 853/2004. All of these form part of the so-called «hygiene package» and apply directly throughout the EU without the need for national transposition.
The limitations of a generic ERP in the food industry
A horizontal ERP designed for the industrial or commercial sector can manage items, orders and invoicing, but it is not prepared for the specific requirements of the agri-food industry. The most frequent problems we encounter when auditing companies in the sector are:
- Flat batch number without hierarchy: the ERP stores a single batch field, but the reality of food production requires linking the raw-material batch with the semi-finished batch and the finished-goods batch. Without that hierarchy, backward tracing is manual.
- Expiry dates not linked to the batch: the expiry or best-before date is assigned to the item rather than to the specific batch, making it impossible to correctly manage the FEFO (First Expired, First Out) rule in the warehouse.
- Batch mixing in production without recording: when a manufacturing order partially consumes several batches of the same ingredient, the generic ERP does not record the proportion of each, making granular traceability impossible.
- No waste and reprocessing management: the food sector has variable waste rates due to temperature, humidity and process. An ERP without a waste module cannot reconcile inventories or correctly calculate product costs.
- Disconnection from labelling: the generation of EAN-128 or GS1-128 labels that include the GTIN, the batch and the expiry date must come directly from the ERP, not from an auxiliary application that may fall out of sync.
Key functions of an agri-food ERP with batch traceability
An agri-food ERP designed for the sector must cover, at a minimum, the following functions with regard to traceability:
Receipt and assignment of supplier batches
When a raw material is received, the ERP must allow the supplier's batch number to be recorded along with the expiry date, the certificate of analysis and the delivery note. This batch is linked to the supplier and the purchase order, enabling any quality issue to be traced back to its origin afterwards. If the supplier uses GS1-128 labels or QR codes with a GTIN, the ERP must be able to read that information directly from a barcode scanner or a radio-frequency (RF) terminal, eliminating manual data entry and the associated errors.
Batch explosion in production (internal traceability)
When a manufacturing order is launched, the ERP must break down the formula or bill of materials and record which specific batches of each ingredient are to be consumed. If several different batches of the same ingredient are partially consumed, the system must record the quantity taken from each. Once production is complete, the finished-goods batch is generated with its full genealogical tree: which ingredients, from which batches and in what quantities make it up. This tree is the basis of the traceability report required by major retail customers.
FEFO management in the warehouse
The FEFO (First Expired, First Out) rule is the food-industry variant of classic FIFO: instead of taking out what arrived first, you take out what expires first. To apply FEFO systematically, the ERP must track the location of each batch within the warehouse (or an integrated WMS) and automatically suggest the batch that expires soonest during each picking operation. This reduces the risk of dispatching expired product and minimises waste from expiry.
Expiry date control and preventive alerts
The ERP must automatically calculate the best-before or expiry date of each finished-goods batch based on the item's shelf life and generate alerts when a batch is approaching its expiry date and has not yet left the warehouse. These alerts allow commercial actions to be taken (reduced price, reallocation to another channel) before the product becomes waste or, worse, reaches the customer expired.
Forward and backward traceability in real time
The traceability report must be generated in seconds, not hours. From a raw-material batch number, the system must show all finished-goods batches that contain it and all dispatches in which those batches left the facility. From a finished-goods batch, it must be able to go backward to the ingredients and their supplier batches. This functionality is what is put to the test in IFS or BRC certification audits.
Comparison table: generic ERP vs. agri-food ERP
| Function | Generic ERP | Agri-food ERP |
|---|---|---|
| Batch number management | Free field, no hierarchy | Batch tree: supplier → semi-finished → finished |
| Expiry date | At item level | At batch level, with automatic shelf-life calculation |
| Warehouse dispatch strategy | FIFO or manual | Automatic FEFO, suggestion by location |
| Batch explosion in production | Not available or manual | Automatic when the manufacturing order is confirmed |
| Traceability report | Requires manual cross-referencing | Generated in real time, bidirectional |
| GS1-128 / QR labelling | Disconnected external module | Integrated, generated from the ERP itself |
| Waste and reprocessing control | No specific module | Waste module with impact on product cost |
| Upcoming-expiry alerts | Not available | Automatic alerts configurable by number of days |
| Compliance with Regulation (EC) 178/2002 | Partial, requires adaptation | Natively designed to comply |
Integration of the ERP with quality and food safety systems
Batch traceability does not live in isolation: it is part of a broader food safety management system. A well-implemented agri-food ERP must connect with HACCP (Hazard Analysis and Critical Control Points) self-monitoring plans, cold-room temperature records, and the results of microbiological and physicochemical analyses. In many cases, this integration is achieved through connectors with LIMS (Laboratory Information Management System) systems or IoT environmental monitoring platforms, so that an out-of-specification analytical result automatically blocks the batch in the ERP and generates a non-conformance incident.
When the company has implemented or is implementing a management system to ISO 22000 or one of the GFSI initiative schemes (IFS Food, BRCGS, FSSC 22000), the agri-food ERP becomes the operational tool that puts documented procedures into practice: the recording of HACCP plan verifications, approved-supplier control, non-conformance management and corrective actions are all tracked in the same system that moves batches through the warehouse and production.
The role of the GS1 standard in food traceability
The GS1 standard is the common language of the food supply chain. Its key elements for traceability are the GTIN (Global Trade Item Number), the batch number and the expiry date, encoded in a GS1-128 symbol or a two-dimensional QR code. The regulatory trend within the EU Circular Economy Action Plan points towards requiring the use of GS1 system identifiers in the labelling of a growing number of product categories, with the aim of improving traceability throughout the entire supply chain.
For the manufacturer, this means that the ERP must be capable of generating compliant GS1-128 labels from the production or dispatch module itself, without dependence on external software. Reading those same labels at raw-material receipt and at dispatch picking closes the cycle and ensures that traceability is automatic, not manual.
Agri-food sectors with the most urgent need for a sector-specific ERP
Although any food company benefits from an ERP with batch traceability, there are sub-sectors where implementation is especially urgent due to the complexity of their processes or the demands of their customers:
- Meat and fish processing: origin traceability (farm, vessel, FAO fishing area) is compulsory and goes beyond the production batch.
- Dairy production: shelf lives are short and managing raw milk by intake requires a high degree of granularity in traceability.
- Canned vegetables and juices: mixing varieties from different seasons and origins on the same line requires a multi-season batch tree.
- Industrial bakery and confectionery: allergens (gluten, nuts, milk) must be traceable by batch in order to issue allergen declarations compliant with Regulation (EU) 1169/2011.
- Certified organic producers: Regulation (EU) 2018/848 requires full traceability of certified organic inputs from supplier to finished product.
How Summum Sistemas approaches agri-food ERP implementation
At Summum Sistemas we have been implementing software solutions for SMEs and mid-market companies in Castilla y León and the Canary Islands since 2007. Our implementation methodology for the agri-food sector starts with a diagnostic of current production and warehouse flows: what is produced, how raw-material receipt is managed, how many references are in the catalogue, which customers require which type of traceability documentation, and what level of integration exists with laboratories or packaging lines.
From that diagnostic, we size the most suitable ERP platform — whether Odoo, Sage, Microsoft Dynamics 365 Business Central or other vertical solutions specialised in food — and configure the batch traceability, expiry-date, FEFO, GS1 labelling and traceability report generation modules. Training for warehouse, production and dispatch operators is a fundamental part of the project: reliable traceability depends as much on the tool as on the correct use made of it.
Frequently asked questions
Am I legally required to have a batch traceability system?
Yes. Article 18 of Regulation (EC) 178/2002 requires all food business operators established in the European Union to have systems and procedures in place that allow identification of their material suppliers and the businesses to which they supply their products. The law does not prescribe a specific technological solution, but in practice an ERP with a batch traceability module is the most efficient means of meeting this requirement and being able to demonstrate compliance to the competent authority or a customer auditor.
What is the difference between expiry date and best-before date?
The expiry date («use by…») marks the limit after which the food must not be consumed because it may pose a health risk; it applies mainly to microbiologically perishable products such as fresh meat, fish or fresh dairy. The best-before date («best before…») indicates that after that date the product may have lost some of its organoleptic properties but is not necessarily dangerous. The ERP must distinguish between both fields and apply alerts with different thresholds, since the consequences of mismanaging an expiry date are far more serious than those of a best-before date.
How long must traceability records be kept?
Regulation (EC) 178/2002 does not set a single period: it states that records must be kept for a reasonable time and refers to Member States and HACCP plans to define this in concrete terms. In practice, the AESAN guide and the IFS and BRC protocols recommend keeping records for the shelf life of the product plus a margin of at least six months. For long-life products (canned goods, flours, oils), this can amount to several years. The ERP must allow these historical records to be retained and accessed quickly.
Can an agri-food ERP integrate with automated production lines?
Yes. Modern ERPs with an MES (Manufacturing Execution System) module or OPC-UA connectors can receive weight, temperature, speed and count data directly from packaging or processing lines. This allows the batch to be opened and closed automatically at the start and end of each manufacturing order, waste to be recorded in real time, and in-line weight checks to be linked to the corresponding batch. M2M (machine-to-machine) integration eliminates manual transcription and significantly increases the reliability of traceability.