e-Invoices with ZUGFeRD
The Invoice with list of services (as of Vertec 6.3.0.12), the Invoice with processing sums invoice and the Invoice with phase sums (invoice of Vertec 6.8.0.12) contain a ZUGFeRD implementation, which embeds metadata in the PDF according to the ZUGFeRD standard. Thus, any invoice that is based on one invoice of these templates and is generated as a PDF is automatically also an e-invoice.
For more specific applications, if you have to meet requirements on the recipient side, you can use the Additional Feature E-Invoice Templates, with which you can define e-invoices e-invoicesZUGfERD and XRechnungen) in detail and define content criteria for each invoice recipient.
The ZUGFeRD implementation in the supplied invoice templates uses the profile EN 16931 and the following criteria:
Invoicing agent |
The invoicing agent shall be the
|
Invoice recipient |
The invoice address shall be the invoice address (InvoiceAddress) of the invoice. |
Invoice type |
Fix 380 (commercial invoice) is used as invoice type. |
Addresses |
The addresses (invoice issuer and invoice recipient) must include the following information:
If the country of the invoice recipient is empty, the country of the invoice issuer is also used for the invoice recipient, since we then assume that the invoice recipient is located in the country. |
Currency |
Only one currency can be used per invoice at a time. On the currency, rounding should be set to 0.01, otherwise rounding errors may occur, which are rejected by ZUGFeRD. |
Services
|
Services, expenses and outlays are summed up and handed over as individual items. Discounts are simply deducted from the services. |
downpayments |
Downpayments are transferred as items such as services, expenses and outlays. |
VAT |
VAT types used must indicate the appropriate Tax category according to uncl5305. |
If these requirements are met, 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.
For this purpose, the Office reports provide the method
metadata_zugferd(context)
This returns a tuple consisting of :
Customers who want 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 using Vertec’s built-in template engine in Python. This allows the XML to use variables that contain the numbers from Vertec. Use the method vtcapp.rendertemplate() the XML is then created.
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 as well as the finished XML, which is integrated into the PDF by the reporting mechanism.
As ZUGFeRD 2.0 (standard):
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 using Vertec’s built-in template engine in Python. This allows the XML to use variables that contain the numbers from Vertec. Use the method vtcapp.rendertemplate() the XML is then created.
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 reporting mechanism.
return ("", zugferdxml, Schema)More information about ZUGFeRD can be found on the official FeRD website.