=== KleinBooks – German Invoicing & Buchhaltung ===
Contributors: opskleinbooks, freemius
Tags: rechnung, angebot, kleinunternehmer, invoice, buchhaltung
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 8.1
Stable tag: 1.9.14
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Invoicing in WordPress that grows with you: §19 Kleinunternehmer today, VAT (Regelbesteuerung) with one switch. Pro: GoBD, DATEV, UStVA.

== Description ==

**Heute Kleinunternehmer, morgen mit Umsatzsteuer — KleinBooks wächst mit.**

KleinBooks brings the German business workflow — **Angebot → Rechnung** (quote → invoice) — directly into your own WordPress admin. No second tool, no monthly SaaS subscription. Start as a Kleinunternehmer (§19 UStG); when your business passes the €25,000 limit, switch to Regelbesteuerung (standard VAT) with one confirmed click and keep working in the same tool.

= Free =

* Write quotes (Angebote) and convert them to an invoice in one click
* Invoices with the German mandatory fields (§14 UStG) and sequential numbers
* Clean PDF invoices & quotes, sent by email
* Clients, and expenses with categories, recurring costs and receipt upload
* Dashboard and a Taxes overview: revenue, expenses, profit and an estimated tax reserve
* §19 thresholds (€25,000 previous year / €100,000 current year) with a warning before you reach them
* **Kleinunternehmer ↔ Regelbesteuerung switch** — 19 % / 7 % VAT, net / VAT / gross on invoices and quotes, USt-IdNr, input VAT (Vorsteuer) on expenses and a VAT-owed (USt-Zahllast) overview. Invoices you already issued keep their tax treatment.

= Pro =

KleinBooks Pro (€59 / year plus VAT, 14-day free trial without credit card) is a separate paid version for when you need to be audit-ready:

* **GoBD lock** — sent invoices can no longer be changed; corrections go through a proper Stornorechnung (own number) and an optional correction invoice
* **DATEV export** (EXTF, SKR03/SKR04) for your tax advisor
* **USt-Voranmeldung** — your quarterly or monthly VAT return figures (Ist or Soll taxation) with PDF
* **ZUGFeRD / Factur-X e-invoices** — for VAT-registered businesses (issuing becomes mandatory from 2027/2028); Kleinunternehmer are exempt from issuing e-invoices
* **AfA / Abschreibung** — depreciation of assets

The free version is an invoicing tool: sent invoices stay editable. GoBD lock with Storno is part of KleinBooks Pro.

= Source code =

The admin app is built with React (@wordpress/scripts). The full unminified source for the compiled bundle in `assets/`, together with build instructions, is included in the plugin's `src/` directory.

== Installation ==

1. Install KleinBooks from the WordPress plugin directory, or upload it to `/wp-content/plugins/kleinbooks`.
2. Activate the plugin through the **Plugins** screen in WordPress.
3. Open **KleinBooks** in the admin menu and create your first invoice.

== Frequently Asked Questions ==

= Is KleinBooks free? =

Yes. Quotes, invoices, expenses and the §19 ↔ Regelbesteuerung switch are free and fully functional. GoBD lock with Storno, DATEV export, USt-Voranmeldung, e-invoicing and AfA are part of KleinBooks Pro.

= I'm over the €25,000 Kleinunternehmer limit — does KleinBooks still work for me? =

Yes. In Settings, switch the tax regime from Kleinunternehmer (§19) to Regelbesteuerung. New invoices and quotes then show net, VAT (19 % or 7 %) and gross amounts and your USt-IdNr; invoices you already issued keep their §19 treatment. KleinBooks never switches automatically — it warns you as you approach the limits, and you decide when to switch (ideally together with your tax advisor).

= Does the free version make me GoBD-compliant? =

No. The free version is an invoicing tool — sent invoices stay editable. The GoBD lock with Storno, DATEV export and e-invoicing are part of KleinBooks Pro.

= Do I need an external service or account? =

No. KleinBooks runs entirely inside your own WordPress install. Your invoicing data stays on your own site.

= Can I write quotes (Angebote)? =

Yes, in the free version. Write an Angebot, send it as a PDF by email, and when the client accepts, convert it into a draft invoice in one click — the invoice stays editable so you can make any last changes before sending. The quote and the invoice stay cross-linked so you always see where each one came from.

== Screenshots ==

1. Dashboard: revenue, open invoices, expenses and your Kleinunternehmer limit at a glance.
2. Invoices with automatic sequential numbers, status, due date and payment tracking.
3. Clean invoice PDF with the §19 UStG notice, ready to send by email.
4. Quotes (Angebote) that turn into an invoice in one click.
5. Expenses by category, including recurring subscriptions.
6. Taxes: profit, tax reserve estimate and the §19 UStG thresholds.
7. Settings: switch between Kleinunternehmer (§19) and Regelbesteuerung (VAT) with one confirmed click.

