From 30d6172dc5ad91e7ec6587578074afb2bc123617 Mon Sep 17 00:00:00 2001 From: Hans Petersen Date: Sun, 1 Sep 2024 14:16:41 +0200 Subject: [PATCH] add fatal check on Invoices with external reference attachment URI --- build.bat | 40 ++++++ guide/release-notes/v3.0.18.adoc | 18 +++ mapping/mapping-cii-ubl v2 fr19.xls | Bin 229376 -> 229376 bytes rules/examples/Allowance-example.xml | 4 +- rules/sch/PEPPOL-EN16931-CII.sch | 1 + rules/sch/PEPPOL-EN16931-UBL.sch | 8 +- rules/snippets/Calc.xml | 4 +- rules/snippets/Snippet-cn.xml | 2 +- rules/snippets/Snippet-full.xml | 2 +- rules/snippets/Snippet-refs.xml | 2 +- rules/snippets/direct-debit.xml | 2 +- rules/snippets/giro.xml | 2 +- rules/snippets/item.xml | 4 +- rules/snippets/payment-credit.xml | 2 +- rules/snippets/payment1.xml | 2 +- rules/snippets/price.xml | 4 +- rules/unit-CII-PEPPOL/PEPPOL-EN16931-R131.xml | 124 ++++++++++++++++++ rules/unit-UBL-PEPPOL/PEPPOL-EN16931-R080.xml | 4 +- rules/unit-UBL-PEPPOL/PEPPOL-EN16931-R131.xml | 110 ++++++++++++++++ 19 files changed, 313 insertions(+), 22 deletions(-) create mode 100644 build.bat create mode 100644 guide/release-notes/v3.0.18.adoc create mode 100644 rules/unit-CII-PEPPOL/PEPPOL-EN16931-R131.xml create mode 100644 rules/unit-UBL-PEPPOL/PEPPOL-EN16931-R131.xml diff --git a/build.bat b/build.bat new file mode 100644 index 00000000..3991f832 --- /dev/null +++ b/build.bat @@ -0,0 +1,40 @@ +@echo off +setlocal + +REM Set the PROJECT variable to the current directory +set "PROJECT=%~dp0" + +REM Check if the target directory exists, if so, remove it +if exist "%PROJECT%target" ( + docker run --rm -i -v "%PROJECT%:/src" alpine:3.11 rm -rf /src/target +) + +REM Structure +docker run --rm -i ^ + -v "%PROJECT%:/src" ^ + -v "%PROJECT%target:/target" ^ + difi/vefa-structure:0.7 + +REM Validator +docker run --rm -i -v "%PROJECT%:/src" anskaffelser/validator:2.1.0 build -x -t -n eu.peppol.postaward.v3.billing -a rules,guide -target target/validator /src + +REM Generate adoc-files from rules +REM CEN-EN16931-UBL +docker run --rm -i -v "%PROJECT%:/src" -v "%PROJECT%target/generated:/target" --entrypoint java klakegg/saxon:9.8.0-7 -cp /saxon.jar net.sf.saxon.Query -s:/src/rules/sch/CEN-EN16931-UBL.sch -q:tools/xquery/rules_asciidoc_cen.xquery -o:/target/CEN-EN16931-UBL-GENERAL.sch.adoc +docker run --rm -i -v "%PROJECT%:/src" -v "%PROJECT%target/generated:/target" --entrypoint java klakegg/saxon:9.8.0-7 -cp /saxon.jar net.sf.saxon.Query -s:/src/rules/sch/CEN-EN16931-UBL.sch -q:tools/xquery/rules_asciidoc_cen_syntax.xquery -o:/target/CEN-EN16931-UBL-SYNTAX.sch.adoc + +REM PEPPOL-EN16931-UBL +docker run --rm -i -v "%PROJECT%:/src" -v "%PROJECT%target/generated:/target" --entrypoint java klakegg/saxon:9.8.0-7 -cp /saxon.jar net.sf.saxon.Query -s:/src/rules/sch/PEPPOL-EN16931-UBL.sch -q:tools/xquery/rules_asciidoc_peppol.xquery -o:/target/PEPPOL-EN16931-UBL-GENERAL.sch.adoc +docker run --rm -i -v "%PROJECT%:/src" -v "%PROJECT%target/generated:/target" --entrypoint java klakegg/saxon:9.8.0-7 -cp /saxon.jar net.sf.saxon.Query -s:/src/rules/sch/PEPPOL-EN16931-UBL.sch -q:tools/xquery/rules_asciidoc_peppol_national.xquery -o:/target/PEPPOL-EN16931-UBL-NATIONAL.sch.adoc + +REM Example files +docker run --rm -i -v "%PROJECT%target/site/files:/src" alpine:3.6 rm -rf /src/BIS-Billing3-Examples.zip +docker run --rm -i -v "%PROJECT%rules/examples:/src" -v "%PROJECT%target/site/files:/target" -w /src kramos/alpine-zip -r /target/BIS-Billing3-Examples.zip . + +REM Guides +docker run --rm -i -v "%PROJECT%:/documents" -v "%PROJECT%target:/target" difi/asciidoctor + +REM Fix ownership +docker run --rm -i -v "%PROJECT%:/src" alpine:3.11 sh -c "chown -R $(id -u).$(id -g) /src/target" + +endlocal diff --git a/guide/release-notes/v3.0.18.adoc b/guide/release-notes/v3.0.18.adoc new file mode 100644 index 00000000..42e59578 --- /dev/null +++ b/guide/release-notes/v3.0.18.adoc @@ -0,0 +1,18 @@ += Version 3.0.18 +[horizontal] +Release date:: November 2024 + +== Changes to BIS document + +* sample files and snippits have been updated to reflect the new rule PEPPOL-EN16931-R131 + + http://www.techspec.no + + +== Changes to code lists and validation artefacts + + +== EN 16931 schematrons updated + +* new fatal rule PEPPOL-EN16931-R131 on Document refenced by URI, only allows content starting with http(s):// or ftp(s):// + diff --git a/mapping/mapping-cii-ubl v2 fr19.xls b/mapping/mapping-cii-ubl v2 fr19.xls index 9827b9dbca170df5cde429a0f358048541b0a81b..7ae2c51a68b3ad5967ffb2a78107e769f10c5cf6 100644 GIT binary patch delta 49 zcmZo@;A?2$+n~Y3!OFmpQIJ}a+HAnoZotF{#7x@_n3!#9*cFcIG>87VwY|8Gxt9?D DRk9A} delta 49 zcmZo@;A?2$+n~Y3!Oy_po|<2j-fY0sZotF{#7x@_n3!#9*e|SdUi_-&>h|I~=3Yhs DU1$%h diff --git a/rules/examples/Allowance-example.xml b/rules/examples/Allowance-example.xml index 2632750e..a0b32605 100644 --- a/rules/examples/Allowance-example.xml +++ b/rules/examples/Allowance-example.xml @@ -30,7 +30,7 @@ Technical specification - www.techspec.no + http://www.techspec.no @@ -366,5 +366,3 @@ - - diff --git a/rules/sch/PEPPOL-EN16931-CII.sch b/rules/sch/PEPPOL-EN16931-CII.sch index bd79c798..62be7fdd 100644 --- a/rules/sch/PEPPOL-EN16931-CII.sch +++ b/rules/sch/PEPPOL-EN16931-CII.sch @@ -209,6 +209,7 @@ Last update: 2024 May release 3.0.17. A buyer reference or purchase order reference MUST be provided. Only one invoiced object is allowed on document level Only one project reference is allowed on document level + The Uniform Resource Locater should start with http(s):// or ftp(s):// VAT accounting currency code MUST be different from invoice currency code when provided. diff --git a/rules/sch/PEPPOL-EN16931-UBL.sch b/rules/sch/PEPPOL-EN16931-UBL.sch index 3071f8d3..afe8a855 100644 --- a/rules/sch/PEPPOL-EN16931-UBL.sch +++ b/rules/sch/PEPPOL-EN16931-UBL.sch @@ -2,7 +2,7 @@ Rules for Peppol BIS 3.0 Billing @@ -247,6 +247,12 @@ Last update: 2024 May release 3.0.17. Only one project reference is allowed on document level + + + The Uniform Resource Locater should start with http(s):// or ftp(s):// + + diff --git a/rules/snippets/Calc.xml b/rules/snippets/Calc.xml index b5270787..0fef25c3 100644 --- a/rules/snippets/Calc.xml +++ b/rules/snippets/Calc.xml @@ -43,7 +43,7 @@ Technical specification - www.techspec.no + http://www.techspec.no @@ -484,5 +484,3 @@ - - diff --git a/rules/snippets/Snippet-cn.xml b/rules/snippets/Snippet-cn.xml index 0d3103bf..8b70cd8c 100644 --- a/rules/snippets/Snippet-cn.xml +++ b/rules/snippets/Snippet-cn.xml @@ -53,7 +53,7 @@ Technical specification - www.techspec.no + http://www.techspec.no diff --git a/rules/snippets/Snippet-full.xml b/rules/snippets/Snippet-full.xml index c6c13e2d..37089081 100644 --- a/rules/snippets/Snippet-full.xml +++ b/rules/snippets/Snippet-full.xml @@ -50,7 +50,7 @@ Technical specification - www.techspec.no + http://www.techspec.no diff --git a/rules/snippets/Snippet-refs.xml b/rules/snippets/Snippet-refs.xml index 30ee023b..663f71b8 100644 --- a/rules/snippets/Snippet-refs.xml +++ b/rules/snippets/Snippet-refs.xml @@ -55,7 +55,7 @@ Technical specification - www.techspec.no + http://www.techspec.no diff --git a/rules/snippets/direct-debit.xml b/rules/snippets/direct-debit.xml index 662dcff5..8eed66d0 100644 --- a/rules/snippets/direct-debit.xml +++ b/rules/snippets/direct-debit.xml @@ -42,7 +42,7 @@ Technical specification - www.techspec.no + http://www.techspec.no diff --git a/rules/snippets/giro.xml b/rules/snippets/giro.xml index 98c9dac1..df555837 100644 --- a/rules/snippets/giro.xml +++ b/rules/snippets/giro.xml @@ -42,7 +42,7 @@ Technical specification - www.techspec.no + http://www.techspec.no diff --git a/rules/snippets/item.xml b/rules/snippets/item.xml index 21f3da09..811b7431 100644 --- a/rules/snippets/item.xml +++ b/rules/snippets/item.xml @@ -30,7 +30,7 @@ Technical specification - www.techspec.no + http://www.techspec.no @@ -386,5 +386,3 @@ - - diff --git a/rules/snippets/payment-credit.xml b/rules/snippets/payment-credit.xml index 1ecc119a..8b3ceccf 100644 --- a/rules/snippets/payment-credit.xml +++ b/rules/snippets/payment-credit.xml @@ -43,7 +43,7 @@ Technical specification - www.techspec.no + http://www.techspec.no diff --git a/rules/snippets/payment1.xml b/rules/snippets/payment1.xml index a06bb289..d7b34a4f 100644 --- a/rules/snippets/payment1.xml +++ b/rules/snippets/payment1.xml @@ -43,7 +43,7 @@ Technical specification - www.techspec.no + http://www.techspec.no diff --git a/rules/snippets/price.xml b/rules/snippets/price.xml index 44431316..2026b966 100644 --- a/rules/snippets/price.xml +++ b/rules/snippets/price.xml @@ -43,7 +43,7 @@ Technical specification - www.techspec.no + http://www.techspec.no @@ -464,5 +464,3 @@ - - diff --git a/rules/unit-CII-PEPPOL/PEPPOL-EN16931-R131.xml b/rules/unit-CII-PEPPOL/PEPPOL-EN16931-R131.xml new file mode 100644 index 00000000..ae98ee95 --- /dev/null +++ b/rules/unit-CII-PEPPOL/PEPPOL-EN16931-R131.xml @@ -0,0 +1,124 @@ + + + + Verify that URI has a correct Uniform Resource Locator. + PEPPOL-EN16931-R131 + + + + PEPPOL-EN16931-R131 + + + + + + + ftp://some/invoice/203040 + + + + + + + + + PEPPOL-EN16931-R131 + + + + + + + http://some/invoice/203041 + + + + + + + + + PEPPOL-EN16931-R131 + + + + + + + FTPS://some/invoice/203042 + + + + + + + + + PEPPOL-EN16931-R131 + + + + + + + HTTPS://some/invoice/203043 + + + + + + + + + PEPPOL-EN16931-R131 + + + + + + + HTTPSInvoice 203050 + + + + + + + + + + PEPPOL-EN16931-R131 + + + + + + + FTPInvoice 203051 + + + + + + + + diff --git a/rules/unit-UBL-PEPPOL/PEPPOL-EN16931-R080.xml b/rules/unit-UBL-PEPPOL/PEPPOL-EN16931-R080.xml index 308100cd..9ca4bad1 100644 --- a/rules/unit-UBL-PEPPOL/PEPPOL-EN16931-R080.xml +++ b/rules/unit-UBL-PEPPOL/PEPPOL-EN16931-R080.xml @@ -21,7 +21,7 @@ Technical specification - www.techspec.no + http://www.techspec.no @@ -41,7 +41,7 @@ Technical specification - www.techspec.no + http://www.techspec.no diff --git a/rules/unit-UBL-PEPPOL/PEPPOL-EN16931-R131.xml b/rules/unit-UBL-PEPPOL/PEPPOL-EN16931-R131.xml new file mode 100644 index 00000000..f6c93746 --- /dev/null +++ b/rules/unit-UBL-PEPPOL/PEPPOL-EN16931-R131.xml @@ -0,0 +1,110 @@ + + + + Verify that URI has a correct Uniform Resource Locator. + PEPPOL-EN16931-R131 + + + + PEPPOL-EN16931-R131 + + + + + + ftp://some/invoice/203040 + + + + + + + + PEPPOL-EN16931-R131 + + + + + + http://some/invoice/203041 + + + + + + + + PEPPOL-EN16931-R131 + + + + + + FTPS://some/invoice/203042 + + + + + + + + PEPPOL-EN16931-R131 + + + + + + HTTPS://some/invoice/203043 + + + + + + + + PEPPOL-EN16931-R131 + + + + + + HTTPSInvoice 203050 + + + + + + + + PEPPOL-EN16931-R131 + + + + + + FTPInvoice 203051 + + + + + + \ No newline at end of file