itplr-kosit / validator-configuration-xrechnung

Configuration for validating documents against the German XRechnung standard using the KoSIT validation tool
https://xeinkauf.de/xrechnung/
Apache License 2.0
62 stars 17 forks source link

PEPPOL-EN16931-R001 Business process MUST be provided. AND [BR-DE-21] "Specification identifier" (BT-24) #93

Closed Zero-create1 closed 3 months ago

Zero-create1 commented 3 months ago

Hello, I'm trying to recreate the warning that I have on other validation sites, but they don't appear.

I get this warning on a site that also uses Kosit: Screenshot 2024-08-08 141617

But I don't get a warning when validating the same file in CLI with "validationtool-1.5.0-standalone.jar" and "validator-configuration-xrechnung_3.0.2_2024-06-20".

Please help.

bdewein commented 3 months ago

Hi @Zero-create1 , as KoSIT is not involved in external implementations of our validator and validator configuration for XRechnung, we need more information to assist you on the issue. Can you provide the (anonymised) invoice and, if possible, the validation report in xml?

Zero-create1 commented 3 months ago

Hello @bdewein, for example, when validating ErrorTest.xml I get the report that everything is fine:

Screenshot 2024-08-12 115105 - Kopie

But when validating it on https://erechnungsvalidator.service-bw.de/ I get 8 warnings and 1 error. I can't upload XML Files so here is the txt:

ErrorTest.txt

phax commented 3 months ago

@Zero-create1 short site note: the validator you mentioned uses XRechnung 3.0.1 configuration:

Validator Konfiguration für XRechnung 3.0.1 für die Universal Business Language (UBL) und UN/CEFACT Invoice und CreditNote Dokumente mit EN16931:2017, genauer:

That might also be an issue... Btw. when I validate it, I get 1 error and 5 warnings:

        {
            "success": "FALSE",
            "artifactType": "schematron-xslt",
            "artifactPathType": "classpath",
            "artifactPath": "/external/schematron/3.0.2/XRechnung-CII-validation.xslt",
            "items": [
                {
                    "errorLevel": "WARN",
                    "errorID": "PEPPOL-EN16931-R001",
                    "errorFieldName": "/rsm:CrossIndustryInvoice[1]/rsm:ExchangedDocumentContext[1]",
                    "errorLocationObj": {
                        "resource": "uploaded content"
                    },
                    "test": "ram:BusinessProcessSpecifiedDocumentContextParameter/ram:ID",
                    "errorText": "Business process MUST be provided."
                },
                {
                    "errorLevel": "WARN",
                    "errorID": "PEPPOL-EN16931-R020",
                    "errorFieldName": "/rsm:CrossIndustryInvoice[1]/rsm:SupplyChainTradeTransaction[1]/ram:ApplicableHeaderTradeAgreement[1]/ram:SellerTradeParty[1]",
                    "errorLocationObj": {
                        "resource": "uploaded content"
                    },
                    "test": "ram:URIUniversalCommunication/ram:URIID",
                    "errorText": "Seller electronic address MUST be provided"
                },
                {
                    "errorLevel": "WARN",
                    "errorID": "PEPPOL-EN16931-R010",
                    "errorFieldName": "/rsm:CrossIndustryInvoice[1]/rsm:SupplyChainTradeTransaction[1]/ram:ApplicableHeaderTradeAgreement[1]/ram:BuyerTradeParty[1]",
                    "errorLocationObj": {
                        "resource": "uploaded content"
                    },
                    "test": "ram:URIUniversalCommunication/ram:URIID",
                    "errorText": "Buyer electronic address MUST be provided"
                },
                {
                    "errorLevel": "WARN",
                    "errorID": "PEPPOL-EN16931-R008",
                    "errorFieldName": "/rsm:CrossIndustryInvoice[1]/rsm:SupplyChainTradeTransaction[1]/ram:IncludedSupplyChainTradeLineItem[3]/ram:SpecifiedTradeProduct[1]/ram:Description[1]",
                    "errorLocationObj": {
                        "resource": "uploaded content"
                    },
                    "test": "false()",
                    "errorText": "Document MUST not contain empty elements."
                },
                {
                    "errorLevel": "WARN",
                    "errorID": "BR-DE-21",
                    "errorFieldName": "/rsm:CrossIndustryInvoice[1]/rsm:ExchangedDocumentContext[1]",
                    "errorLocationObj": {
                        "resource": "uploaded content"
                    },
                    "test": "ram:GuidelineSpecifiedDocumentContextParameter/ram:ID = $XR-CIUS-ID or ram:GuidelineSpecifiedDocumentContextParameter/ram:ID = $XR-EXTENSION-ID",
                    "errorText": "[BR-DE-21] Das Element \"Specification identifier\" (BT-24) soll syntaktisch der Kennung des Standards XRechnung entsprechen."
                },
                {
                    "errorLevel": "ERROR",
                    "errorID": "BR-DE-2",
                    "errorFieldName": "/rsm:CrossIndustryInvoice[1]/rsm:SupplyChainTradeTransaction[1]/ram:ApplicableHeaderTradeAgreement[1]/ram:SellerTradeParty[1]",
                    "errorLocationObj": {
                        "resource": "uploaded content"
                    },
                    "test": "ram:DefinedTradeContact",
                    "errorText": "[BR-DE-2] Die Gruppe \"SELLER CONTACT\" (BG-6) muss übermittelt werden."
                }
            ]
        }
bdewein commented 3 months ago

Thanks @phax for clarifying.

@Zero-create1 by using urn:cen.eu:en16931:2017 as the specification identifier (BT-24) in your example invoice, you are declaring conformity with the EN 16931 (not with XRechnung, which is based on the EN 16931) and the validator-configuration-xrechnung is validating against CEN Schematron rules, only, disregarding XRechnung Schematron rules. Exchange the specification identifier with urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0 and the validation scenario for CIUS XRechnung will be used, resulting in BR-DE-2 error and several warnings on PEPPOL-EN16931-rules (please note that the severity level of these rules will be raised to error, soon).

Zero-create1 commented 3 months ago

Hi, it actually works then, thank you both very much. ☻ I didn't quite understand what the difference between CEN Schematron and XRechnung Schematron is. But can I then configure the validator in a way, that it always looks at the XRechnung Schematron rules? So that even if my document doesn't have the identifier #compliant#urn:xeinkauf.de:kosit:xrechnung_3.0, it will still tell me that the identifier is missing and show the other errors/warnings as well?

lkumai commented 3 months ago

Hi @Zero-create1, theoretically you can edit the scenarios.xml, so it will use the XRechnung rules instead of the CEN rules. You have to remove the CEN scenarios (for CII ll. 434) and have to edit the match of the XRechnung scenarios (for CII l. 233), but I think it would be much better to use the XRechnung specification identifier instead.

Zero-create1 commented 3 months ago

Hi, thank you all for your help. My main problem has been fixed. I will close the issue. Thanks again. ☻