Consistency/en

De Documentations Patas-monkey
Aller à la navigation Aller à la recherche
Cette page est une version traduite de la page Consistency et la traduction est terminée à 95 %.
Consistency allows for the creation of custom consistency checks.


It relies on an SQL query that validates the check you wish to implement, and a tooltip appears on the item's record.
It is also possible to display a consistency indicator in the item lists.
Consistency comes with multiple examples in the `xmlsample` folder.

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:

  • consistency: the **consistency** main menu item displays all the rules defined in your environment (even those that are not active). Clicking on a rule's title allows you to view and edit it.
  • New consistency rule: this option opens the page for creating a new consistency rule.
  • Import a rule: this option opens a page allowing you to copy an import file containing a list in XML format. (See "Importing a rule" below).

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.
From the Patas Tools > Consistency > Import rule page, paste the XML file into the input area and click the Start import button.

Activate the rule from its details page, and it will be applied in your environment.