Codeunit 13917 "Export ZUGFeRD Document" (DE)
DE country layer · Microsoft.eServices.EDocument.Formats
Across versions
- BC23-28not present
- BC29-30present
DE country layer · Microsoft.eServices.EDocument.Formats · BC29-30 · source at 4e6a307c · facts from BC29
An object of the DE localization, not part of W1.
Properties
| Property | Value |
|---|---|
| TableNo | Record Export Buffer |
Events published
OnIsZUGFeRDPrintProcess(var Result: Boolean)(internal)OnAfterFindEDocumentService(var EDocumentService: Record "E-Document Service")(integration, obsolete 30.0)OnAfterInsertSalesInvHeaderData(var XMLCurrNode: XmlElement; SalesInvoiceHeader: Record "Sales Invoice Header")(integration)OnCreateXMLOnBeforeSalesInvXmlDocumentWriteToFile(var XMLDoc: XmlDocument; SalesInvoiceHeader: Record "Sales Invoice Header")(integration)OnDocumentLinesExistOnAfterFilterSalesInvLine(var SalesInvoiceHeader: Record "Sales Invoice Header"; var SalesInvLine: Record "Sales Invoice Line")(integration)OnAfterInsertSalesCrMemoHeaderData(var XMLCurrNode: XmlElement; SalesCrMemoHeader: Record "Sales Cr.Memo Header")(integration)OnCreateXMLOnBeforeSalesCrMemoXmlDocumentWriteToFile(var XMLDoc: XmlDocument; SalesCrMemoHeader: Record "Sales Cr.Memo Header")(integration)OnDocumentLinesExistOnAfterFilterSalesCrMemoLine(var SalesCrMemoHeader: Record "Sales Cr.Memo Header"; var SalesCrMemoLine: Record "Sales Cr.Memo Line")(integration)OnAfterCalculateInvoiceLineAmounts(var SalesInvoiceHeader: Record "Sales Invoice Header"; var SalesInvLine: Record "Sales Invoice Line"; Currency: Record Currency; var LineAmounts: Dictionary of [Text, Decimal])(integration)OnAfterCalculateCrMemoLineAmounts(var SalesCrMemoHeader: Record "Sales Cr.Memo Header"; var SalesCrMemoLine: Record "Sales Cr.Memo Line"; Currency: Record Currency; var LineAmounts: Dictionary of [Text, Decimal])(integration)OnBeforeGenerateSalesInvoicePDFAttachment(SalesInvoiceHeader: Record "Sales Invoice Header"; var TempBlob: Codeunit "Temp Blob"; var IsHandled: Boolean)(integration)OnBeforeGenerateSalesCrMemoPDFAttachment(SalesCrMemoHeader: Record "Sales Cr.Memo Header"; var TempBlob: Codeunit "Temp Blob"; var IsHandled: Boolean)(integration)OnBeforeGenerateServiceInvoicePDFAttachment(ServiceInvoiceHeader: Record "Service Invoice Header"; var TempBlob: Codeunit "Temp Blob"; var IsHandled: Boolean)(integration)OnBeforeGenerateServiceCrMemoPDFAttachment(ServiceCrMemoHeader: Record "Service Cr.Memo Header"; var TempBlob: Codeunit "Temp Blob"; var IsHandled: Boolean)(integration)OnAfterGetSetups(var CompanyInformation: Record "Company Information"; var GeneralLedgerSetup: Record "General Ledger Setup")(integration)OnBeforeInsertInvoiceLine(var SupplyChainTradeTransactionElement: XmlElement; var SalesInvoiceLine: Record "Sales Invoice Line"; Currency: Record Currency; CurrencyCode: Code[10]; PricesIncVAT: Boolean; var IsHandled: Boolean)(integration)OnBeforeAddInvoiceLineElement(var InvoiceLineElement: XmlElement; var SalesInvoiceLine: Record "Sales Invoice Line"; Currency: Record Currency; CurrencyCode: Code[10]; PricesIncVAT: Boolean)(integration)OnBeforeInsertCrMemoLine(var SupplyChainTradeTransactionElement: XmlElement; var SalesCrMemoLine: Record "Sales Cr.Memo Line"; Currency: Record Currency; CurrencyCode: Code[10]; PricesIncVAT: Boolean; var IsHandled: Boolean)(integration)OnBeforeAddCrMemoLineElement(var CrMemoLineElement: XmlElement; var SalesCrMemoLine: Record "Sales Cr.Memo Line"; Currency: Record Currency; CurrencyCode: Code[10]; PricesIncVAT: Boolean)(integration)OnAfterInsertApplicableHeaderTradeAgreement(var HeaderTradeAgreementElement: XmlElement; HeaderRecordRef: RecordRef)(integration)OnInsertPaymentMethodOnBeforeAddToRoot(var PaymentMethodElement: XmlElement; HeaderRecRef: RecordRef)(integration): Fires immediately before the generated payment means element is added to the document root. Subscribe to inspect or extend the payment block, using HeaderRecRef to access any field of the source document.
Procedures
IsZUGFeRDPrintProcess(): Boolean: Use this procedure to check if the current report print is for the ZUGFeRD export.CreateAndAddXMLAttachmentToRenderingPayload(var SalesInvoiceHeader: Record "Sales Invoice Header"; var RenderingPayload: JsonObject): Creates a ZUGFeRD XML document from the sales invoice and adds it as an attachment to the rendering payload.CreateAndAddXMLAttachmentToRenderingPayload(var SalesCrMemoHeader: Record "Sales Cr.Memo Header"; var RenderingPayload: JsonObject): Creates a ZUGFeRD XML document from the sales credit memo and adds it as an attachment to the rendering payload.CreateAndAddXMLAttachmentToRenderingPayload(var ServiceInvoiceHeader: Record "Service Invoice Header"; var RenderingPayload: JsonObject): Creates a ZUGFeRD XML document from the service invoice and adds it as an attachment to the rendering payload.CreateAndAddXMLAttachmentToRenderingPayload(var ServiceCrMemoHeader: Record "Service Cr.Memo Header"; var RenderingPayload: JsonObject): Creates a ZUGFeRD XML document from the service credit memo and adds it as an attachment to the rendering payload.ExportSalesDocument(var RecordExportBuffer: Record "Record Export Buffer")GenerateSalesInvoicePDFAttachment(SalesInvoiceHeader: Record "Sales Invoice Header"; var TempBlob: Codeunit "Temp Blob"): BooleanGenerateSalesCrMemoPDFAttachment(SalesCrMemoHeader: Record "Sales Cr.Memo Header"; var TempBlob: Codeunit "Temp Blob"): BooleanGenerateServiceInvoicePDFAttachment(ServiceInvoiceHeader: Record "Service Invoice Header"; var TempBlob: Codeunit "Temp Blob"): BooleanGenerateServiceCrMemoPDFAttachment(ServiceCrMemoHeader: Record "Service Cr.Memo Header"; var TempBlob: Codeunit "Temp Blob"): BooleanCreateXML(SalesInvoiceHeader: Record "Sales Invoice Header"; var FileOutstream: Outstream)CreateXML(SalesCrMemoHeader: Record "Sales Cr.Memo Header"; var FileOutstream: Outstream)CreateXML(ServiceInvoiceHeader: Record "Service Invoice Header"; var FileOutstream: Outstream)CreateXML(ServiceCrMemoHeader: Record "Service Cr.Memo Header"; var FileOutstream: Outstream)InsertSupplyChainTradeTransaction(var RootXMLNode: XmlElement; SalesInvoiceHeader: Record "Sales Invoice Header"; var SalesInvoiceLine: Record "Sales Invoice Line"; CurrencyCode: Code[10]; Currency: Record Currency; var LineAmount: Dictionary of [Decimal, Decimal]; var LineVATAmount: Dictionary of [Decimal, Decimal]; var LineAmounts: Dictionary of [Text, Decimal]; var LineDiscAmount: Dictionary of [Decimal, Decimal])InsertSupplyChainTradeTransaction(var RootXMLNode: XmlElement; SalesCrMemoHeader: Record "Sales Cr.Memo Header"; var SalesCrMemoLine: Record "Sales Cr.Memo Line"; CurrencyCode: Code[10]; Currency: Record Currency; var LineAmount: Dictionary of [Decimal, Decimal]; var LineVATAmount: Dictionary of [Decimal, Decimal]; var LineAmounts: Dictionary of [Text, Decimal]; var LineDiscAmount: Dictionary of [Decimal, Decimal])FormatDate(VarDate: Date): Text[20]FormatDecimal(VarDecimal: Decimal): TextFormatDecimalUnlimited(VarDecimal: Decimal): TextFormatFourDecimal(VarDecimal: Decimal): Text(obsolete 29.0: FormatFourDecimal is no longer used internally. Quantity and unit price fields are now exported with unlimited precision per EN 16931. For VAT percentages, use FormatFiveDecimal. For quantity and unit price, use FormatDecimalUnlimited.)FormatFiveDecimal(VarDecimal: Decimal): TextGetUoMCode(UoMCode: Code[10]): TextGetVATRegistrationNo(VATRegistrationNo: Text[20]; CountryRegionCode: Code[10]): Text[30]SetEDocumentService(NewEDocumentService: Record "E-Document Service")
Plus 96 local procedures.
Triggers
OnRun
Recent changes
- 2026-11-27 #14500 Adding “Description 2” when available under ram:Description (main, BC30, fix)
- 2026-11-26 #14501 29.x: Adding “Description 2” when available under ram:Description (releases/29.x, BC29, feature)
- 2026-11-16 #14018 [29.X]-ZUGFeRD: Custom Ship-to Address is not transferred to XML Delivery Address in the German version. (releases/29.x, BC29, fix)
- 2026-10-29 #12691 Support customer registration number as e-document party identifier for DE (main, BC30, feature)
- 2026-10-06 #9347 Fix IssueDate in E-Documents for Germany (main, BC30, fix)
- 2026-10-02 #8429 E-Document DE: map Payment Method to PEPPOL payment means codes, add SEPA Direct Debit export support (main, BC30, feature)
- 2026-09-29 #9642 [Bug]: E-Documents for Germany - FindEDocumentService always selects last matching service, ignoring which service triggered the export (main, BC30, fix)
- 2026-09-05 #9860 [Bug]: [DE] XRechnung/ZUGFeRD - Item Charge lines exported without a valid unit of measure code (BR-CL-23 / BR-23 on BT-130) (main, BC30, fix)
- 2026-08-26 #10631 Integration/main to releases 29.x 31a860b5 (releases/29.x, BC29, feature)
- 2026-08-24 #10349 [DE] Support registration numbers in E-Documents (main, BC30, feature)
- 2026-08-20 #10342 Add GLN information to XRechnung and ZUGFeRD exports (main, BC30, feature)
- 2026-08-12 #10048 Add GTIN to XRechnung and ZUGFeRD exports (main, BC30, feature)
- 2026-08-12 #9878 Add buyer order reference to ZUGFeRD export (main, BC30, feature)
Deprecations
- procedure FormatFourDecimal: Pending 29.0 (#if not CLEAN29), “FormatFourDecimal is no longer used internally. Quantity and unit price fields are now exported with unlimited precision per EN 16931. For VAT percentages, use FormatFiveDecimal. For quantity and unit price, use FormatDecimalUnlimited.”
- procedure FindEDocumentService: Pending 30.0 (#if not CLEAN30), “The triggering E-Document Service is now provided through SetEDocumentService (threaded via “ZUGFeRD Export Context”). This function is still called on every export until CLEAN30: when a service was provided it only raises OnAfterFindEDocumentService without overwriting that service, otherwise it performs the legacy FindLast lookup. As of CLEAN30 this function and that fallback are removed, so any caller that does not provide a service - for example a customized sales report that never sets the ZUGFeRD Export Context - then exports with a blank E-Document Service.”
- procedure OnAfterFindEDocumentService: Pending 30.0 (#if not CLEAN30), “The triggering E-Document Service is now provided through SetEDocumentService (threaded via “ZUGFeRD Export Context”). This event is STILL raised on every export until CLEAN30 - both when a service was provided and on the legacy FindLast lookup path - so existing subscribers keep working during the deprecation window. It no longer exists as of CLEAN30; move any logic that depends on it to the service provided through SetEDocumentService.”
Source: AL metadata extracted from the code (names, ids, signatures, properties); no code bodies (D10).
Ask your agent
Procedure bodies are not stored here (D10). For a procedure body or the calls of one procedure, ask bc-code-atlas (external, by Stefan Maron, MIT; default corpus w1-28), which the bc-observatory plugin connects: bcatlas_resolve_node(object_type: "codeunit", object_name: "Export ZUGFeRD Document"), then bcatlas_get_procedure_body or bcatlas_get_neighbors on the returned id.
A DE country object, not part of W1: the default corpus does not have it; bcatlas_list_countries shows which countries the atlas has.