| 开发者 | jojobry |
|---|---|
| 更新时间 | 2026年11月4日 08:23 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
urn:cen.eu:en16931:2017 is measured against the European rules only; the German rules are never applied to it, no matter how correct it is. That is why software can write XML a validator accepts and still not produce an XRechnung.
This plugin writes the XRechnung 3.0 identifier and fills the fields the German rules then demand, among them:
.htaccess deny there blocks access, on nginx such a deny has no effect and the file is instead protected only by its random name for the seconds it exists.
Everything the plugin stores lives in WordPress options and order meta, all prefixed wc_erechnung_, and uninstalling removes every one of them.
A refund booked in WooCommerce does not change the e-invoice itself — the file keeps showing the full amount — but it gets its own credit note (BT-3 = 381) with a reference to the original invoice (BG-3), downloadable per format right next to the invoice on the order screen. A wrongly issued invoice is handled the other way round: correct the order, then tick Rechnung berichtigen on the order screen and the plugin writes a corrected invoice (BT-3 = 384) that names the superseded document in BG-3 and states that it is not to be paid.
An invoice that has gone out stays reproducible. The first time an invoice is really issued — the moment its number is drawn, which is what a download and the e-mail attachment do and what the preview deliberately does not — the plugin freezes the XML of both syntaxes on the order. Every later request returns that copy byte for byte, even after the order has been corrected, and the order screen says since when. So the shop can still produce the document it actually sent, which is what an audit asks for; a changed state is a correction with a number of its own, not a rewritten invoice.
Conformance
The generated files are checked against the official KoSIT validator using the "Validator Configuration XRechnung 3.0.2" configuration. All bundled test cases — standard invoice, small-business exemption, reverse charge, mixed tax rates, prepayment, minimal invoice, credit note, corrected invoice — are rated ACCEPTABLE in both syntaxes.
Which scenario the validator picks is part of the test, not just the verdict: every one of the 48 documents the test suite generates is matched to an XRechnung scenario — EN16931 XRechnung (UBL Invoice), EN16931 XRechnung (UBL CreditNote) or EN16931 XRechnung (CII) — and therefore measured against the BR-DE rules, not only against the European ones. A file that landed in the plain EN16931 scenario would fail the test suite even if the validator accepted it.
Check the specification identifier (BT-24) of a file it produced. If it reads urn:cen.eu:en16931:2017, the file is a European invoice and the German BR-DE rules were never applied to it — a recipient who asks for an XRechnung will reject it, and setting the identifier by hand does not fix it, because the fields those rules require are then missing: Leitweg-ID (BT-10), seller contact point and telephone (BT-41, BT-42), delivery date (BT-72), business process (BT-23), electronic addresses (BT-34, BT-49). This plugin writes urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0 and fills those fields. If all you need is a European EN 16931 file, you do not need this plugin.
No. A tax number (BT-32) is enough. Businesses using the German small-business exemption enter their tax number and leave the VAT identification number empty.
The Leitweg-ID addresses an invoice at a German public authority, for example 04011000-1234512345-06. Authorities hand it out. For invoices to ordinary business customers the field is not needed — the plugin puts the order number in as the buyer reference instead.
Then a mandatory field is missing. The E-Rechnung box on the order screen names every missing entry together with its rule number, and links straight to the settings when the problem is in the master data.
The invoice itself stays unchanged and keeps showing the original amount — that's correct, EN 16931 corrects a refund with a separate document, not by editing the invoice. The E-Rechnung box on the order screen shows the refunded amount and a download button per format for the credit note (BT-3 = 381) that belongs to it.
Correct the order first — address, company name, items — and then tick Rechnung berichtigen in the E-Rechnung box and save. The plugin writes a corrected invoice (BT-3 = 384) that carries the corrected state, names the superseded invoice in BG-3 and says in the payment terms that the superseded invoice is not to be paid. Correct again and the second correction supersedes the first, so there is always exactly one document that is valid. The original invoice is not touched by any of this: it was frozen when it went out and keeps returning the wrong data on purpose, because that is what the customer received.
Yes. An invoice is frozen the first time it is really issued, in both syntaxes at once, and every later download returns that copy unchanged — the order screen names the date and time it was frozen. Correcting the order afterwards does not rewrite it; that is what the corrected invoice (BT-3 = 384) is for. One limit: invoices issued before version 0.1.4 have no frozen copy, so for those the download still renders today's state of the order. The order screen says so, per order.
Yes. The Leitweg-ID and the VAT identification number are registered for both the classic and the block checkout, and end up on the same order.
Yes, the WooCommerce order tables (High-Performance Order Storage) are supported.
jojobry-e-rechnung-for-woocommerce and languages/ carries the POT file. The interface texts themselves stay German, because the format is the German implementation of EN 16931.<CreditNote> is rejected by BR-CL-01. Both syntaxes of the new corrections are rated ACCEPTABLE by the KoSIT validator..htaccess deny is silently ineffective on nginx. The uploads folder stays as a fallback and now carries deny rules for both Apache 2.2 and 2.4.