=== EU OSS VAT & DATEV Export for WooCommerce ===
Contributors: radartools
Tags: woocommerce, eu vat, oss, datev, skr03
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Generate quarterly EU One-Stop-Shop (OSS) VAT returns, monitor the €10,000 threshold, and export DATEV EXTF v700 (SKR03/SKR04) files from WooCommerce.

== Description ==

**EU OSS VAT & DATEV Export for WooCommerce** turns your WooCommerce orders into accountant-ready quarterly EU One-Stop-Shop (OSS) VAT returns and DATEV EXTF v700 booking batches — 100% locally on your own WordPress server with **zero customer PII exported**.

Built for European WooCommerce merchants, German Steuerberater (DATEV SKR03 & SKR04), and cross-border EU B2C sellers.

= Free Features =

* **Quarterly EU OSS VAT Return Breakdown** — groups all 27 EU Member States by destination country and VAT rate (Standard, Reduced, or Check).
* **€10,000 EU Cross-Border Threshold Monitor** — tracks your cross-border B2C net sales against the EU €10,000 OSS registration threshold (`BELOW`, `APPROACHING`, `EXCEEDED`).
* **Smart Order Classification** — automatically separates Domestic, EU OSS B2C, EU B2B Reverse-Charge (detects VAT IDs from popular WooCommerce EU VAT plugins), and Non-EU Exports.
* **Built-in Audit Flags** — flags EU cross-border B2C orders charged 0% VAT without a VAT ID, non-standard VAT rates, and missing FX rates.
* **EU OSS Summary CSV Export** — formula-injection-safe CSV ready for national OSS portals (up to 50 orders per quarter in Free).
* **WooCommerce HPOS Compatible** — uses `wc_get_orders()` with zero direct SQL queries.
* **Zero PII & Privacy-First** — never reads or exports customer names, emails, street addresses, or phone numbers.

= Pro Features (Radar Pass) =

Unlock with an optional [Radar Pass](https://radarbg.com/pass?ref=wp-eu-oss):

* **Unlimited Orders per Quarter**
* **DATEV EXTF v700 Buchungsstapel Export** — ready for German tax advisors (`SKR03` account `8320` and `SKR04` account `4320`, `GR -> EL` country code mapping, Windows-1252 encoding, Beraternummer & Mandantennummer).
* **Order-Level Audit Trail CSV** — every order line behind the quarterly return in EUR.
* **German Excel CSV Format** — semicolon delimiter and decimal comma (`;`, `,`) with German headers.
* **Cross-Quarter Refund Corrections** — automatically detects refunds issued this quarter for orders from earlier quarters.

== External Services ==

This plugin operates 100% locally and makes **zero external HTTP requests** by default.

If (and only if) a store administrator voluntarily enters a Radar Pass Pro code in *WooCommerce → EU OSS VAT → Settings & Pro License*, the plugin sends a single `GET` request to `https://radarbg.com/api/pass/status?code=<pass_code>` once every 12 hours to verify whether the Pass is active. No store data, order data, or customer data is ever transmitted.

* Service provider: [Radar Tools (radarbg.com)](https://radarbg.com)
* Privacy Policy: [https://radarbg.com/privacy](https://radarbg.com/privacy)
* Terms of Service: [https://radarbg.com/terms](https://radarbg.com/terms)

== Installation ==

1. Upload the `radar-eu-oss-vat-export` folder to `/wp-content/plugins/` or install directly through the WordPress Plugins screen.
2. Activate the plugin through the *Plugins* menu in WordPress.
3. Go to **WooCommerce → EU OSS VAT** to view your quarterly OSS report and download CSV / DATEV files.
4. Open the **Settings & Pro License** tab to configure your store home country, DATEV chart of accounts (`SKR03` or `SKR04`), Beraternummer, and Mandantennummer.

== Frequently Asked Questions ==

= Is this plugin compatible with WooCommerce HPOS (High-Performance Order Storage)? =

Yes. The plugin officially declares `custom_order_tables` compatibility and reads orders exclusively through `wc_get_orders()`.

= Does this plugin send my WooCommerce order data to an external server? =

No. All EU OSS VAT calculations and CSV/DATEV exports run 100% locally in PHP on your own server. No customer or order data ever leaves your WordPress installation.

= Which DATEV format is exported? =

The Pro export generates official **DATEV EXTF v700 Buchungsstapel** CSV files (Windows-1252 encoded, CRLF line endings, semicolon separated, decimal commas) supporting both **SKR03** (OSS account `8320`) and **SKR04** (OSS account `4320`).

= Does it replace my tax advisor? =

No. Reports are prepared for review by your tax advisor. Always verify figures against your national EU OSS portal (e.g., BZSt BOP in Germany) before filing.

== Changelog ==

= 1.0.0 =
* Initial release: Quarterly EU OSS VAT report for all 27 EU Member States, €10,000 threshold tracker, audit flags, EN/DE CSV exports, DATEV EXTF v700 (SKR03/SKR04), and WooCommerce HPOS compatibility.
