# Inventory Number Generation

## Source

| Téléchargement                                               | Sources                                             |
| ------------------------------------------------------------ | --------------------------------------------------- |
| <https://github.com/pluginsGLPI/geninventorynumber/releases> | <https://github.com/pluginsGLPI/geninventorynumber> |

***

## Requirements (self-hosted)

| Version GLPI | PHP minimum | Recommandé |
| ------------ | ----------- | ---------- |
| 10.0.x       | 8.1         | 8.2        |
| 11.0.x       | 8.2         | 8.4        |

{% hint style="info" %}
Ce plugin est disponible sans souscription [GLPI Network](https://services.glpi-network.com/#offers). Il est également disponible sur [GLPI Cloud](https://glpi-network.cloud).
{% endhint %}

***

## Features

The Inventory number generation plugin allows you to dynamically generate inventory numbers based on a user-configured template.

Download and install the **Inventory number generation** plugin from the marketplace

***

## Install the plugin

Go to the marketplace. Download and install the **Inventory number generation** plugin.

<div align="left"><figure><img src="/files/ceYoweC9YERtpROvJf3v" alt=""><figcaption></figcaption></figure></div>

***

## Plugin configuration

You will find the configuration page in **`Tools` > `Inventory number generation`**.

### Global Configuration

<figure><img src="/files/MrE2o8cuF4rv9xU2ZR7N" alt=""><figcaption></figcaption></figure>

* **Field**: Specifies the field that will receive the inventory value generated by the plugin.
* **Active**: Enables or disables automatic generation of inventory numbers.
* **Global index position**: Position of the global index within the increment.
* **Index auto-reset mode**: Frequency at which the global index is reset.
* **Comments**: Enter a comment.

### Specific Configuration

Specific configuration allows for more customized settings for a particular type of object.

<figure><img src="/files/i8HihaClfBzd6HTctUNj" alt=""><figcaption></figcaption></figure>

* **Generation templates**: Configures the model for generating inventory numbers.
* **Active**: Allows or disables the plugin to generate an inventory number for the object type.
* **Use global index**: Uses the global or private index as the reference index for inventory number indentation. Global index indentation will be effective for all objects that use it.

The following options are displayed if the “Use global index” option is set to “No”

* **Index position**: Position of the object's index within the increment
* **Index auto-reset mehtod**: Frequency at which the object's index is reset

***

## Setting up a generation template

A template is a text string containing an **automatically** generated portion. Each generated portion must be delimited by `<` and `>`. Text outside these delimiters is treated as plain text.

### Auto-increment counter mask

The value is defined by a series of hash symbols (`#`) and represents a number that increments by 1 with each generation. The number of `#` indicates the number of significant digits to generate. Unused positions are padded with zeros.

If the value exceeds the number of digits defined in the mask, the counter will continue to increment, and an additional digit will be added. Adding this extra digit only affects the generated inventory number and does not modify the template.

**Example**:

| Model    | Index | Result |
| -------- | ----- | ------ |
| <###>    | 0     | 001    |
| <###>    | 20    | 021    |
| <#>      | 9     | 10     |
| PC-<###> | 0     | PC-001 |

### Date Mask

The value is replaced by selecting the day, month, and/or year according to the masks used in the template. An auto-incrementing counter mask is required for the date mask to function correctly.

| Mask | Description         |
| ---- | ------------------- |
| \d   | Day on 2 digits     |
| \m   | Month in two digits |
| \y   | Two-digit year      |
| \Y   | Year in 4 digits    |

**Example**:

Date: 24/02/2026

| <\d-###>      | 0 | 24-001        |
| ------------- | - | ------------- |
| <\m-###>      | 0 | 12-001        |
| <\y-###>      | 0 | 26-001        |
| <\Y-###>      | 0 | 2026-001      |
| PC-<\d\m\Y-#> | 2 | PC-24022026-3 |

### Object Mask

It is possible to use certain object information to generate the inventory number. An auto-incrementing counter mask is required for the date mask to function correctly.

| \s | Numéro de série de l'objet |
| -- | -------------------------- |
| \n | Nom de l'objet             |

**Example**:

Serial Number: 123

Name: Office

| <\s-###>       | 0 | 123-001           |
| -------------- | - | ----------------- |
| <\n-###>       | 0 | Bureau-001        |
| PC-<\n-\s-###> | 2 | PC-Bureau-123-003 |

## Generating Inventory Counts for Custom Objects

GLPI 11 introduces custom objects, which are natively compatible with the plugin.

By default, custom assets are not affected by the plugin. To enable the plugin to also generate inventory counts for these objects, you must:

1. Go to the capabilities list of the asset in question;
2. Enable the capability added by the plugin: "**Inventory generation number**"

<div align="left"><figure><img src="/files/JL2MQnwB5fB9k6OfSTji" alt=""><figcaption></figcaption></figure></div>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.glpi-project.org/doc-plugins/plugins-glpi/inventory-number-generation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
