=== CatCode Accounting Sync with Lexware Office for WooCommerce ===
Contributors: catcodestudio
Tags: lexware, buchhaltung, rechnung, invoices, 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 Lexware Office as invoices, with contacts, German VAT, automatic retries and no duplicates.

== Description ==

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

Lexware Office is a third-party product. This is an independent integration, not affiliated with or endorsed by Haufe-Lexware GmbH & Co. KG.

= What it does =

* Creates an invoice in Lexware Office for each order, with products, shipping and fees.
* Finds or creates the contact by e-mail address. A changed address is updated in Lexware Office. Company name comes along.
* Each line goes out with the VAT rate the order charged, 19 %, 7 % or 0 %. If Lexware Office does not allow a rate, the order stops with a message.
* Small businesses under section 19 UStG are recognised from your Lexware Office account, and invoices go out without VAT.
* The invoice can stay a draft, or be finalised. Lexware Office gives it its number.
* The invoice total always equals the order total, because lines go out with the amount the customer paid. Lexware Office works out the VAT per rate, so a cent can differ from the WooCommerce VAT breakdown.
* Prepaid orders say "Bereits bezahlt" on the invoice, other orders show your payment term.
* Works through a queue. Network and server errors are retried automatically for up to about two days, and the Lexware Office rate limit is respected. 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 it up in Lexware Office, 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.
<!-- @pro-begin -->

= Pro =

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

* sevdesk as your accounting system: contacts, invoices, finalising, payments and credit notes.
* Credit notes for refunds, per line or spread over the order's VAT rates for a refund entered as an amount. sevdesk links each one to its invoice. Lexware Office links a credit note only to an open invoice, once, so for a paid invoice or a second refund it stands alone with a note to match it by hand.
* Payments booked on the invoice in sevdesk. Cash on delivery counts as paid when the order is completed. Lexware Office does not accept payments from outside, so there they are matched in its bank view.
* Invoices e-mailed to the customer as a PDF: by sevdesk, or by your shop for Lexware Office.
* Tax rules for sales abroad: EU customers with a VAT number, customers outside the EU, and EU consumers under the One Stop Shop.
* German interface included.
<!-- @pro-end -->

== Installation ==

1. Install and activate the plugin. WooCommerce has to be active, with EUR as the shop currency.
2. In Lexware Office go to Extensions > Public API and create an API key. The public API needs the XL plan.
3. In WooCommerce > Accounting Sync, paste the key and save. The connection is tested.
4. Choose the order statuses that send an invoice, and whether it stays a draft.

== Frequently Asked Questions ==

= Which Lexware Office plan do I need? =

Lexware says the public API needs the XL plan. The plugin itself costs nothing extra there.

= My connection stopped working after two years. Why? =

A Lexware Office API key lasts 24 months at most. Create a new one and paste it on the Connection tab.

= 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 settings with your tax adviser.

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

An order abroad that charged no VAT needs a tax rule the plugin does not guess, because a wrong choice lands in the wrong box of your VAT return. Enter that invoice by hand in Lexware Office.

= Can I send orders in another currency? =

No. Lexware Office only takes EUR. Such an order stops with a message.

= Does the invoice number come from WooCommerce? =

No. Lexware Office numbers its invoices. The order reference stands in the text above the lines, and the plugin finds the invoice again by that reference.

== External services ==

This plugin connects to the Lexware Office public API (api.lexware.io) to create contacts and invoices in your own Lexware Office account. It only does so after you add your API key.

When an order reaches a status you chose, or when you send it by hand, these data go to Lexware Office: the customer's name, company, address, e-mail address and VAT number, and the order's reference, date, lines, amounts and VAT. The settings screens also read your company name and tax setting.

Lexware Office [terms](https://agb.lexware.de/lexware-office) and [privacy policy](https://datenschutz.lexware.de/lexware-office).
<!-- @pro-begin -->

With sevdesk as your accounting system, the same order data go to the sevdesk API (my.sevdesk.de) instead, plus payments and refunds. sevdesk [terms](https://sevdesk.de/agb/) and [privacy policy](https://sevdesk.de/datenschutz/).

This build also 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.
