From 37ec17bcfb8171b4fc5bf0adfb21637b586975ae Mon Sep 17 00:00:00 2001 From: Erlend Klakegg Bergheim Date: Wed, 15 Nov 2017 11:04:37 +0100 Subject: [PATCH] Adding validation of base quantity. #244 --- .../2.0/en/changelog/2017-11-15-2.0.12.adoc | 8 +++ .../no/endringslogg/2017-11-15-2.0.12.adoc | 8 +++ .../ehf-creditnote-2.0/sch/NONAT-UBL-T14.sch | 7 +++ .../unit-NONAT/NONAT-T14-R033.xml | 63 +++++++++++++++++++ rules/ehf-invoice-2.0/sch/NONAT-UBL-T10.sch | 6 ++ .../unit-NONAT/NONAT-T10-R033.xml | 63 +++++++++++++++++++ 6 files changed, 155 insertions(+) create mode 100644 rules/ehf-creditnote-2.0/unit-NONAT/NONAT-T14-R033.xml create mode 100644 rules/ehf-invoice-2.0/unit-NONAT/NONAT-T10-R033.xml diff --git a/guides/invoice-and-creditnote/2.0/en/changelog/2017-11-15-2.0.12.adoc b/guides/invoice-and-creditnote/2.0/en/changelog/2017-11-15-2.0.12.adoc index 53786919..f241beb9 100644 --- a/guides/invoice-and-creditnote/2.0/en/changelog/2017-11-15-2.0.12.adoc +++ b/guides/invoice-and-creditnote/2.0/en/changelog/2017-11-15-2.0.12.adoc @@ -17,6 +17,10 @@ | Replacing rules with rules in EHF Common. | Validator +| link:https://github.com/difi/vefa-ehf-postaward/issues/244[#244] +| Adding rules link:{ruleurl-inv}NONAT-T10-R033/[NONAT-T10-R033] (**W**) and link:{ruleurl-cre}NONAT-T14-R033/[NONAT-T14-R033] (**W**). +| Validator + | link:https://github.com/difi/vefa-ehf-postaward/issues/233[#233] | Updated chapter on validation to reflect use of EHF Common. | Guide @@ -31,6 +35,10 @@ |=== +WARNING: Validation rules expected to be updated to trigger error in next release: +link:{ruleurl-inv}NONAT-T10-R033/[NONAT-T10-R033], +link:{ruleurl-cre}NONAT-T14-R033/[NONAT-T14-R033] + === Mapping of rules for EHF Common in EHF Invoice diff --git a/guides/invoice-and-creditnote/2.0/no/endringslogg/2017-11-15-2.0.12.adoc b/guides/invoice-and-creditnote/2.0/no/endringslogg/2017-11-15-2.0.12.adoc index ab36c0e2..d7cae084 100644 --- a/guides/invoice-and-creditnote/2.0/no/endringslogg/2017-11-15-2.0.12.adoc +++ b/guides/invoice-and-creditnote/2.0/no/endringslogg/2017-11-15-2.0.12.adoc @@ -17,6 +17,10 @@ | Bytte ut en del regler med regler i EHF Common. | Validator +| link:https://github.com/difi/vefa-ehf-postaward/issues/244[#244] +| Langt til reglene link:{ruleurl-inv}NONAT-T10-R033/[NONAT-T10-R033] (**W**) og link:{ruleurl-cre}NONAT-T14-R033/[NONAT-T14-R033] (**W**). +| Validator + | link:https://github.com/difi/vefa-ehf-postaward/issues/233[#233] | Oppdatert kapittel om validering så det reflerterer bruk av EHF Common. | Guide @@ -31,6 +35,10 @@ |=== +WARNING: Valideringsregler som er ventet å trigge feil i neste release: +link:{ruleurl-inv}NONAT-T10-R033/[NONAT-T10-R033], +link:{ruleurl-cre}NONAT-T14-R033/[NONAT-T14-R033] + === Mapping of rules for EHF Common in EHF Invoice diff --git a/rules/ehf-creditnote-2.0/sch/NONAT-UBL-T14.sch b/rules/ehf-creditnote-2.0/sch/NONAT-UBL-T14.sch index 59007035..121d84d5 100644 --- a/rules/ehf-creditnote-2.0/sch/NONAT-UBL-T14.sch +++ b/rules/ehf-creditnote-2.0/sch/NONAT-UBL-T14.sch @@ -120,6 +120,13 @@ test="not(cac:Item/cac:ClassifiedTaxCategory/cbc:Percent) or (some $cat in $taxCategories satisfies $cat = $category)" flag="fatal">[NONAT-T14-R030]-Tax category on line level MUST match provided tax categories on document level. + + + [NONAT-T10-R031]-Base quantity must be a positive value higher than zero. + + diff --git a/rules/ehf-creditnote-2.0/unit-NONAT/NONAT-T14-R033.xml b/rules/ehf-creditnote-2.0/unit-NONAT/NONAT-T14-R033.xml new file mode 100644 index 00000000..06d8cc84 --- /dev/null +++ b/rules/ehf-creditnote-2.0/unit-NONAT/NONAT-T14-R033.xml @@ -0,0 +1,63 @@ + + + + Verify use of base quantity + NONAT-T14-R033 + + + + NONAT-T14-R033 + + + + + 1 + + + + + + + NONAT-T14-R033 + + + + + 0.01 + + + + + + + NONAT-T14-R033 + + + + + 0 + + + + + + + NONAT-T14-R033 + + + + + -1 + + + + + diff --git a/rules/ehf-invoice-2.0/sch/NONAT-UBL-T10.sch b/rules/ehf-invoice-2.0/sch/NONAT-UBL-T10.sch index 7ebdea90..15502893 100644 --- a/rules/ehf-invoice-2.0/sch/NONAT-UBL-T10.sch +++ b/rules/ehf-invoice-2.0/sch/NONAT-UBL-T10.sch @@ -121,6 +121,12 @@ flag="fatal">[NONAT-T10-R026]-Invoice line amount MUST be equal to the price amount multiplied by the quantity plus charges minus allowances at line level. + + [NONAT-T10-R031]-Base quantity must be a positive value higher than zero. + + diff --git a/rules/ehf-invoice-2.0/unit-NONAT/NONAT-T10-R033.xml b/rules/ehf-invoice-2.0/unit-NONAT/NONAT-T10-R033.xml new file mode 100644 index 00000000..cf42123c --- /dev/null +++ b/rules/ehf-invoice-2.0/unit-NONAT/NONAT-T10-R033.xml @@ -0,0 +1,63 @@ + + + + Verify use of base quantity + NONAT-T10-R033 + + + + NONAT-T10-R033 + + + + + 1 + + + + + + + NONAT-T10-R033 + + + + + 0.01 + + + + + + + NONAT-T10-R033 + + + + + 0 + + + + + + + NONAT-T10-R033 + + + + + -1 + + + + +