=== KleinBooks – Rechnungen & E-Rechnung für Kleinunternehmer & Selbstständige ===
Contributors: opskleinbooks, freemius
Tags: rechnung, rechnungen, kleinunternehmer, e-rechnung, buchhaltung
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 8.1
Stable tag: 1.9.17
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Rechnungen & Angebote (invoices, quotes) in WordPress – Kleinunternehmer (§19) or with VAT. Pro: E-Rechnung (ZUGFeRD), DATEV export, GoBD, 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 (€69 / year incl. 19% German VAT, i.e. €57.98 net; the VAT follows your country, businesses with a VAT ID pay net; 14-day free trial without credit card that ends automatically) is a separate paid version that adds the bookkeeping side. It is sold by our authorised reseller (Merchant of Record) Freemius, Inc.:

* **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 lock sent invoices (GoBD)? =

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 inside your own WordPress install and your business data (clients, quotes, invoices, expenses) stays on your own site. The plugin uses the Freemius SDK for licensing and updates of KleinBooks Pro; if you opt in, Freemius also receives basic site and usage data (you can skip this). No invoicing data is sent to KleinBooks or Freemius.

= 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: invoiced revenue, open and overdue invoices, expenses and your Kleinunternehmer limit at a glance.
2. Invoices with automatic numbers and clear statuses: draft, open, overdue, paid, cancelled.
3. Clean invoice PDF with the German mandatory details (§14 UStG), ready to send by email.
4. Quotes (Angebote) that turn into an invoice in one click.
5. Expenses by category, with recurring costs and reminders for missing receipts.
6. Taxes: income by payment date, profit, tax reserve and the three §19 limits.
7. Settings: Kleinunternehmer (§19) or Regelbesteuerung (VAT), switched with one confirmed click.
8. "Mark as paid" asks when the money arrived – the payment date decides in which year the income counts.

== Changelog ==

= 1.9.17 =
* "Mark as paid" asks when the money arrived. The payment date decides in which month and year the income counts; it can be corrected later ("Change payment date").
* Taxes: income is counted by payment date (cash basis), the same way as the DATEV export. The Kleinunternehmer card shows the three §19 limits separately (previous year, this year, next year), measured on payments received, with a note for the founding year.
* Invoice numbers are always assigned by KleinBooks; "Next invoice #" in Settings shows the real next number and can continue an earlier numbering. Deleting an invoice that would leave a gap in the numbering warns first.
* Clearer statuses: "Open", "Overdue" (with filter) and an "emailed" marker; after a cancellation (Storno) a hint to send the Stornorechnung to the client.
* Fixes: sites with plain permalinks open the app correctly; tablet layout (icon menu); German number format and typography ("19 %", "800 €").

= 1.9.16 =
* Privacy: receipts (images and PDFs of your expenses) are no longer public files. They are stored in a closed folder and only shown to logged-in administrators. Existing receipts are moved automatically.
* Every email to a client asks for confirmation first and shows the document and the recipient address.
* German typography on PDFs and in the invoice list.

= 1.9.15 =
* Pro: issued invoices are archived as PDF the moment they are issued (GoBD) — later updates never change an issued document.
* New: recurring expenses (subscriptions, rent, flat fees) are now booked automatically every month, quarter or year until you end the series. Automatic bookings are marked "receipt missing" so you can attach the invoice later. Existing recurring expenses continue from this update on — nothing is booked into the past.
* Invoices without a service period now state "Leistungsdatum entspricht dem Rechnungsdatum" (§14 UStG); issuing an invoice for a client without a full address shows a warning.
* The invoice list shows amount and status again; the expenses page shows quarterly recurring costs correctly.
* Clients: example placeholders, in-app delete confirmation, and a reminder before closing a form with unsaved changes. Clients with offers can no longer be deleted.
* Escape closes forms; clearer wording when switching between Kleinunternehmer and Regelbesteuerung.

= 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 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.
