How to display the current and parent category in WordPress
Need to show the category hierarchy in your theme? Learn how to get the current category and its parent using get_the_category() and get_category_parents().
A PHP application that bills Danish public authorities has to send invoices as structured XML through Nemhandel, the common Danish e-invoicing infrastructure. I am Mariusz Szatkowski, a PHP developer in Gdynia who has built with WordPress since 2006 and works remotely and in writing. For a supplier in Aalborg that invoices a municipality, a region or a state body, the invoicing module has to produce the right document, carry the references the buyer gave, and reach the buyer through the network. The legal decisions stay with you and your accountant.

The west side of the Utzon Center in Aalborg. Photo by Liberaler Humanist, licensed CC BY-SA 3.0, via Wikimedia Commons.
Three layers apply in December 2026, all published on retsinformation.dk:
| Act | What it covers for a supplier |
|---|---|
| Order no. 206 of 11 March 2011 on electronic settlement with public authorities, as amended by order no. 1832 of 28 December 2023 | references on the invoice, electronic delivery, payment delay for faulty invoices |
| Order no. 354 of 26 March 2010 on information in and transport of OIOUBL electronic invoices, as amended by order no. 1831 of 28 December 2023 | OIOUBL as the public standard, the document types |
| Act no. 1764 of 28 December 2023 on common digital infrastructure (the Nemhandel act) and order no. 1811 of 2023 on networks for document exchange | Nemhandel and Peppol networks, network choice, logs at service providers |
The 2023 amendments took effect on 1 January 2024. Order no. 1832 repealed section 5(3), section 6(1) and section 7 of order no. 206, so the old rule that let an authority force suppliers into its own ordering system is gone, and the old section 6(2) and 6(3) are now section 6(1) and 6(2). Order no. 1831 repealed section 3(1) of order no. 354, which had tied transport to the OIO RASP standard. Transport now follows the Nemhandel act and order no. 1811.
The Nemhandel act defines public bodies broadly: state authorities, municipalities and regions, their organisations and companies, and institutions that get half or more of their running costs from public grants (section 2). Section 5 of the act says these bodies must use the common digital infrastructure for electronic documents and e-commerce wherever the infrastructure supports the use.
Order no. 206 splits the duty between buyer and supplier. Under section 3, an authority that places an order or requisition gives at least:
Section 4 then binds the supplier. The invoice must reference the EAN location number and the reference from points 1 and 2. The creditor may be only one CVR number. If the invoice covers only part of an order, requisition, invoice or credit note, it must say so.
For a PHP invoicing module this means the order record has to store the EAN location number and the buyer reference from the moment the order arrives, in dedicated fields. An invoice generated weeks later reads those fields back. A partial delivery needs a flag on the invoice that tells the authority the order is not closed.
Section 5(1) of order no. 206 requires invoices to public authorities to be sent so that they arrive electronically, in a format the authority can read and load directly into its invoice handling or finance system. A supplier that cannot send from its own system may fill in an invoice template. Section 5(2) says authorities must be able to receive invoices made under the OIOUBL order.
Section 6 sets the consequence. An authority may delay payment of an invoice that does not meet sections 4 and 5, and has to tell the supplier as soon as possible. Once it receives a compliant invoice, it should try to pay within the credit period originally set in days. For a supplier, a missing EAN number or reference costs time on the receivables side, which is why a hard validation step before sending pays off.
Order no. 354 makes OIOUBL the common public standard for electronic invoices and requires authorities to send and receive OIOUBL from 1 May 2011. Its annex names four document types for billing: invoice, credit note, reminder and business receipt (application response). The OIOUBL site of the Danish Business Authority adds that authorities must support two profiles: Procurement-BilSim, with invoice, credit note, reminder and application response, and NES Profile 5 Basic Billing, with invoice and credit note only. Where both parties support BilSim, BilSim applies. NES Profile 5 is meant for a supplier that cannot receive an application response. The same site states that OIOUBL 2.02 of September 2009 was updated to version 2.1 in May 2022.
Order no. 1811 of 2023, in force since 1 January 2024, describes the common digital infrastructure as two networks: Nemhandel and Peppol (section 3). It sets rules for each side:
Section 12 and 13 put logging duties on service providers, the access providers that carry documents for their customers. Their document log records the document type, network, role, time, success or failure with the error code, a unique document ID, signatures or hashes for integrity, the customer and the endpoint, and is kept for five years in line with the bookkeeping retention rule. A PHP system that sends through such a provider does not run that log itself, but it should store the document ID and the provider’s status response next to the invoice, so a dispute can be matched to the provider’s log.
The Nemhandel act gives the Danish Business Authority (Erhvervsstyrelsen) the running of the Nemhandel register, Nemhandelsregisteret, where receivers are listed (section 3). When I checked on 4 December 2026, the Nemhandel site showed 67,633 registered receivers.
The Danish Business Authority published a strategy for the e-invoice document standard dated 5 March 2026. Its main points:
The strategy also notes that the EU ViDA directive makes e-invoices mandatory for cross-border trade within the EU from 1 July 2030, with invoices that follow the European norm EN 16931. The plan covers invoice, credit note and invoice response first. Other OIOUBL documents, such as orders and catalogues, have no date yet.
For a PHP codebase the practical reading is that two output formats will coexist for at least two more years. Code that builds the invoice from one internal model and serialises it per format turns the later switch to Nemhandel BIS 4 into one more serialiser.
The Danish Business Authority guidance on CIUS, dated 19 March 2019, explains how Peppol BIS Billing 3.0 applies to Danish buyers. The order it rested on, order no. 346 of 2019, was repealed from 1 January 2024 by order no. 1643, so the guidance serves here as technical background only. Points that still drive the code:
urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0 and the ProfileID is urn:fdc:peppol.eu:2017:poacc:billing:01:1.0The Peppol specification also says an invoice must carry a buyer reference or a purchase order reference. That lines up with section 4 of order no. 206.
PHP ships XMLWriter and DOM in its standard XML extensions. A minimal start of a Peppol BIS invoice, with the namespaces and identifiers from the OpenPeppol example file:
<?php
$ns = [
'' => 'urn:oasis:names:specification:ubl:schema:xsd:Invoice-2',
'cac' => 'urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2',
'cbc' => 'urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2',
];
$w = new XMLWriter();
$w->openMemory();
$w->startDocument('1.0', 'UTF-8');
$w->startElementNs(null, 'Invoice', $ns['']);
$w->writeAttributeNs('xmlns', 'cac', null, $ns['cac']);
$w->writeAttributeNs('xmlns', 'cbc', null, $ns['cbc']);
$w->writeElementNs('cbc', 'CustomizationID', null,
'urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0');
$w->writeElementNs('cbc', 'ProfileID', null, 'urn:fdc:peppol.eu:2017:poacc:billing:01:1.0');
$w->writeElementNs('cbc', 'ID', null, $invoice->number);
$w->writeElementNs('cbc', 'IssueDate', null, $invoice->issueDate->format('Y-m-d'));
$w->writeElementNs('cbc', 'InvoiceTypeCode', null, '380');
$w->writeElementNs('cbc', 'BuyerReference', null, $order->buyerReference);
// parties, tax totals and lines follow
$w->endElement();
$xml = $w->outputMemory();Before sending, the module checks the XML against the schema:
<?php
libxml_use_internal_errors(true);
$doc = new DOMDocument();
$doc->loadXML($xml);
if (!$doc->schemaValidate($xsdPath)) {
foreach (libxml_get_errors() as $error) {
$log->warning(trim($error->message), ['line' => $error->line]);
}
libxml_clear_errors();
throw new InvoiceRejected('Schema validation failed');
}The PHP manual states that DOMDocument::schemaValidate supports XML Schema 1.0 only. That covers structure. The Peppol and OIOUBL business rules come as schematron files, so they run as a second step, either in a validator outside PHP or through the validation your access provider offers before transmission. NemHandel also offers an OIOUBL validation tool on its OIOUBL pages. The second step should match what your provider supports, and a set of test invoices that fail on purpose makes a rule change show up in the test suite.
These fields and records follow from the orders above:
I need repository or server access and sample orders from public customers. An overview of my PHP work is on the PHP developer page. I am not a lawyer or an accountant, so your adviser decides which rules apply to your business.
If your Aalborg company bills public customers from a PHP system, use the contact form to send the system name, the public customers, your access provider and the date you need it by. I write the first estimate for the e-invoicing work free of charge, and the reply comes by email.
Examples of my work.
centrumpoludnie.pl is an information portal for a shopping centre in southern Gdansk, covering shops, promotions, news, and simple administration.
DKF.za.pl is a website created in 2010 for the Film Discussion Club “ZA”, operating as part of the Polish Federation of Film Discussion Clubs. The project wa...
EclipseSource, founded in 1997, is a global leader in Eclipse technologies, with a strong presence in Europe and North America, specializing in enterprise so...
Describe your project by e-mail. I reply within 24 hours.
Describe your projectNeed to show the category hierarchy in your theme? Learn how to get the current category and its parent using get_the_category() and get_category_parents().
Need to get the URL of the first image or link in an article? Prefer DOMDocument over regex. Ready-made WordPress PHP for developers.
On 1 December 2026 Taylor Otwell shipped the Laravel Rust beta, and Laravel Go followed a day later. What the framework contains, what the 18x benchmark really measures, what happens to Laravel PHP and WordPress, and when a rewrite makes sense.
Custom WordPress engineering and architecture.
Scalable headless, ERP, and AI architecture for enterprise.
Stores, checkout flow, and sales logic.
Stability, updates, and post-launch support.
What the monthly care fee covers and what changes it.
Business process automation around WordPress and company systems.
Headless WordPress, Sanity, Strapi, and Contentful with Astro or Next.js.
Astro, MDX, edge delivery, and Core Web Vitals measured on real traffic.

How to start as a WordPress developer in 2026. Local environment, theme and plugin development, REST API and headless paths, security and Core Web Vitals. A practitioner playbook that does not waste your first month.

WordPress 7.0 with AI Client against Astro 7 with the Rust compiler and Vite 8. Speed, cost, SEO and security compared, plus the real bill for my own Astro 6 to 7 migration.

A detailed comparison table of EmDash CMS and WordPress across architecture, security, plugins, AI features, content model, hosting, and ecosystem maturity.