From d92a40b48c55fe7799f4dddbba5a6a7ffba9c00c Mon Sep 17 00:00:00 2001 From: Martin Forsberg Date: Fri, 9 Feb 2024 16:32:17 +0100 Subject: [PATCH 1/4] POACC-735 SE rule for check digit --- rules/sch/PEPPOL-EN16931-UBL.sch | 27 +- rules/unit-UBL-PEPPOL/PEPPOL-COMMON-R049.xml | 15 +- rules/unit-UBL-SE/UBL-IN_SE-R-013.xml | 311 +++++++++++++++++++ 3 files changed, 351 insertions(+), 2 deletions(-) create mode 100644 rules/unit-UBL-SE/UBL-IN_SE-R-013.xml diff --git a/rules/sch/PEPPOL-EN16931-UBL.sch b/rules/sch/PEPPOL-EN16931-UBL.sch index afb328cb..1749acad 100644 --- a/rules/sch/PEPPOL-EN16931-UBL.sch +++ b/rules/sch/PEPPOL-EN16931-UBL.sch @@ -196,6 +196,30 @@ Last update: 2023 May release 3.0.15. (number($digits[1])*256) "/> + + + + + + + + + + + + + + + + + + @@ -362,7 +386,7 @@ Last update: 2023 May release 3.0.15. Italian VAT Code (Partita Iva) must be stated in the correct format --> - Swedish organization number MUST be stated in the correct format. + Swedish organization number MUST be stated in the correct format. Australian Business Number (ABN) MUST be stated in the correct format. @@ -471,6 +495,7 @@ Last update: 2023 May release 3.0.15. Swedish organisation numbers should be numeric. Swedish organisation numbers consist of 10 characters. + The last digit of a Swedish organization number must be valid according to the Luhn algorithm. For Swedish suppliers, when using Seller tax registration identifier, 'Godkänd för F-skatt' must be stated diff --git a/rules/unit-UBL-PEPPOL/PEPPOL-COMMON-R049.xml b/rules/unit-UBL-PEPPOL/PEPPOL-COMMON-R049.xml index a3c6b8c3..189c8f74 100644 --- a/rules/unit-UBL-PEPPOL/PEPPOL-COMMON-R049.xml +++ b/rules/unit-UBL-PEPPOL/PEPPOL-COMMON-R049.xml @@ -13,7 +13,7 @@ - 5566221100 + 2021005489 @@ -46,4 +46,17 @@ + + + PEPPOL-COMMON-R049 + + + + + 2021005480 + + + + + diff --git a/rules/unit-UBL-SE/UBL-IN_SE-R-013.xml b/rules/unit-UBL-SE/UBL-IN_SE-R-013.xml new file mode 100644 index 00000000..d9d6e23b --- /dev/null +++ b/rules/unit-UBL-SE/UBL-IN_SE-R-013.xml @@ -0,0 +1,311 @@ + + + + The last digit of a Swedish organization number must be valid according to the Luhn algorithm. + SE-R-013 + + + + SE-R-013 + + + + urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0 + urn:fdc:peppol.eu:2017:poacc:billing:01:1.0 + 2018210 + 2018-02-08 + 2018-03-07 + 380 + Testfil för kontroll av svenska valideringsregler + SEK + BuyerRef 123 + + + + 2021005489 + + Storgatan 1 + Stockholm + 11122 + + SE + + + + Godkänd för F-skatt + + TAX + + + + SE123456789001 + + VAT + + + + Allsälj AB + 2021005489 + Säte: Stockholm + + + + + + + 2021005489 + + Kommunteknisk service + + + Lilla gränd 9 + Stockholm + 10203 + + SE + + + + Kommunens Tekniska Bolag AB + 2021005489 + + + + + + 30 + 08/00355 + + 1234567 + Account name + + 9999 + + + + + + false + Rabatt + 11 + + S + 25 + + VAT + + + + + true + Förvaring + 11 + + S + 25 + + VAT + + + + + + 25 + + 100 + 25 + + S + 25 + + VAT + + + + + + + 100 + 100 + 125 + + 11 + 11 + 125 + + + + 1 + 5 + 100 + + Utbytesstol + + S + 25 + + VAT + + + + + 20 + + + + + + + + + + SE-R-013 + + + urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0 + urn:fdc:peppol.eu:2017:poacc:billing:01:1.0 + 2018210 + 2018-02-08 + 2018-03-07 + 380 + Testfil för kontroll av svenska valideringsregler + SEK + BuyerRef 123 + + + + 2021005489 + + Storgatan 1 + Stockholm + 11122 + + SE + + + + SE123456789001 + + VAT + + + + Allsälj AB + 2021005480 + Säte: Stockholm + + + + + + + 2021005489 + + Kommunteknisk service + + + Lilla gränd 9 + Stockholm + 10203 + + SE + + + + Kommunens Tekniska Bolag AB + 1234512345 + + + + + + 30 + 08/00355 + + 1234567 + Account name + + 9999 + + + + + + false + Rabatt + 11 + + S + 25 + + VAT + + + + + true + Förvaring + 11 + + S + 25 + + VAT + + + + + + 25 + + 100 + 25 + + S + 25 + + VAT + + + + + + + 100 + 100 + 125 + + 11 + 11 + 125 + + + + 1 + 5 + 100 + + Utbytesstol + + S + 25 + + VAT + + + + + 20 + + + + + + + From 42735f26ebbb7b17bd695c9f9b60ae03cc52db3f Mon Sep 17 00:00:00 2001 From: Martin Forsberg Date: Fri, 9 Feb 2024 16:59:37 +0100 Subject: [PATCH 2/4] handlng of non-numeric value --- rules/sch/PEPPOL-EN16931-UBL.sch | 41 +++++++++++++++++--------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/rules/sch/PEPPOL-EN16931-UBL.sch b/rules/sch/PEPPOL-EN16931-UBL.sch index 1749acad..59323803 100644 --- a/rules/sch/PEPPOL-EN16931-UBL.sch +++ b/rules/sch/PEPPOL-EN16931-UBL.sch @@ -200,25 +200,28 @@ Last update: 2023 May release 3.0.15. - - - - - - - - - - - - - + + + + + + + + + + + + + + + + From 6f0a412933c80fe325722d1145c145c716475361 Mon Sep 17 00:00:00 2001 From: Martin Forsberg Date: Fri, 9 Feb 2024 17:11:10 +0100 Subject: [PATCH 3/4] Added rule and test case for CII --- rules/sch/PEPPOL-EN16931-CII.sch | 31 +- rules/unit-CII-PEPPOL/PEPPOL-COMMON-R049.xml | 30 +- rules/unit-CII-SE/CII-IN_SE-R-013.xml | 494 +++++++++++++++++++ 3 files changed, 552 insertions(+), 3 deletions(-) create mode 100644 rules/unit-CII-SE/CII-IN_SE-R-013.xml diff --git a/rules/sch/PEPPOL-EN16931-CII.sch b/rules/sch/PEPPOL-EN16931-CII.sch index 515b276c..28c3f363 100644 --- a/rules/sch/PEPPOL-EN16931-CII.sch +++ b/rules/sch/PEPPOL-EN16931-CII.sch @@ -171,6 +171,34 @@ Last update: 2022 May release 3.0.13. ((string-to-codepoints(substring($val,11,1)) - 48) * 19)) mod 89 = 0 "/> + + + + + + + + + + + + + + + + + + + + + + Business process MUST be provided. @@ -304,7 +332,7 @@ Last update: 2022 May release 3.0.13. Italian VAT Code (Partita Iva) must be stated in the correct format - Swedish organization number MUST be stated in the correct format. + Swedish organization number MUST be stated in the correct format. Australian Business Number (ABN) MUST be stated in the correct format. @@ -417,6 +445,7 @@ Last update: 2022 May release 3.0.13. Swedish organisation numbers should be numeric. Swedish organisation numbers consist of 10 characters. + The last digit of a Swedish organization number must be valid according to the Luhn algorithm. For Swedish suppliers, when using Seller tax registration identifier, 'Godkänd för F-skatt' must be stated diff --git a/rules/unit-CII-PEPPOL/PEPPOL-COMMON-R049.xml b/rules/unit-CII-PEPPOL/PEPPOL-COMMON-R049.xml index 091a97c6..837bbe39 100644 --- a/rules/unit-CII-PEPPOL/PEPPOL-COMMON-R049.xml +++ b/rules/unit-CII-PEPPOL/PEPPOL-COMMON-R049.xml @@ -22,12 +22,12 @@ - 5544332211 + 2021005489 - 5544332211 + 2021005489 @@ -91,6 +91,32 @@ + + + PEPPOL-COMMON-R049 + + + + + + 380 + + + + + + 2021005480 + + + + + + + diff --git a/rules/unit-CII-SE/CII-IN_SE-R-013.xml b/rules/unit-CII-SE/CII-IN_SE-R-013.xml new file mode 100644 index 00000000..ec76bdec --- /dev/null +++ b/rules/unit-CII-SE/CII-IN_SE-R-013.xml @@ -0,0 +1,494 @@ + + + + The last digit of a Swedish organization number must be valid according to the Luhn algorithm. + SE-R-013 + + + + SE-R-013 + + + + + + + urn:fdc:peppol.eu:2017:poacc:billing:01:1.0 + + + urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0 + + + + + 2018210 + 380 + + 20180208 + + + + + + + + 1 + + + Printing paper + + + + 1 + + + + 1000 + + + + VAT + S + 25 + + + 1000 + + + + + + + 2 + + + Parker Pen + + + + 5 + + + + 100 + + + + VAT + S + 25 + + + 500 + + + + + + + 3 + + + Eraser P-97 + + + + 5 + + + + 500 + + + + VAT + S + 12 + + + 2500 + + + + + + Ref 123 + + Allsälj AB + + 2021005489 + + + SE + + + 2021005489 + + + SE123456789001 + + + Godkänd för F-skatt + + + + + Buyercompany ltd + + DK + + + 2021005489 + + + + + + + + 08/00355 + SEK + + + 30 + + 123456 + + + BANKSBIC + + + + 30 + + 1234567 + + + SE:BANKGIRO + + + + 30 + + 12345678 + + + SE:PLUSGIRO + + + + + 375 + VAT + 1500 + S + 25 + + + 300 + VAT + 2500 + S + 12 + + + + + false + + 10 + 0 + 0 + 95 + Loyal customer + + VAT + S + 25 + + + + + true + + 10 + 0 + 0 + ABL + Packaging + + VAT + S + 25 + + + + + + 20180307 + + + + 4000 + 0 + 0 + 4000 + 675 + 4675 + 4675 + + + + + + + + + + SE-R-004 + + + + + + urn:fdc:peppol.eu:2017:poacc:billing:01:1.0 + + + urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0 + + + + + 2018210 + 380 + + 20180208 + + + + + + + + 1 + + + Printing paper + + + + 1 + + + + 1000 + + + + VAT + S + 25 + + + 1000 + + + + + + + 2 + + + Parker Pen + + + + 5 + + + + 100 + + + + VAT + S + 25 + + + 500 + + + + + + + 3 + + + Eraser P-97 + + + + 5 + + + + 500 + + + + VAT + S + 12 + + + 2500 + + + + + + Ref 123 + + Allsälj AB + + 2021005480 + + + SE + + + 2021005489 + + + SE123456789001 + + + + + Buyercompany ltd + + DK + + + 2021005489 + + + + + + + + 08/00355 + SEK + + + 30 + + 123456 + + + BANKSBIC + + + + 30 + + 1234567 + + + SE:BANKGIRO + + + + 30 + + 12345 + + + SE:PLUSGIRO + + + + + 375 + VAT + 1500 + S + 25 + + + 300 + VAT + 2500 + S + 12 + + + + + false + + 10 + 0 + 0 + 95 + Loyal customer + + VAT + S + 25 + + + + + true + + 10 + 0 + 0 + ABL + Packaging + + VAT + S + 25 + + + + + + 20180307 + + + + 4000 + 0 + 0 + 4000 + 675 + 4675 + 4675 + + + + + + + + + From 539fc6257378347d49b2ea627b646c2a163f7975 Mon Sep 17 00:00:00 2001 From: Martin Forsberg Date: Sun, 11 Feb 2024 10:42:08 +0100 Subject: [PATCH 4/4] Added rule reference and updated release notes --- guide/release-notes/v3.0.17.adoc | 1 + structure/syntax/part/supplier-party.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/guide/release-notes/v3.0.17.adoc b/guide/release-notes/v3.0.17.adoc index 7e38e4c5..1706ca88 100644 --- a/guide/release-notes/v3.0.17.adoc +++ b/guide/release-notes/v3.0.17.adoc @@ -7,5 +7,6 @@ Release date:: May 2024 == Changes to code lists and validation artefacts +* Added new Swedish rule (SE-R-013) for validation of the check number of a Swedish Organization number. The rule is introduced as severity warning. All rules which verifies the format of Organization numbers (SE-R-003, SE-R-004 and SE-R-013) will be changed to severity fatal in next release. == EN 16931 schematrons updated diff --git a/structure/syntax/part/supplier-party.xml b/structure/syntax/part/supplier-party.xml index 2412656c..793e4157 100644 --- a/structure/syntax/part/supplier-party.xml +++ b/structure/syntax/part/supplier-party.xml @@ -300,6 +300,7 @@ DK-R-014 SE-R-003 SE-R-004 + SE-R-013 schemeID Seller legal registration identifier identification scheme identifier