Generate Standard Business Document Header (SBDH) wrappers for UBL documents.
SBDH is used in Peppol networks for routing and identification of business documents.
Summary
Functions
Strip the StandardBusinessDocument/StandardBusinessDocumentHeader wrapper from UBL XML.
Wrap UBL XML content with an SBDH header.
Functions
Strip the StandardBusinessDocument/StandardBusinessDocumentHeader wrapper from UBL XML.
Some accounting software cannot process documents with SBDH wrappers. This function extracts the inner UBL document (Invoice, CreditNote, or ApplicationResponse).
If the XML is not wrapped in an SBDH, it is returned unchanged.
Example
sbdh_xml = UblEx.generate_with_sbdh(document_data)
plain_xml = UblEx.Generator.SBDH.strip(sbdh_xml)
Wrap UBL XML content with an SBDH header.
Parameters
ubl_xml- The UBL XML content to wrap (as string)document_data- Map containing::type- Document type (:invoice,:credit,:application_response):numberor:id- Document identifier:date- Document date:supplieror:sender- Map with:endpoint_idand:scheme:customeror:receiver- Map with:endpoint_idand:scheme:country- Optional country code (defaults from supplier/sender)
Example
ubl_xml = UblEx.generate(document_data)
sbdh_xml = UblEx.Generator.SBDH.wrap(ubl_xml, document_data)