Method AbstractEinvoice():toZugferd() Professional

Creates a ZUGFeRD XML document.

Syntax
:toZugferd( [<cProfile>] ) --> cXml
Parameters
<cProfile>
The ZUGFeRD profile to use. The supported values are "EN16931" and "XRECHNUNG". The "XRECHNUNG" profile also performs the checks of the German CIUS, like :toXRechnung(). This defaults to "EN16931".
Return

A string with the ZUGFeRD XML document.

Description

Serializes the invoice into a ZUGFeRD 2.x or Factur-X document in CII syntax. This XML document is intended to be embedded into a PDF/A-3 file to create a hybrid invoice.

Before the document is created, the method calls :validate() and performs the checks which are specific to the selected ZUGFeRD profile. If any errors remain, a runtime error is raised which lists all errors. Therefore, :validate() should be called first to determine whether the invoice can be serialized.

The warnings found during the checks can be retrieved via :getLastWarnings().

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.