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

Small hack to allow factur-x.py to work with ZUGFeRD 2.2 reference profile XRECHNUNG #40

Open
andras63 opened this issue Apr 17, 2024 · 5 comments

Comments

@andras63
Copy link

I needed a simple way to create ZUGFeRD 2.2 / Factur-X 1.0.6 compliant German XRECHNUNG reference profile PDFs.

Our accounting application creates and validates compliant CII (NOT UBL) xrechnung.xml files (current version 3.0.1)
Validation is done through KOSIT validator, so all I needed was a way to integrate this into a valid PDFA-3B file also
created by our application. Since I use facturx-pdfgen for all my other ZUGFeRD invoices it was the easiest solution to
integrate it the xrechnung profile into factur-x.py.
Attached is a small diff that acomplishes this. Note that there is no validation against German national KOSIT business rules
(already done before), but an additional EN16931 syntax check is done against the COMFORT xsd.

The generated hybrid PDFs validate 100 % OK against the ZUGFeRD community validator. The fnfe-mpe.org validator lacks
support for XRECHNUNG and there rejects the profile, but also validates the components.

Maybe someone finds this helpful and you can integrate this .

facturx-xrechnung.patch

@alexis-via
Copy link
Member

Could someone explain me the difference between Xrechnung and ZUGFeRD/Factur-X ? I'm french and I not very familiar with these German things.

@andras63
Copy link
Author

XRechnung is the official German government standard for electronic invoicing for public clients. It is the initial solution for the implementation of the EU Directive 2014/55/EU in Germany and has introduced as mandatory for the exchange of electronic invoices from and with German administrations. It is implemented as pure EN 16931-1 syntax CII D16B xml file format. While syntactically almost identical to Factur-X comfort profile, it uses a different codelist subset and additional business rules, but still can be syntactically verified with the factur-x EN 16931 schematron files.
While originally designed as pure XML file uploadable to the official German Government e-invoicing portal, all official German Government portals now also accept ZUGFeRD 2.2 invoices which embed the xrechnung.xml file with the XRECHNUNG reference profile 2.1 (Some portals also allow standard FACTUR-X with embedded EN 16931 factur-x.xml, but not all).
The reference profile is described in chapter 7.7 of official factur-x documentation (also in the French version) downloadable downloadable from fnfe-me.org. The current xrechnung.xml specification can always be download from the KoSIT (IT coordination organization working for the German Government).
So factically, to create compliant factur-x XRECHUNG reference profile invoices, only some minor adjustments to the PDF tags are necessary. That is what my patch implements.

@j-moser-sap
Copy link

@andras63 Would you mind opening a PR with your patch? Then maybe we can collaborate with @alexis-via on getting this merged into the main factur-x library.

(I am currently also in a position where I'd really like factur-x to also be able to extract XRechnung files)

Thanks in advance for your time!

@hh-it-co
Copy link

hh-it-co commented Oct 3, 2024

+1

@mooose
Copy link

mooose commented Oct 3, 2024 via email

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

5 participants