Invoices according to ZUGFeRD Standard (XRechnung)

E-invoices with ZUGFeRD

Product line

Standard

|

Expert

Operating mode

Cloud Suite

|

ON-PREMISES

Modules

Services & CRM

Budget & Phases

Purchases

Resource Planning

Business Intelligence

Created: 04.09.2019
Machine translated
Updated: 29.01.2025 | Section “Conditions” added.

As of Vertec version 6.3.0.12 the Invoice with list of services contains a ZUGFeRD example implementation, which generates metadata according to the ZUGFeRD standard in the PDF. In order to be able to create valid ZUGFeRD invoices, certain criteria must be met. These are described below.

To set up e-invoices in Vertec in general, you can instead use the Additional Feature E-Invoice Templates, with which you can define e-invoices (ZUGfERD and XRechnungen) and define content criteria (also per invoice recipient).

ZUGFeRD example implementation

The example implementation uses the profile EN 16931. In order to be able to create valid ZUGFeRD invoices, the following criteria must be observed or fulfilled:

  1. In the system settings, your company (invoice issuer) must be defined.
  2. The addresses (invoice issuer and payee) must include the following information:
    1. Full and valid address (address).
    2. Country as 2-digit ISO country code (see e.g. https://de.wikipedia.org/wiki/ISO-3166-1-Kodierliste).
    3. The company’s VAT number (VAT number) must be entered on the More Info page.
  3. The currency must have a rounding set to 0.01, otherwise there will be rounding errors.
  4. Only one currency can be used per invoice.
  5. Downpayments are passed as items such as services, expenses and outlays.
  6. Fix 380 (commercial invoice) is used as invoice type.
  7. The Vat types used must include as code the tax category according to UNCL5305:
  • S = VAT is charged at standard rate
  • Z = goods to be taxed at zero rate
  • E = tax-exempt
  • AE = Reversal of Liability
  • AA = Reduced tax rate
  • K = no indication of VAT in the case of intra-Community supplies
  • G = Tax not collected due to export outside the EU
  • O = outside the scope of taxation

E-invoices according to ZUGFeRD Standard

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 Report 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 :

  • profilename : Name of the Zugferd profile. This must be either the name of a built-in profile (see next section) or a schema definition must be returned as the 3rd argument. Otherwise, the report reports an error on execution.
  • data : ZUGFeRD XML Data. The XML document that represents the ZUGFeRD data for the invoice.
  • schema: Optional. For non-built profiles, an XML data string can be optionally passed here, which defines the schema of the profile to be used.
    • As of Vertec 6.4.0.16, instead of the user-defined XMP structure, a version number can be specified as a string for schema. Valid values are:
      • 2.0.1 (default value)
      • 2.1.1
      Together with the specification of the profile (“profilename”), Vertec creates the appropriate XMP schema of the corresponding ZUGFeRD version. If the version specification is missing, the default value is 2.0.1. This is only relevant for built-in profiles. It is still possible to pass a user-defined XMP schema instead of the version specification.

The following ZUGFeRD profiles are supported as built-in profiles:

  • EXTENDED
  • EN 16931 (COMFORT, XRechnung)
  • BASIC
  • BASIC WL
  • MINIMUM

The supplied standard report invoice with list of services contains a corresponding example code for the profile EN 16931.

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.

Implementation with built-in schema

def metadata_zugferd(context):

First, the template is created. The XML is created with Vertec’s built-in template engine in Python. This allows the XML to use variables that contain the numbers from Vertec. 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 as well as the finished XML, which is integrated into the PDF by the report 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")

Implementation with no built-in schema

def metadata_zugferd(context):

First, the template is created. The XML is created with Vertec’s built-in template engine in Python. This allows the XML to use variables that contain the numbers from Vertec. 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)

Further information about ZUGFeRD can be found on the official FeRD website.