Consistency/en
Presentation
The Consistency module allows you to create your own custom consistency rules based on the information contained in your database. Consistency alerts are created using SQL queries.
Once the consistency rule has been created and activated, it can be displayed as an additional column in the list of elements.
The consistency rule finally appears as an alert on the main page of the associated element.
Consistency comes with several examples of consistency rules located in the 'xmlsample' directory, which you can use as inspiration for creating your own.
Configuring module features
Strictly speaking, there is no configuration required for the module other than its activation.
Getting Started
The consistency features are accessible from the "Patas Tools" main menu tab. Your secondary menu then displays the following menu items:
List of consistency rules
The list of rules displays the consistency rules present in your environment.
You can access the existing rules by clicking the icon at the beginning of each line, or create a new rule by clicking the dedicated buttons.
Creating a consistency rule
Open the rule creation page via the menu link Outils Patas > consistency > New rule:
|
Label |
The label will be displayed as the title in the item list, as well as the title of the information message. |
| Titlelist | The title of the column associated with the consistency rule in the item list. |
| Description | The text associated with the consistency rule, displayed in the information message. |
| Element associated with the check | The element to which the consistency check is associated. The list of elements can be found further down in the documentation. |
|
Alert level |
Specifies the alert level (the color of the information message), ranging from informational (green) to critical (red). |
|
Row count |
The number of records the query must return to trigger the consistency rule. |
|
Author |
Free-text field to enter the author of the business rule. |
|
Active status |
To activate the rule within your Dolibarr instance. |
|
Consistency check query |
An SQL query that checks the data to determine whether to activate the consistency rule. If the check is positive, the query returns a data row; if negative, no data is returned.
To bypass Dolibarr's SQL injection protection, replace SELECT with #SEL#. The identifier associated with the element is passed to the query via the #ID# tag. |
Three buttons are located at the bottom of the display screen:
- **Edit** allows you to enter edit mode for the rule to modify its query or any other element (access menus, display tabs, etc.).
- **Import / Export page** generates an XML file that you can modify before copying it for export.
- **Delete** removes the rule from your database.
List of elements to which a consistency rule can be applied
This list is not exhaustive and will evolve over time.
| Element |
| Third party (company) |
| Product |
| Stock (warehouse) |
| Batch |
| Project |
| Commercial proposal |
| Order |
| Invoice |
| Ticket |
| Request for price |
| Supplier order |
| Supplier invoice |
Importing a consistency rule
You can create a consistency rule by importing an XML file.
| Example rules are provided with the consistency module in the XMLsample folder. |