== Changelog ==

= 1.9.14 =
* Contains all 1.9.13 changes (1.9.13 was only released as KleinBooks Pro).
* Privacy: invoice PDFs are no longer stored as public files; they are only shown to logged-in users. Receipt files get unguessable names.
* Fixed: an invoice number is never reused, even after deleting an issued invoice.
* New invoices get a due date from your payment terms; invoices without one no longer show as overdue.

= 1.9.13 =
* Privacy: invoice PDFs are no longer stored as public files; they are only shown to logged-in users. Receipt files get unguessable names.
* Fixed: an invoice number is never reused, even after deleting an issued invoice.
* New invoices get a due date from your payment terms; invoices without one no longer show as overdue.
* The estimated tax reserve no longer goes below zero.

= 1.9.12 =
* Fixed: adding a second client failed with "Failed to save client" on new installs.
* Clients page shows errors in the app instead of browser popups.
* PDF invoices and quotes now show quantity × unit price on every line (§14 UStG), German dates, and the address in standard German order.
* Converting a quote into an invoice uses the normal invoice number format (e.g. RE-2026-002).
* Amounts with cents always show two decimals (149,50 €).
* New plugin icon.

= 1.9.11 =
* Fixed: activating KleinBooks Pro while the free version is active no longer fails — the free version is switched off automatically.
* Fixed: a cancelled invoice's Stornorechnung appears in the list right away; empty due dates no longer show "Invalid Date".
* Dashboard: the Kleinunternehmer budget now uses paid revenue against the €25,000 limit, the same figures as the Taxes page.
* Settings shows the real invoice number format (e.g. RE-2026-001).

= 1.9.10 =
* An invoice now counts as issued as soon as it leaves Draft — by email, "Issue Invoice" or setting it to Paid — and its issue date is recorded in every case.
* Settings: corrected the Kleinunternehmer note to the current limits (€25,000 previous year / €100,000 current year, since 2025).
* Plugin description and Help page now mention the Regelbesteuerung (VAT) switch and the USt-Voranmeldung in Pro.
* Upgrade cards show the actual Pro price (€59 / year plus VAT) and link to the 14-day free trial.
* The KleinBooks icon now shows on the opt-in and pricing screens.

= 1.9.9 =
* Translations now come from translate.wordpress.org; bundled language files removed.
* This plugin no longer contains any code for KleinBooks Pro features. Pro (GoBD lock + Storno, DATEV export, AfA, ZUGFeRD) is a separate download.
* The shipped React source in src/ now exactly matches the compiled bundle in assets/.

= 1.9.8 =
* Updated bundled library sabberworm/php-css-parser to 9.4.0 (used by dompdf for CSS/SVG parsing) and its dependency thecodingmachine/safe to 3.4.0.
* Minimum PHP raised to 8.1, required by the updated libraries.

= 1.9.7 =
* All CSS/JS now loads through the WordPress enqueue API (app page + admin pages; new assets/admin.css).
* React app source now included in the plugin (src/ with build instructions).
* Library updates: dompdf 3.1.5 (PDF rendering verified identical), Freemius SDK 2.13.4, security patches for bundled fpdi/symfony components.
* Translations load on init (WP 6.7+ i18n timing).
* Fixed a corrupted CSS color value on the Email Log page.

= 1.9.6 =
* Header fix: distinct Plugin URI / Author URI (WordPress.org requires them to differ; removed the redundant Author URI). No functional change.

= 1.9.5 =
* Final WordPress.org Plugin Check pass (0 errors on the generated free build) — resolved a last static-analysis flag on a prepared query. No functional change.

= 1.9.4 =
* Invoice and offer numbers are now year-based (e.g. RE-2026-009 / ANG-2026-009) so they stay unique across years, as §14 UStG requires. Existing numbers are unchanged; new default prefix is RE-.
* Internal WordPress.org compliance hardening.

= 1.9.3 =
* Hardening & WordPress.org compliance: fonts bundled locally (no external requests — GDPR-friendly), uploads handled through WordPress core (wp_handle_upload), complete output escaping, and internal code cleanup. Passes the official Plugin Check with no errors. No feature changes.

= 1.9.1 =
* Freemium launch. Free core: German invoicing (§14 UStG), PDF & email, client management, expenses, dashboard.
* **New: Angebote (quotes/offers)** — write quotes, send them as PDF, and convert an accepted quote into a draft invoice in one click, with a bidirectional link between the two.
* Quote numbering with a configurable prefix and validity period (Gültigkeit), quote status tracking (sent / accepted / declined / expired / converted).
* Invoice & quote emails are now in German.
* KleinBooks Pro adds ZUGFeRD / Factur-X e-invoicing, DATEV export (EXTF, SKR03/SKR04), GoBD lock + Storno (cancellation), and AfA / Abschreibung.
