> ## Documentation Index
> Fetch the complete documentation index at: https://docs.procuros.io/llms.txt
> Use this file to discover all available pages before exploring further.

# How to set up Batches

> Step by step guide to setting up batches in Xentral

## What are Batches?

Batch management enables product traceability and is particularly important in the food and pharmaceutical industries.

### Setting Up Batches

**1. Activate batches in Xentral**

First, navigate to batch management in the Xentral system settings.

![Chargen (1).jpg](https://mintcdn.com/procuros-c35f505c/WEWxE_97bveYqyyM/Chargen\(1\).jpg?fit=max\&auto=format\&n=WEWxE_97bveYqyyM\&q=85\&s=ebcabbcaa7bab25bc4d03b37567d2ab1)

**2. New Report**

Create a new Report and name it: Procuros: Gelieferte Chargeninformationen

![Chargen 11.jpg](https://mintcdn.com/procuros-c35f505c/WEWxE_97bveYqyyM/Chargen11.jpg?fit=max\&auto=format\&n=WEWxE_97bveYqyyM\&q=85\&s=438e14854bc6438986c41d34e8f23843)

**3. New Variable**

Create a new variable with the following values:

* the variable name must be LIEFERSCHEINID
* the ‘default value’ must be an ID from a delivery note that contains batches:

  * to find this ID, go to a delivery note that contains batches that already exist in your system
  * open this delivery note
  * copy the ID from the URL and enter it in the Default value field

  ![Chargen 7.jpg](https://mintcdn.com/procuros-c35f505c/WEWxE_97bveYqyyM/Chargen7.jpg?fit=max\&auto=format\&n=WEWxE_97bveYqyyM\&q=85\&s=f5551db089ea2dec7291ef580816c54c)

**4. Copy\&Paste the SQL-Code**

Copy the following SQL-Code-Snippet and paste it into the SQL Field. Click the play-Button afterwards.

```
SELECT *FROM mhd_log WHERE doctype = 'lieferschein' AND doctypeid = '{LIEFERSCHEINID}'
```

![Chargen 8.jpg](https://mintcdn.com/procuros-c35f505c/WEWxE_97bveYqyyM/Chargen8.jpg?fit=max\&auto=format\&n=WEWxE_97bveYqyyM\&q=85\&s=2932219acf0ecb25fa1dc816ab4d8d06)

**5. Generate columns**

Click on "generate columns"

![Chargen 9.jpg](https://mintcdn.com/procuros-c35f505c/WEWxE_97bveYqyyM/Chargen9.jpg?fit=max\&auto=format\&n=WEWxE_97bveYqyyM\&q=85\&s=57613c9ad92945fb2ee1aa9f71baeb6e)

**6. API Access**

Go over to the "Transfer"-Tab and set the following API Access settings:

![Chargen 10.jpg](https://mintcdn.com/procuros-c35f505c/WEWxE_97bveYqyyM/Chargen10.jpg?fit=max\&auto=format\&n=WEWxE_97bveYqyyM\&q=85\&s=5e740ff735a9ce52726154af0508bb25)

**7. Send ID to Procuros**

Open the report and you will find the ID in the URL (e.g. ...\&id=170). This number must be sent to Procuros. If you are not sure which number to use, simply send us the entire link. Send an e-mail to [edi@procuros.io](mailto:edi@procuros.io) - we will then store this ID in our system.

### Managing Best-Before Dates

Closely connected to batch management is the management of best-before dates:

**1. Activate BBD management**

Activate the management of best-before dates in the article settings

![MHD1 (1).jpg](https://mintcdn.com/procuros-c35f505c/WEWxE_97bveYqyyM/MHD1\(1\).jpg?fit=max\&auto=format\&n=WEWxE_97bveYqyyM\&q=85\&s=d113159fed3d96aed7f00a0f9e14ffa9)

**2. Set the Dates**

Navigate to Best Before + Batch and enter the number of items, the corresponding best-before date and the desired storage location of the item.

![MHD3 (2).jpg](https://mintcdn.com/procuros-c35f505c/WEWxE_97bveYqyyM/MHD3\(2\).jpg?fit=max\&auto=format\&n=WEWxE_97bveYqyyM\&q=85\&s=9f97c72eac34f3489317e12ffc04aedb)

> [!NOTE]
>
> The correct management of batches and best-before dates is particularly important for companies subject to legal traceability obligations.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.