From f325bc5979dea732f36bf3c9715b449741a3f634 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Zl=C3=A1mal?= Date: Thu, 4 Apr 2024 12:40:44 -0600 Subject: [PATCH] EXT: update Business Rules config examples --- .../configuration-examples.md | 35 +++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) 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": {} + ] } ```