=== Totalio – E-reporting for WooCommerce ===
Contributors: roryvdh
Tags: e-reporting, vat, e-invoicing, france, tax
Requires at least: 6.7
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 0.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Computes the French B2C e-reporting totals (per day, category and VAT rate) from your WooCommerce orders, checks orders and shows your deadlines.

== Description ==

From 1 September 2027, French SMEs, very small businesses and micro-businesses that sell to consumers must send the totals of these sales to the tax administration through an approved platform ("plateforme agréée"): per day, per category (goods or services) and per VAT rate. This is the "e-reporting" part of the French e-invoicing reform.

This plugin prepares these totals from your WooCommerce orders. **It is completely free and works on its own**: no account and no connection to any external service is needed to compute, check and export.

The plugin interface is in French, as it is meant for businesses established in France.

= What the plugin does =

* **Computes** the totals to report: net amount and VAT, per day, per category and per rate, refunds included (as negative amounts, on the day of the refund).
* **Services:** also computes the payment data required for services (amounts collected including VAT, per day and per rate, refunds as negative amounts), unless you opted for VAT on debits.
* **Checks** problematic orders and lists them: VAT rate not accepted by the administration, missing VAT, foreign currency, business customer, export, order paid then cancelled…
* **Shows the calendar** of your deadlines according to your VAT regime (monthly or quarterly "réel normal", "franchise en base").
* **Exports** the totals as CSV (French spreadsheet format), to enter on your approved platform or to give to your accountant.
* **Emails you** before each deadline (optional).
* **VAT exemption ("franchise en base")**: optionally displays the "TVA non applicable, art. 293 B du CGI" notice in order emails and on the order summary.
* Compatible with WooCommerce High-Performance Order Storage (HPOS), classic order storage and the block-based cart.
* WP-CLI command: `wp ereporting totals`.

= No customer data =

E-reporting only deals with totals. The plugin only reads amounts, VAT rates, dates and the nature of the products from your orders. No customer name, address or email is used or sent anywhere.

= Optional: automatic transmission (paid online service) =

If you wish, you can link your shop to our online service, which automatically transmits your totals to **your own** approved platform (currently Super PDP or B2Brouter), keeps a log of what was sent and archives the filed reports. This service is paid (14-day free trial, no credit card). It is **optional**: every feature of the plugin remains available without it.

= Important =

This plugin is a calculation and transmission tool; it is not tax advice. It applies the rules published by the French tax administration. Where the published texts do not settle a question (which date to use for an online sale, shipping costs in a cart with several VAT rates…), the plugin follows a cautious, configurable choice that you should confirm with your accountant. The filing remains the responsibility of the business that files it.

== External services ==

The plugin does **not** contact any external service unless you decide to.

**Our transmission service (optional)** — used only if you link your shop in WooCommerce → E-reporting → Service en ligne, with a one-time code obtained in your online account, and after ticking the consent box.

* Address contacted: `https://ereporting.ereporting-fr.workers.dev` (provisional address of the service).
* Data sent: your site address and the plugin version (when linking); then the daily totals of the last 40 days (net amount and VAT per category and per rate, days that need a correction), for services the amounts collected per day and per VAT rate, your VAT regime, the start date of your obligation and whether you opted for VAT on debits. **No customer data.** Every request is signed with a key specific to your shop.
* When: when linking, then twice a day, and when you click "Envoyer maintenant". You can unlink the shop at any time; nothing is sent after that.
* Terms of use: https://ereporting.ereporting-fr.workers.dev/cgu — Privacy policy: https://ereporting.ereporting-fr.workers.dev/confidentialite

**Your approved platform** — the plugin never contacts it directly. Our service transmits your totals to the platform you link in your online account, and only to it:

* Super PDP, with the authorisation you give from your own Super PDP account (you can withdraw it at any time). Terms and privacy: https://www.superpdp.tech
* B2Brouter, with an API key from your own B2Brouter account, stored encrypted by our service (you can remove it at any time). Terms and privacy: https://www.b2brouter.net

== Installation ==

1. Install and activate the plugin (WooCommerce must be active).
2. Open WooCommerce → E-reporting: choose your VAT regime, the date to use for a sale and, if relevant, whether you use the EU One-Stop Shop (OSS).
3. Check the "Tableau de bord" tab: totals per day and rate, orders to check, next deadlines, CSV export.
4. Optional: link the shop to the online service ("Service en ligne" tab) for automatic transmission.

== Frequently Asked Questions ==

= Does it apply to me if I am VAT-exempt (micro-business, "franchise en base")? =

Yes: e-reporting applies to every VAT-registered business established in France that sells to consumers, VAT exemption ("franchise en base") included. In that case, the reporting period is two months; the first filing is due at the end of November 2027 (sales of September and October 2027).

= Does the plugin send my data anywhere? =

No, unless you link your shop to the optional online service yourself. Even then, only totals are sent, never customer data.

= Do I need the paid service? =

No. The plugin computes, checks and exports everything for free. You can enter your totals yourself on your approved platform. The service automates the transmission.

= How are refunds handled? =

As negative amounts, on the day of the refund, in the same category and at the same VAT rate as the refunded item. The published texts do not detail this case: please confirm it with your accountant.

= What about sales to businesses? =

A sale to a business established in France (VAT number provided) falls under e-invoicing, not B2C e-reporting: it is excluded from the totals and flagged.

== Screenshots ==

1. Dashboard: totals per day, category and VAT rate, orders to check and next deadline.
2. Settings: VAT regime, start date, approved platform, date to use for a sale.
3. Optional online service: what is sent, consent and linking with a one-time code.

== Changelog ==

= 0.1.0 =
* First version: totals computation, order checks (including the VAT rate of shipping costs), calendar, CSV export, email reminders, WP-CLI command, optional link to the online service.

== Upgrade Notice ==

= 0.1.0 =
First version.
