E-invoices with ZUGFeRD
Product line
Standard
|Expert
Operating mode
CLOUD ABO
|ON-PREMISES
Modules
Services & CRM
Budget & Phases
Purchases
Resource Planning
Business Intelligence
With the additional feature E-Invoice Templates, necessary templates and scripts are implemented, with which e-invoices (ZUGfERD and XRechnungen) can be created at the push of a button. All information can be found in the corresponding Article .
With Vertec, E-Invoices can be created according to the Zugferd standard . For this purpose, the XML metadata is generated in the code of the Office Reports and passed to the report mechanism, which integrates the metadata into the PDF.
There is a method for this in the Office reports
metadata_zugferd(context)
This returns a tuple consisting of :
The following ZUGFeRD profiles are supported as built-in profiles:
The standard report invoice with list of services included includes a corresponding example code for the profile EN 16931.
Customers who wish to use their invoices according to the ZUGFeRD standard or as X-invoices must adapt this code according to the requirements of their invoice recipients.
def metadata_zugferd(context):
First, the template is created. The XML is created in Python with Vertec’s built-in Template Engine. In XML, variables containing the numbers from Vertec can be used. The XML is then created with the method vtcapp.rendertemplate() .
zugferd_template = u"""<?xml version="1.0" encoding="UTF-8"?> <rsm:CrossIndustryInvoice xmlns:a="urn:un:unece:uncefact:data:standard:QualifiedDataType:100"..> <rsm:ExchangedDocumentContext> <ram:GuidelineSpecifiedDocumentContextParameter> <ram:ID>urn:cen.eu:en16931:2017</ram:ID> </ram:GuidelineSpecifiedDocumentContextParameter> ...""" rechnung = context.rootlist[0] # Render the transferred template for ZUFGeRD zugferdxml = vtcapp.rendertemplate(zugferd_template, rechnung=rechnung)
The method returns the schema and the finished XML, which is integrated into the PDF by the report mechanism.
As ZUGFeRD 2.0 (default):
return ("EN 16931", zugferdxml)
As ZUGFeRD 2.1 (from version 6.4.0.16):
return ("EN 16931", zugferdxml, "2.1.1")
def metadata_zugferd(context):
First, the template is created. The XML is created in Python with Vertec’s built-in Template Engine. In XML, variables containing the numbers from Vertec can be used. The XML is then created with the method vtcapp.rendertemplate() .
zugferd_template = u"""<?xml version="1.0" encoding="UTF-8"?> <rsm:CrossIndustryInvoice xmlns:a="urn:un:unece:uncefact:data:standard:QualifiedDataType:100"..> <rsm:ExchangedDocumentContext> <ram:GuidelineSpecifiedDocumentContextParameter> <ram:ID>urn:cen.eu:en16931:2017</ram:ID> </ram:GuidelineSpecifiedDocumentContextParameter> ...""" rechnung = context.rootlist[0] # Render the transferred template for ZUFGeRD zugferdxml = vtcapp.rendertemplate(zugferd_template, rechnung=rechnung)
In addition, the schema is passed as XML:
schema = u"""<?xpacket begin="?" id="W5M0MpCehiHzreSzNTczkc9d"?> <x:xmpmeta xmlns:x="adobe:ns:meta/"> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:Description xmlns:pdfaid="http://www.aiim.org/pdfa/ns/id/" rdf:about=""> ..."""
The method returns the finished XML as well as the schema, which is integrated into the PDF by the report mechanism.
return ("", zugferdxml, Schema)
More information about ZUGFeRD can be found on the official FeRD website.