=== CatCode Order Sync with Collmex for WooCommerce ===
Contributors: catcodestudio
Tags: collmex, warenwirtschaft, buchhaltung, kundenauftrag, 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 Collmex as sales orders or invoices, together with the customer, from the order screen.

== Description ==

Collmex keeps your stock, your invoices and your books. This plugin puts a WooCommerce order there with one click, so nobody types it in a second time.

Collmex is a third-party product. This is an independent integration, not affiliated with or endorsed by Collmex GmbH.

= What it does =

* A box on the order with a "Send to Collmex" button.
* The order arrives as a sales order (Kundenauftrag) or as an invoice (Rechnung). You choose.
* The customer comes along. For a sales order Collmex finds the customer by e-mail address or creates one. For an invoice the plugin looks the customer up by e-mail address and creates one when there is none.
* Lines go out as text lines with name, quantity and price, or with the Collmex product number taken from the SKU, so Collmex keeps stock for the order.
* Prices go out net or gross. The plugin reads your Collmex price groups, and when you choose one for the documents it sends prices the way that group reads them. Shipping costs, fees and a different delivery address are included.
* Collmex works out VAT and totals itself. After sending, the plugin reads the document back and warns on the order when the amount differs from the shop: the total of a sales order, the net value of the lines of an invoice.
* No duplicates. The Collmex document number is kept on the order, and "Send again" changes that document. If an earlier attempt got no answer, the document is looked up in Collmex before a new one is created.
* A connection test on the settings screen.
* Works with High-Performance Order Storage and classic order storage. Nothing is added to the checkout.
<!-- @pro-begin -->

= Pro =

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

* Orders go to Collmex automatically at the order status you choose, with retries when Collmex does not answer.
* Tax classes, payment methods and shipping methods matched to the tax classification, payment term and shipping type in Collmex.
* Available stock and prices from Collmex in the shop, matched by SKU.
* Payment confirmation for paid sales orders with a prepayment or payment-service payment term in Collmex.
* Tracking numbers of Collmex deliveries on the order, with an optional e-mail to the customer.
* Bulk sending from the orders list and a log with one-click resend.
* German interface included.
<!-- @pro-end -->

== Installation ==

1. Install and activate the plugin. WooCommerce has to be active.
2. In Collmex create a separate user for the shop and tick "Nur für API".
3. In WooCommerce > Collmex Sync enter your Collmex customer number, the API user and its password, and save. The connection is tested.
4. On the Documents tab choose sales order or invoice, and the Collmex price group (or net or gross prices).
5. Open an order and click "Send to Collmex".

== Frequently Asked Questions ==

= Which Collmex edition do I need? =

One that includes the Collmex API. Collmex says the API is part of its multi-user editions.

= Does an API user cost extra? =

Collmex says additional users marked "Nur für API" are not charged.

= Sales order or invoice, which one should I pick? =

A sales order if you ship and invoice from Collmex. An invoice if the shop sale is final and you only want it in the books: Collmex posts an imported invoice right away, and the plugin can only compare the net value of its lines afterwards. Send one test order first.

= The total in Collmex is different from the shop. Why? =

Collmex calculates VAT and totals on its own. Check that prices go out the way the Collmex price group reads them (net or gross), and that the tax classification of the lines fits.

A difference of a few cents on orders with goods at 19 % and 7 % plus shipping has another reason: Collmex spreads the shipping costs over the tax rates of the goods, while WooCommerce taxes shipping at one rate. With a gross price group and gross prices the totals agree, because the amount the customer paid is sent as it is.

= What happens when I send an order twice? =

The second time the same document in Collmex is changed. No second document is created.

= 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.

== External services ==

This plugin connects to the Collmex API (www.collmex.de) to create customers, sales orders and invoices in your own Collmex account. It only does so after you entered your Collmex customer number, API user and password.

When you send an order, these data go to Collmex: your API user and password, the customer's name, company, address, phone number, e-mail address and VAT number, and the order's number, date, lines, amounts, shipping costs, payment method name, transaction ID and customer note. The connection test reads the template customer of your Collmex account.

Collmex [terms](https://www.collmex.de/agb.html) and [privacy policy](https://www.collmex.de/datenschutz.html).
<!-- @pro-begin -->

This build also reads stock, prices and deliveries from your Collmex account when you switch that on, and talks to catcode.com.ua to activate the key and to look for updates. To catcode.com.ua 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.
