=== CatCode Accounting Sync with Smallinvoice for WooCommerce ===
Contributors: catcodestudio
Tags: smallinvoice, accounting, invoices, woocommerce, vat
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 Smallinvoice as sales invoices, with clients, Swiss VAT mapping, automatic retries and no duplicates.

== Description ==

Every order in your shop has to end up in your accounts. This plugin sends it to Smallinvoice when the order reaches a status you choose, and keeps trying when the connection is down.

Smallinvoice is a third-party product of Lourens Systems GmbH. This is an independent integration, not affiliated with or endorsed by Smallinvoice.

= What it does =

* Creates a sales invoice in Smallinvoice for each order, with products, shipping and fees.
* Finds the client by e-mail address or creates it, with company name and VAT number. The billing address of each order goes on its invoice.
* VAT: a WooCommerce rate goes to the Smallinvoice VAT percentage of the same value (8.1%, 2.6%, 3.8% or 0%; 7.7%, 2.5% and 3.7% for older orders), or to the one you choose. If there is no certain match, the order stops with a message instead of putting the sale into the wrong box of your VAT return.
* Prices go to Smallinvoice including VAT, so the total in Smallinvoice is the total of the order. A total that does not match stops the order with both amounts.
* The invoice is created in the language of your shop when Smallinvoice offers it (German, English, French, Italian or Spanish), otherwise in English.
* Works through a queue. Network and server errors are retried automatically for up to about two days; when Smallinvoice asks to slow down, the queue waits by itself. Problems that need your attention stop with a clear message on the order and in the queue.
* No duplicates. A document exists once per reference in the queue, and before creating anything the plugin looks for the order reference in the notes of the client's invoices in Smallinvoice, so a lost answer or a second status change does not create a second invoice.
* A box on the order, a bulk action on the orders list, and "Send again" in the queue.
* Works with High-Performance Order Storage and classic order storage.
* English and German (Switzerland, Germany).

Refunds are not sent: the Smallinvoice API has no credit notes. Create the credit note in Smallinvoice.
<!-- @pro-begin -->

= Pro =

Sold on [catcode.com.ua](https://catcode.com.ua/modules/smallinvoice-accounting-sync-woocommerce/) with a 7-day trial.

* Payments recorded on the invoice, with the transaction reference, and a Smallinvoice payment channel per WooCommerce payment method. Cash on delivery counts as paid when the order is completed.
* The invoice e-mailed to the customer from Smallinvoice, with your own subject and text.
<!-- @pro-end -->

== Installation ==

1. Install and activate the plugin. WooCommerce has to be active.
2. In Smallinvoice open Home, then Users, then API V2, and create a client with the "Client credentials" grant and the scopes profile, contact, catalog and invoice.
3. In WooCommerce > Accounting Sync, enter the client ID and the client secret, and save. The connection is tested.
4. Open the Mapping tab and check the VAT rates.

== Frequently Asked Questions ==

= What happens to orders that existed before I installed the plugin? =

Nothing, until you send them: select them in the orders list and choose "Send to the bookkeeping".

= Does the plugin change prices or the checkout? =

No. It adds nothing to the shop front.

= Is this tax advice? =

No. You stay responsible for your bookkeeping and your VAT return. Check the mapping with your accountant.

= An order stopped with a VAT message. What now? =

Choose the VAT rate on the Mapping tab and click "Send again". The invoice is created once.

= My business is not registered for VAT. =

Choose "No tax rate" for lines without VAT on the Mapping tab, so the lines go out without a VAT rate.

= Why do private customers appear as companies in Smallinvoice? =

Smallinvoice asks for a gender for a private client, which a shop does not know. The customer is created as a client of the type company, with his name.

== External services ==

This plugin connects to the Smallinvoice API (api.smallinvoice.com) to create clients and sales invoices in your own Smallinvoice account. It only does so after you add your client ID and client secret.

When an order reaches a status you chose, or when you send it by hand, these data go to Smallinvoice: the customer's name, company, address, e-mail address, phone number and VAT number, and the order's reference, date, lines, amounts and VAT. The plugin also reads your account name, your units and the client's invoices and addresses. The client ID and secret are sent only to the token address of Smallinvoice to get an access token.

Smallinvoice [privacy policy](https://www.smallinvoice.ch/datenschutz/).
<!-- @pro-begin -->

This build also sends payments to Smallinvoice, and it talks to catcode.com.ua to activate the key and to look for updates. It sends the key and the site address, nothing about orders or customers.
<!-- @pro-end -->

== Changelog ==

= 1.0.0 =
* First release.

== Upgrade Notice ==

= 1.0.0 =
First release.
