=== ZUGpfeffer E-Rechnung – Read and check e-invoices (XRechnung, ZUGFeRD) ===
Contributors: chilicooperation
Tags: e-invoice, xrechnung, zugferd, factur-x, invoice
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 0.1.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Upload e-invoices (XRechnung, ZUGFeRD/Factur-X), view them in readable form, run a basic check and file them in an inbox ledger.

== Description ==

With **ZUGpfeffer E-Rechnung** you upload an electronic invoice in the WordPress admin area. The plugin shows its content in readable form, runs a basic formal check and files it in an inbox ledger. All data stays on your own server. The admin interface is currently in German.

**Features (all free, no limits)**

* Upload e-invoices: XML in the formats UN/CEFACT CII (XRechnung, ZUGFeRD 2.x and later, Factur-X) and UBL (XRechnung)
* PDF with embedded XML (ZUGFeRD/Factur-X): the XML file is extracted from the PDF
* Readable view: seller, buyer, number, date, service period, line items, tax breakdown, totals, payment details, buyer reference (Leitweg-ID)
* Basic formal check with plain-language hints: key mandatory fields of EN 16931, recalculation of totals, date formats, VAT rates, IBAN check digits
* Inbox ledger with status (open, checked, paid), note and filter
* The original file is kept unchanged in a separate folder and can only be downloaded by logged-in administrators
* CSV export of the inbox ledger

**Security and privacy**

* Only users with the capability `manage_options` (administrators) have access.
* XML is read with a size limit and without external entities. Files containing a DOCTYPE are rejected.
* The plugin sets no cookies and sends no data to external servers.

**Limits**

* The check is a basic check. It covers only part of the rules and does not replace an official validator. An invoice without findings can still be faulty.
* The old ZUGFeRD 1.0 is not supported. Encrypted PDF files cannot be read.
* The inbox ledger is a simple filing system and not a verified archive.

**Optional Pro add-on (separate, for businesses only)**

A separate add-on creates your own e-invoices (customer list, number range, XRechnung XML, print view, credit notes, outgoing ledger). It is obtained separately from chili-cooperation.com and is sold to businesses only. All features of this plugin stay free and nothing in it is locked. More information: https://chili-cooperation.com/wp-apps/#e-rechnung

**Important notes**

This plugin is a technical tool and not legal or tax advice. The user is responsible for the mandatory details of an invoice, its tax treatment, checking and retention. Use is at your own risk, and the plugin is provided without warranty.

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/` or search for the plugin under "Plugins > Add New".
2. Activate the plugin.
3. Open the "ZUGpfeffer E-Rechnung" menu and upload an XML or PDF file. Two invented sample files are included in the plugin folder under `beispiele/`.

== Frequently Asked Questions ==

= Which formats are read? =
XRechnung (CII and UBL), ZUGFeRD 2 and later, and Factur-X, each as XML or as PDF with embedded XML. The old ZUGFeRD 1.0 is not supported.

= Does the check replace an official validator? =
No. It is a basic check and covers only part of the rules.

= My PDF is not read. Why? =
Either the PDF contains no embedded XML (then it is not an e-invoice), or it is encrypted. Ask the sender for the XML file.

= Where are the files stored? =
In the folder `wp-content/uploads/chili-e-rechnung/` with random file names. The folder is blocked by `.htaccess` (Apache). On nginx, your host should additionally block the folder.

= Does the plugin set cookies or connect to external servers? =
No. Invoice data is processed on your server only.

= What happens when I delete the plugin? =
The data is kept. Only if you explicitly choose it in the settings are the inbox ledger and files deleted.

== Screenshots ==

1. Inbox ledger with upload form, status filter and check results
2. A single e-invoice in readable form with check result, status, note and original file
3. A single invoice with the errors reported by the basic check

== Changelog ==

= 0.1.0 =
* Initial release.
