=== DATEV Export for WooCommerce ===
Contributors: catcodestudio
Tags: datev, buchungsstapel, accounting, steuerberater, woocommerce
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

Exports WooCommerce orders and refunds as a DATEV booking batch (EXTF Buchungsstapel) for your tax adviser — split by VAT rate, SKR03 / SKR04.

== Description ==

In Germany the bookkeeping of most shops ends up with a tax adviser working in DATEV, and what the adviser asks for every month is a **booking batch** (Buchungsstapel) in the DATEV format. This plugin builds that file from your WooCommerce orders:

* **DATEV-Format, EXTF, booking batch format version 13** — header version 700, the 125 columns of the format description, semicolons, CR/LF, quoted text, decimal comma, Windows-1252 (or UTF-8 with BOM).
* **One posting per VAT rate:** an order with 19 % and 7 % products and shipping becomes as many postings as it has rates — debtor on the debit side, the revenue account of the rate on the credit side. Products, shipping and fees are counted after discounts, and the postings add up to the order total to the cent.
* **Refunds as credit postings** on the date of the refund, split like the order; a refund entered as an amount only is spread over the order's rates in proportion.
* **Your account mapping:** a revenue account and an optional BU key per VAT rate, an account for lines without VAT, the debtor account. For SKR 03 and SKR 04 a button fills in the accounts with automatic VAT from the DATEV chart 2026 (8400 / 8300 or 4400 / 4300, debtor 10000) — for your adviser to confirm.
* **Batch header from your settings:** consultant and client number, fiscal year start, G/L account length, chart of accounts, dictation code, fixing (Festschreibung).
* **Preview before download:** postings, totals per account, and every problem named with its order — an order whose rate has no account stops the download, so the file never reaches the adviser half-booked.
* **No double postings:** orders and refunds in a downloaded file are marked, and the next batch can leave them out. An export log keeps when, which period, how many postings, by whom.
* Document number from the order number or from an invoice plugin's meta key; posting text with placeholders; document date = order, payment or completion date.
* HPOS (custom order tables) supported.
// @pro-begin
* German translation included.
// @pro-end

// @pro-begin
= Pro =

The Pro version is sold on [catcode.com.ua](https://catcode.com.ua/modules/datev-export-woocommerce/), with a 7-day trial that never starts by itself:

* **Payment postings** — every payment and refund payout booked from the clearing account of its payment method (PayPal, Stripe, …) against the debtor, so the open items clear in DATEV.
* **A debtor per registered customer** instead of one collective debtor.
* **EU and export sales on their own accounts** — One-Stop-Shop lines with the destination country and rate in the EU fields, intra-community supplies with the customer's VAT ID, exports to third countries.
* **Monthly e-mail** — the previous month's batch goes to your tax adviser by itself.

The licence runs for 1-5 years and includes updates and support for that term; a purchased licence keeps its Pro features after the term ends.
// @pro-end

= Not tax advice =

The plugin writes the file your settings describe. Which account a sale goes to, which BU key applies and how EU or export sales are treated is decided by you and your tax adviser, who checks the batch before posting it. DATEV is a trademark of DATEV eG; this plugin is not made or endorsed by DATEV.

== Installation ==

1. Install and activate the plugin. WooCommerce must be active.
2. WooCommerce → DATEV Export → Settings: enter the consultant and client number, the account length and chart, and the accounts your tax adviser gives you.
3. WooCommerce → DATEV Export: pick a month, check the preview, download the file and send it to your adviser.

== Frequently Asked Questions ==

= Which DATEV format is it? =

The DATEV-Format for third-party applications ("EXTF"), data category 21 "Buchungsstapel", format version 13, header version 700, as described on developer.datev.de. The adviser imports it in DATEV Rechnungswesen (Stapelverarbeitung).

= Does it post the VAT itself? =

No — each posting carries the gross amount. With revenue accounts that have automatic VAT (AM in the DATEV chart) DATEV works out the VAT; for other accounts your adviser gives you the BU key.

= Why does the preview refuse to download? =

Something in the period has no account: a VAT rate without a revenue account, lines without VAT and no account for them, or missing header data. The preview names each order; fix the mapping and the file is ready.

= What about orders in another currency? =

They are left out and named in the preview — post them by hand with the exchange rate.

== Changelog ==

= 1.0.0 =
* First release: DATEV booking batch (EXTF, format version 13) from orders and refunds, one posting per VAT rate, account mapping with SKR 03 / SKR 04 suggestions, preview, export markers and log.
