diff --git a/docs/extensions/business-rules-validation/configuration-examples.md b/docs/extensions/business-rules-validation/configuration-examples.md index 68b85d4bc..4d5c7771a 100644 --- a/docs/extensions/business-rules-validation/configuration-examples.md +++ b/docs/extensions/business-rules-validation/configuration-examples.md @@ -5,6 +5,38 @@ title: 'Configuration examples' Here you can find examples of the most common real-world use cases for Business Rules Validation. +## Common Accounts Payable (AP) checks + +### Invoice face value discrepancy + +```json +{ + "checks": [ + { + "rule": "{amount_total} == {amount_total_base} + {amount_total_tax}", + "type": "error", + "message": "Total amount is not equal to the sum of amount base and the tax", + "automation_blocker": true + } + ] +} +``` + +### Sum of line items must match invoice total + +```json +{ + "checks": [ + { + "rule": "sum({item_amount_total}) == {amount_total}", + "type": "error", + "message": "The sum of line items is not equal to the total amount.", + "automation_blocker": true + } + ] +} +``` + ## At least one field must be filled The following Business Rules Validation configuration shows errors only when all the values are empty. It is satisfied if at least one of the values is filled. @@ -28,7 +60,6 @@ The following Business Rules Validation configuration shows errors only when all } ] } - ], - "variables": {} + ] } ```