Skip to content

[Invoices]: Implement UblHandler XML generation (generic UBL 2.1/2.4) #776

Description

@nielsdrost7

Context

Sub-story of #767. PeppolBisHandler::generateXml() now generates real UBL 2.1 / PEPPOL BIS 3.0 XML via num-num/ubl-invoice (see #767's resolution). UblHandler (generic UBL 2.1/2.4, non-Peppol-BIS-specific) still throws RuntimeException('... not yet implemented ...').

Recommended package

num-num/ubl-invoice — already a dependency (installed for #767's default format, no new package needed).

Scope

Implement UblHandler::generateXml() using the same library and object graph already proven in PeppolBisHandler::generateXml(), minus the Peppol-specific customization ID / profile ID / mandatory endpoint scheme. This should be close to a straight copy with those Peppol-only fields dropped or made optional.

Acceptance criteria

  • UblHandler::generateXml() returns real, well-formed UBL 2.1 XML (no placeholder JSON, no RuntimeException)
  • Output passes PeppolXmlValidator
  • Unit test asserts DOMDocument well-formedness and key XPath fields (ID, IssueDate, lines, totals), following the pattern in PeppolBisHandlerTest
  • FormatHandlersTest's existing "throws for unimplemented formats" test is updated to drop UBL from the unimplemented list

Sequencing note

Lowest-effort of the remaining 8 sub-stories — same library already installed, same object API already working in this codebase. See #767 for full package-research context across all 9 formats.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    refinedRefined with SMART plan / test suggestions

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions