Migrate ZUGFeRD, PEPPOL BIS 3.0 DE, Factur-X FR and Peppol BIS 3.0 FR to the V2 draft import pipeline - #9792
Open
Groenbech96 wants to merge 4 commits into
Open
Migrate ZUGFeRD, PEPPOL BIS 3.0 DE, Factur-X FR and Peppol BIS 3.0 FR to the V2 draft import pipeline#9792Groenbech96 wants to merge 4 commits into
Groenbech96 wants to merge 4 commits into
Conversation
… the V2 draft import pipeline The German ZUGFeRD and PEPPOL BIS 3.0 DE formats and the French Factur-X and Peppol BIS 3.0 FR formats only supported the legacy V1 single-step import, so customers using them could not use the V2 draft experience. Core: - Add codeunit "E-Document CII Handler" (public) implementing IStructuredFormatReader for UN/CEFACT Cross Industry Invoice, shared by ZUGFeRD and Factur-X. It accepts either the plain CII XML or the PDF/A-3 container that embeds it. - Add codeunit "E-Doc. Hybrid PDF Handler" implementing IStructureReceivedEDocument and IStructuredDataType. It lifts the embedded e-invoice XML out of a PDF/A-3 container and falls back to MLLM extraction for plain PDFs, which is now the preferred structuring implementation for the PDF file format. - Add "E-Document Purchase Header"."Buyer Reference", populated from PEPPOL cbc:BuyerReference and CII ram:BuyerReference, and carry it to Purchase Header "Your Reference" when the draft is finished. - Make "E-Document PEPPOL Handler" public so localized apps can reuse it. DE and FR apps: - Add IStructuredFormatReader implementations and "E-Doc. Read into Draft" enum values for ZUGFeRD, PEPPOL BIS 3.0 DE, Factur-X FR and Peppol BIS 3.0 FR, and default the service "Read into Draft Impl." when the document format is selected. Tests: - Add structured import tests and CII/UBL test resources for all four formats. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Reworks the migration of ZUGFeRD, PEPPOL BIS 3.0 DE, Factur-X FR and Peppol BIS 3.0 FR so that E-Document Core is not touched at all. - The CII (UN/CEFACT Cross Industry Invoice) reading and the PDF/A-3 extraction now live in "E-Document ZUGFeRD Handler" (DE) and "E-Document Factur-X Handler" (FR). Each implements IStructuredFormatReader plus IStructureReceivedEDocument/IStructuredDataType and is registered through localization enum extensions of "E-Doc. Read into Draft" and "Structure Received E-Doc.". - "E-Doc. Peppol BIS 3.0 FR Hdlr" implements the UBL reader in the FR app instead of relying on the core PEPPOL reader. - The buyer reference (Leitweg-ID) is stored in a DE table extension field on "E-Document Purchase Header" instead of a new core field. - Removes the core CII handler, the core hybrid PDF structuring, the core "Buyer Reference" field, the PDF file format default change and the core test updates. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ad the data storage blob without the internal helper Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
The German ZUGFeRD and PEPPOL BIS 3.0 DE formats and the French Factur-X FR and Peppol BIS 3.0 FR formats had not been migrated to the V2 (draft) inbound import pipeline - they only implemented the legacy V1
GetBasicInfoFromReceivedDocument/GetCompleteInfoFromReceivedDocumentpath. Customers using them could not use Read into Draft -> Prepare draft -> Finish draft, the independently reversible stages, or Copilot-assisted line and G/L account matching.E-Document Core is not touched by this PR. Everything lives in the localization apps.
E-Document for Germany
E-Document ZUGFeRD HandlerimplementsIStructuredFormatReader(CII parsing) andIStructureReceivedEDocument/IStructuredDataType(lifting the embedded CII XML out of the ZUGFeRD PDF/A-3 container). It accepts either the PDF/A-3 file or plain CII XML."E-Doc. Read into Draft"::ZUGFeRDand"Structure Received E-Doc."::ZUGFeRD.E-Doc. PEPPOL BIS 3.0 DE Hdlr+"E-Doc. Read into Draft"::"PEPPOL BIS 3.0 DE", reusing the existing DE XRechnung UBL reader since both are CIUS of PEPPOL BIS Billing 3.0.BuyerReference/ Leitweg-ID handling that only existed in the V1 path is carried across into a DE table extension field"Buyer Reference DE"onE-Document Purchase Header, populated by both DE readers. The V2 draft pages are markedExtensible = false, so the value is stored but not surfaced in the UI yet.Read into Draft Impl.accordingly.E-Reporting FR
E-Document Factur-X Handler- same CII + PDF/A-3 design as ZUGFeRD, with"E-Doc. Read into Draft"::"Factur-X FR"and"Structure Received E-Doc."::"Factur-X FR".E-Doc. Peppol BIS 3.0 FR Hdlr- UBL reader for invoices and credit notes with"E-Doc. Read into Draft"::"Peppol BIS 3.0 FR". The French party identifiers thatInjectFrenchElementswrites on export (SIRET incac:PartyIdentification,cbc:EndpointID) are mapped back on import.Read into Draft Impl..Linked work
AB#644275, AB#644276, AB#644277, AB#644278
How I validated this
What I tested and the outcome
E-Doc. DE Struct. Import Testsruns the real import pipeline for ZUGFeRD (invoice, credit memo, unsupported root element, re-run idempotency) and PEPPOL BIS 3.0 DE (invoice incl. Leitweg-ID), with new CII and UBL test resources.E-Doc. FR Struct. Import Testscovers Factur-X (invoice, credit memo, unsupported root element, re-run idempotency) and Peppol BIS 3.0 FR (invoice incl. SIRET mapping, unsupported root element) by calling the readers directly, so the FR test app needs no new dependencies on core internals.Risk & compatibility
Already Structuredand the serviceDraft Format. When they arrive as a PDF/A-3 file,Structure Data Impl.has to point at the new localization structuring value; the readers also accept the PDF blob directly as a fallback.Your Referenceis not included: V2 Finish Draft has no extension point for it today, and adding one would mean changing core.