=== E-Invoice EN 16931 for WooCommerce ===
Contributors: catcodestudio
Tags: e-invoice, zugferd, xrechnung, factur-x, en 16931
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

ZUGFeRD / Factur-X and XRechnung e-invoices for WooCommerce orders — EN 16931 compliant, validated, generated inside your shop.

== Description ==

Since 1 January 2025 every business in Germany has to be able to receive e-invoices, and from 2027/2028 B2B invoices have to be issued as structured e-invoices according to EN 16931. France follows with Factur-X. A normal PDF is no longer enough.

E-Invoice EN 16931 turns WooCommerce orders into real e-invoices:

* **ZUGFeRD 2.x / Factur-X, profile EN 16931** — a PDF/A-3 invoice with the structured data (UN/CEFACT CII) embedded as `factur-x.xml`. People read the PDF, accounting software reads the XML.
* **XRechnung 3.0** — the German CIUS for public-sector and B2B buyers, in CII syntax and in UBL 2.1 syntax.
* **The data EN 16931 needs and WooCommerce does not have**: buyer VAT ID and buyer reference / Leitweg-ID at checkout (classic and block checkout), a VAT category per line (S, Z, E, AE, K, G, O) with exemption reason and VATEX code, UN/ECE units of measure, payment means per payment method.
* **Automatic VAT categories**: taxed lines are S with the order's rate; untaxed lines become K (intra-Community supply of goods) or AE (reverse charge for services) for EU business customers with a VAT ID, G for exports, and E for small businesses under § 19 UStG — with the right exemption text.
* **Totals the way validators check them**: VAT is calculated per category (BR-S-09, BR-CO-14 …); the cent WooCommerce's per-line rounding can differ by goes into the rounding amount, so the amount due is exactly what the customer paid.
* **Gap-free invoice numbers** with your own format (`RE-{YYYY}-{N:5}`), taken under a database lock.
* **Issued documents never change**: the invoice is stored with the order and always renders to the same bytes, even if products, prices or settings change later.
* **Pre-flight check** in plain words (“Seller: the VAT ID is missing (BR-S-02)”) before an invalid file can leave your shop, and a settings check against your newest order.
* **German and English invoices** (automatic by the customer's country), German admin translation included.

Every file is created on your server: no external service, no account, no data sent anywhere.

= Validated =

The generated files were checked with the official validators before release:

* XRechnung (CII and UBL, invoices and credit notes): KoSIT validator 1.6.3 with the XRechnung 3.0.2 configuration (2026-08-31) — accepted, no warnings.
* ZUGFeRD / Factur-X PDF and XML: Mustang 2.26 (schematron EN 16931 + veraPDF PDF/A-3b) — valid.

We still recommend sending a first invoice to your accountant or the buyer's portal before switching over completely.

= Free and Pro =

Free:

* ZUGFeRD / Factur-X PDF (PDF/A-3b), CII XML, XRechnung CII and UBL for every order — issued with one click in the order screen
* Buyer VAT ID and buyer reference / Leitweg-ID fields in the classic and block checkout
* VAT categories, exemption reasons, units, payment means, small business mode
* Gap-free numbering, German / English invoices, sample invoice for checking the settings


== Frequently Asked Questions ==

= Which formats and versions exactly? =

CII according to EN 16931 as used by ZUGFeRD 2.x / Factur-X 1.0 (profile “EN 16931”, guideline `urn:cen.eu:en16931:2017`), embedded in PDF/A-3b as `factur-x.xml` with AFRelationship “Alternative” and the Factur-X XMP schema. XRechnung 3.0 (`urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0`) in CII and UBL 2.1 syntax.

= Can I send invoices through Peppol? =

Not from the plugin. The files are ready for it: upload the XRechnung XML to your access point, the buyer's portal (e.g. ZRE / OZG-RE for German authorities) or send the ZUGFeRD PDF by e-mail.

= My buyer is a public authority. What do I need? =

The Leitweg-ID. Customers can enter it at checkout (field “Buyer reference / Leitweg-ID”), or you type it into the order screen before issuing the invoice. Then download “XRechnung (UBL)” or “XRechnung (CII)”.

= I am a small business (§ 19 UStG). =

Tick “Small business” in the settings. Every line is then category E with the exemption text printed on the invoice and sent in the XML. A tax number is enough, no VAT ID needed.

= What happens with coupons, fees and shipping? =

Coupons are already in the line amounts. Shipping and positive fees become lines; a negative fee becomes a document-level discount (EN 16931 does not allow negative prices). Shipping taxed at several rates is split per rate.

= An invoice is wrong. Can I change it? =

Before you sent it: “Rebuild from order” keeps number and date and takes the current order data. After you sent it: refund the order and issue a credit note (Pro), then issue a new invoice for a new order.

= Is the invoice deleted when I delete the plugin? =

No. Issued invoices stay with the orders (tax law requires keeping them) and the number counters stay, so a reinstall does not start at 1 again. Only the settings are removed.


== Screenshots ==

1. Settings: seller, payment, VAT categories, checkout fields
2. Order screen: issue the invoice, download PDF and XML
3. The ZUGFeRD / Factur-X invoice (German)

== Changelog ==

= 1.0.0 =
* First release: ZUGFeRD / Factur-X EN 16931 (PDF/A-3b + CII), XRechnung 3.0 (CII, UBL), buyer VAT ID and Leitweg-ID at checkout, VAT categories and exemption reasons, gap-free numbering, German translation.
