System-defined and user-defined rules
Interpretation rules as well as mapping rules include system-defined rules, and you can also create your own user-defined rules.
System-defined rules are stored with a negative rule number. These can't be edited or deleted, but you can suspend any system-defined rule if you don’t want to map a specific value.
When several mapping rules exist for the same column, they are applied in ascending order by rule number, and the rule with the highest number produces the final result. To ensure that the correct rule is applied, you can suspend all other rules for that column.
User-defined rules are added by you, and can be edited or deleted as needed.
Interpretation and mapping rules are stored in regular database tables. You can build Business NXT layouts to view, edit, or add new rules even of there's currently no default layouts available for this purpose.
Adding interpretation rules
| Field | Description | Comment |
|---|---|---|
| Rule no. | The primary key identifying the rule | |
| Name | Defined by you | Preferably use meaningful names similar to Business NXT fields to simplify mapping to the Batch and Voucher tables. |
| XML path | The path where the value will be parsed |
Formatting example:
Preferably use an XML editor to copy, paste, and adjust the path. |
| Target | Define the level, either 0 - Document or 10 - Line | |
| Rule type | Automatically set to 0 - System or 10 - User defined | User-defined rules are set to 10 - User defined by default and can't be changed to 0 - System. |
Adding mapping rules
| Field | Description | Comment |
|---|---|---|
| Mapping rule no. | The primary key identifying the rule | |
| Interpretation rule no. | The connected interpretation rule number | Results from interpretation rules not listed here will be saved in the specified table and column. |
| Table no. | The table where you want to save the interpreted value | For now, use the Batch and Voucher tables. |
| Column no. | The column where you want to save the interpreted value | For now, use the Batch and Voucher tables. |
| Rule type | Automatically set to 0 - System or 10 - User defined | User-defined rules are set to 10 - User defined by default and can't be changed to 0 - System. |
| Value type | Specifies the data type to store | Predefined values are available |
| Suspended | You can choose not to use certain rules. | This applies to system-defined rules as well. |
| Copy from header mapping | Specifies a rule number to copy values to all lines | Preferably use a document-level rule number. |
The following limitations apply when adding mapping rules:
- Only the Batch and Voucher tables can be selected as Table no..
- You need to enter values for both the Name and XML path fields to be able to save a rule.
- You can only save rules with valid XPath expressions. The system validates the XML path when you move to another field or the field loses focus.
Interpretation and mapping at the invoice line level
Interpretation rules can be defined at the document or line level. Rules at the document level interpret invoice header data, while line-level rules handle data on the invoice lines.
In Business NXT, document header information is mostly stored on the first voucher line (supplier line), and line-specific information is stored starting from the second line as voucher lines. Interpretation and mapping follow the same logic, so you should create user-defined rules accordingly.
System-defined interpretation rules with extra processing
Some XML invoice values require extra processing or calculations to become valid accounting data. For example, the line VAT amount isn't part of the Peppol BIS 3.0 format, but is needed to calculate the net Amount on lines.
Values obtained through extra processing are handled in the XML mapping table as system-defined rules without an associated interpretation rule.
Copying values from the header
Copying values from the header requires the same value to be entered in the Copy from header mapping column as the Mapping rule no.. This ensures that header values are correctly copied to all lines.
Changing or deleting user-defined rules
You can delete or change user-defined rules if you want to, but if a user-defined rule is linked to a company or company group, you must first remove the association and delete the related mapping rules.