=== myDATA AADE for WooCommerce ===
Contributors: catcodestudio
Tags: mydata, aade, greece, receipt, 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

For businesses exempt from the ΦΗΜ under ΠΟΛ.1002/2014: send the receipts of WooCommerce orders to myDATA (AADE), with MARK and QR code.

== Description ==

**Who this plugin is for:** businesses that ΠΟΛ.1002/2014 exempts from the fiscal device (ΦΗΜ) — liberal professions and services (developers, consultants, designers, translators, teachers and online courses, lawyers, engineers, accountants…), accommodation (hotels, rooms), beauty centres and gyms, travel agencies, sole traders exempt from VAT because of their turnover, and the other cases of article 1 of the decision. Such businesses issue their receipts from their own software and send every one of them to myDATA through the ERP channel, within 5 days.

**Who it is not for:** if you sell goods to consumers, Greek law (ν.4308/2014, art. 12 par. 8 and 10) requires a fiscal device (ΦΗΜ) or a licensed e-invoicing provider for your receipts. This plugin is neither, does not replace either of them, and is not for you. myDATA itself says that an ERP does not replace a ΦΗΜ.

myDATA AADE for WooCommerce sends the receipts of your orders through the official myDATA REST API for ERP users and stores the answer on the order.

* **Step 1 — your ground of exemption**: before anything goes to myDATA production you choose the case of ΠΟΛ.1002/2014 that applies to your business and confirm it. Until then documents go only to the myDATA test environment.
* **Customer's name and address on the receipt**: the customer copy shows them; for the grounds that require them (ΠΟΛ.1002/2014, art. 1 par. 2) a receipt without them is not sent.
* **Service receipt (11.2 ΑΠΥ) or retail receipt (11.1 ΑΛΠ)** — chosen per order: an order of services only (virtual / downloadable products, or products you mark as services) becomes a service receipt.
* **VAT categories from your WooCommerce tax rates**: 24%, 13%, 6%, the island rates 17%, 9%, 4%, and 0% with the VAT exemption reason myDATA requires (per shop, or per product).
* **Income classification (E3)** from the official table of allowed combinations: E3_561_003 for customers in Greece, E3_561_005 inside the EU, E3_561_006 outside it; category1_1 / 1_2 for goods, 1_3 for services, shipping and fees as you choose.
* **Payment methods** per WooCommerce gateway (cash on delivery, bank transfer, cards, IRIS…). Card gateways are sent as a payment account (1) by default, not as POS / e-POS (7): type 7 from an ERP needs the payment signature of a fiscal device.
* **Numbering without gaps** per series (ΑΑ), taken under a database lock; `{YYYY}` in the series starts a new one every year. A document keeps its series, number and date on every retry.
* **Checks before sending**: your ΑΦΜ (with its check digit), amounts, VAT, exemption reasons and allowed classification combinations are checked in the shop; a document that fails never takes a number.
* **Lost answers are handled safely**: if myDATA does not answer, the plugin asks myDATA whether the document arrived before sending it again (and then flags the retry as "loss of connection").
* **MARK, UID and QR code for the customer**: in the order e-mail, on the thank-you page, in My account, and on a printable customer copy. The QR code is generated in your shop.
* **Cancellation in myDATA** (CancelInvoice) from the order screen, and a new document afterwards.
* **Test and production**: start in the myDATA test environment (mydataapidev), switch to production when you are ready.
* **XML preview** of exactly what will be sent, and the XML that was sent.

The XML follows the official AADE schema (InvoicesDoc, myDATA v2.0.x) and was validated against the official XSD files.

= What this plugin is not =

* It is not a fiscal device (ΦΗΜ) and not a licensed e-invoicing provider (πάροχος), and it does not replace either of them.
* It does not decide whether your business may issue receipts this way: that depends on ΠΟΛ.1002/2014 and is your and your accountant's decision.
* Invoices to Greek businesses and to customers outside the EU fall under the mandatory e-invoicing of decision A.1128/2025: they are issued through a licensed provider or timologio of AADE.

Please check with your accountant your ground of exemption, the VAT exemption reasons and the classifications you use.

= Free and Pro =

Free:

* Retail and service receipts (11.1 / 11.2) sent to myDATA with one click in the order screen
* VAT categories, exemption reasons, income classification, payment methods
* Numbering, checks, safe retries, cancellation
* MARK and QR code in e-mails, thank-you page, My account and the customer copy
* Test and production environments, XML preview


== Frequently Asked Questions ==

= I sell products to consumers. Can I use this plugin instead of a cash register? =

No. For retail sales of goods Greek law requires a fiscal device (ΦΗΜ) or a licensed e-invoicing provider (ν.4308/2014, art. 12). Sending receipts from an ERP does not replace them (myDATA FAQ E37), and ΠΟΛ.1002/2014 has no exemption for e-shops. This plugin is for businesses that are exempt from the ΦΗΜ.

= Which businesses are exempt from the ΦΗΜ? =

Those listed in article 1 of ΠΟΛ.1002/2014: among others liberal professions (programmer, consultant, designer, translator, teacher, lawyer, engineer, accountant…), accommodation, beauty centres and gyms, schools, clinics and doctors, travel agencies, car rental, transport of goods, construction works, sole traders exempt from VAT because of their turnover and farmers under the flat-rate VAT scheme. Some of them must show the customer's name and address on the receipt. Your accountant confirms which case is yours; the plugin asks you to choose it and confirm it before it sends anything to production.

= Why are card payments not sent as "POS / e-POS" (7)? =

A type 7 payment sent from an ERP must carry the ECRToken, the payment signature of a registered fiscal device (myDATA REST API v2.0.2, §5.2). A business without a ΦΗΜ does not have it, so card gateways are sent as 1 (payment account in Greece) by default. You can choose another type per gateway, or not send the payment method.

= Where do I get the user name and the subscription key? =

Production: in myDATA, "Registration to the myDATA REST API", after logging in with your TAXISnet credentials. Test: at mydata-dev-register.azurewebsites.net. The two environments have separate accounts.

= Which myDATA document types are used? =

11.1 (retail sales receipt, ΑΛΠ) and 11.2 (service receipt, ΑΠΥ).

= My shop sells to other EU countries at their VAT rates (OSS). =

A rate that is not a Greek VAT rate is not sent until you decide: map the rate to a myDATA category, or choose "send the net amount at 0% with the OSS reason". Ask your accountant how your OSS distance sales are to be reported.

= What happens if myDATA is down? =

The document keeps its number and is marked "no answer". The next attempt first looks the document up in myDATA, and sends it again only if it is not there.

= Does the plugin send data anywhere else? =

Only to the myDATA service of AADE (test or production, as you choose). The QR code is generated on your server.

== Screenshots ==

1. Settings: connection, business, numbering, VAT and classification.
2. The myDATA box on the order screen: status, MARK, checks and actions.
3. The receipt with MARK and QR code in the customer e-mail.

== Changelog ==

= 1.0.0 =
* First release: retail and service receipts (11.1, 11.2) to myDATA (REST API for ERP users, v2.0.x) for businesses exempt from the ΦΗΜ under ΠΟΛ.1002/2014 (confirmed ground required for production), customer's name and address on the receipt, checks, numbering, safe retries, cancellation, MARK and QR code for the customer, English and Greek.
