Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zugferd importer does not recognize XRechnung Zugferd Profile #395

Closed
Sarenor opened this issue Jun 24, 2024 · 2 comments
Closed

Zugferd importer does not recognize XRechnung Zugferd Profile #395

Sarenor opened this issue Jun 24, 2024 · 2 comments

Comments

@Sarenor
Copy link
Contributor

Sarenor commented Jun 24, 2024

A PDF with an embedded XRechnung like this

<ram:GuidelineSpecifiedDocumentContextParameter>
    <ram:ID>urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0</ram:ID>
</ram:GuidelineSpecifiedDocumentContextParameter>

is recognized as a valid Zugferd Document, but no Profile could be found for it.
Would it make sense to change the getZugferdProfile() method in the ZUGFeRDImporter.java

    public String getZUGFeRDProfil() {
        switch (this.extractString("//*[local-name() = 'GuidelineSpecifiedDocumentContextParameter']//*[local-name() = 'ID']")) {
            case "urn:cen.eu:en16931:2017":
            case "urn:ferd:CrossIndustryDocument:invoice:1p0:comfort":
                return "COMFORT";
            case "urn:cen.eu:en16931:2017#compliant#urn:factur-x.eu:1p0:basic":
            case "urn:ferd:CrossIndustryDocument:invoice:1p0:basic":
                return "BASIC";
            case "urn:factur-x.eu:1p0:basicwl":
                return "BASIC WL";
            case "urn:factur-x.eu:1p0:minimum":
                return "MINIMUM";
            case "urn:ferd:CrossIndustryDocument:invoice:1p0:extended":
            case "urn:cen.eu:en16931:2017#conformant#urn:factur-x.eu:1p0:extended":
                return "EXTENDED";
            // new addition
            case "urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0":
                return "XRECHNUNG";
            default:
                return "";
        }
    }

Or would it be better to fold this into EXTENDED?

@jstaerk
Copy link
Collaborator

jstaerk commented Jun 27, 2024

sounds like a very good idea👍, actually it would be sufficient to scan for "xrechnung" in the guideline ID to return XRechnung, no need to restrict to version 3...

@Sarenor
Copy link
Contributor Author

Sarenor commented Jun 27, 2024

That would mean breaking up the switch, probably, but that's fine. I'll try to send in a PR later today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants