=== Abby FR for WooCommerce ===
Contributors: catcodestudio
Tags: abby, facturation, invoice, auto-entrepreneur, 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

Sends WooCommerce orders to Abby: the customer and a draft invoice with the order lines, shipping and fees, in your own Abby account.

== Description ==

French freelancers and micro-entrepreneurs who invoice with Abby (abby.fr) end up retyping their web orders. This plugin does it through the public Abby API with your own API key:

* **Order to invoice in one click** — from the order edit screen (the Abby FR box or the order actions menu) the plugin creates the customer in Abby and a draft invoice with every order line, shipping and fee.
* **Amounts as in the shop** — discounts already applied, quantities kept, the VAT code of each line (2.1, 5.5, 8.5, 10 or 20 %, or no VAT). The total Abby computes is compared with the order total; if they differ, the order says so.
* **Customers, private and business** — a private customer or, with a company name and the SIRET you collect at checkout, a business customer. The same e-mail address or SIRET always lands on the same Abby customer.
* **The invoice PDF from the order** — one button opens the PDF straight from Abby.
* **No double documents** — the plugin remembers each step, so pressing the button again, or a send that failed halfway, never creates a second invoice.
* **Failures are visible** — the reason Abby gave is written to the order notes and shown in the box.
* **Refunds** — a refund on a sent order leaves a note to book the credit note in Abby.
* HPOS (custom order tables) supported. The plugin adds nothing to the cart or checkout. French translation included.

// @pro-begin
= Pro =

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

* **Automatic sending** when an order reaches the statuses you choose, with retries.
* **Finalising** of the invoices in Abby.
* **Paid orders marked as paid** on the invoice, with the payment method of the order.
* **The invoice by e-mail** to the customer, PDF attached, as soon as it is finalised.
* **Credit notes (avoirs)** for WooCommerce refunds, made from the invoice.
* **Products added to the Abby catalogue** the first time they are sold.
* **Bulk action** in the order list for past orders, and a list of failed sends with a retry button.

One key works on two sites: the shop and its test copy. 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 accounting advice =

The plugin sends what your shop and your settings describe. Check the invoices in Abby before you rely on them for bookkeeping or for tax purposes. Abby is a trademark of its owner; this plugin is made by CatCode and is not made or endorsed by Abby.

== External services ==

This plugin connects to the Abby API (https://api.app-abby.com), the invoicing service you already use, with the API key you enter in the settings. It is what the plugin is for: nothing is sent until you enter a key.

When you send an order, the plugin sends to Abby the billing data of that order (name, company, e-mail, phone, billing and delivery address, SIRET and VAT number if you collect them) and its lines (names, SKUs, quantities, amounts, VAT), the payment method, and it reads back the invoice and its PDF. When you save the settings, it makes one read request to check the key.

Abby is provided by the company behind abby.fr: [terms of use](https://abby.fr/legals/cguv), [privacy policy](https://abby.fr/legals/confidentiality).

== Installation ==

1. Install and activate the plugin. WooCommerce must be active.
2. In Abby open Settings, then Integrations, and create an API key. Copy it at once: Abby shows it only when it is created.
3. WooCommerce → Abby FR: paste the key and save. The connection is tested.
4. Open an order and press "Send to Abby".

== Frequently Asked Questions ==

= Abby refuses my key =

The API is part of some Abby plans only. Check in Abby that your plan includes the API, and that the key was copied in full.

= I do not charge VAT (franchise en base). Does it work? =

Yes. Lines without VAT get the Abby code you choose in the settings; FR_00HT is the one Abby uses by default.

= My shop prices include VAT =

By default the plugin sends prices without tax, which every Abby account accepts; Abby then adds the VAT. If the total differs from the order by a cent because of rounding, the order tells you and the invoice stays a draft. If prices with tax are enabled in your Abby account, choose "With tax (TTC)" in the settings and the totals match exactly.

= How do I invoice a French business? =

Collect the SIRET at checkout, then give the plugin the order meta key that holds it in the settings. With a company name and a SIRET the buyer is created in Abby as a business; a French buyer without a SIRET is created as a private customer with the company name in the notes.

= Does it create credit notes for refunds? =

A refund leaves a note on the order so it is not forgotten, and the credit note is booked in Abby.
// @pro-begin
The Pro version creates the credit note for you from the invoice.
// @pro-end

= Is the invoice final? =

The free version leaves a draft invoice that you check and finalise in Abby. A finalised invoice cannot be edited in Abby, only corrected by a credit note.

== Changelog ==

= 1.0.0 =
* First release: customer and draft invoice from a WooCommerce order, invoice PDF from the order screen.
// @pro-begin
* Pro: automatic sending with retries, finalising, paid orders marked as paid, the invoice by e-mail, credit notes for refunds, products added to the Abby catalogue, bulk action and the list of failed sends.
* Pro: updates from catcode.com.ua.
// @pro-end
