=== CatCode MTD VAT for WooCommerce ===
Contributors: catcodestudio
Tags: vat, vat return, making tax digital, uk tax, 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

Works out the nine boxes of a UK VAT return from WooCommerce orders and keeps purchases and corrections as digital records. Not tax advice.

== Description ==

If your shop is VAT registered in the UK, every return starts with the same job: pulling sales and refunds out of WooCommerce, splitting them by rate and adding the purchases that WooCommerce knows nothing about.

This plugin does that job inside your site. Choose the period and it shows the nine boxes, the sales behind them by VAT rate, and anything it wants you to look at.

**This is a calculation tool, not tax advice.** You are responsible for the figures on your return. If in doubt, ask your accountant.

= What it does =

* Reads orders and refunds by tax date and splits them by VAT rate: box 1, box 3, box 5 and box 6.
* Refunds come off in the period of the refund. A refund entered as a plain amount is split in the proportions of the order, and the screen tells you which ones.
* Records: purchases with VAT, imports under postponed VAT accounting, services bought from abroad under the reverse charge, sales made elsewhere, Northern Ireland movements and corrections. Each entry stays on its own line and goes to the right boxes.
* Standard accounting or cash accounting. Under standard accounting you choose whether the date of payment, completion or the order decides.
* You choose which order statuses count.
* Works with High-Performance Order Storage and classic order storage.
* CSV exports: the return with your business details, every rate and every entry, and one line per order and rate.
<!-- @pro-begin -->

= Pro =

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

* Link the business to HMRC through CatCode's connection with no setup, or through your own application on the HMRC Developer Hub.
* See the open periods with their due dates and send the return after confirming HMRC's declaration. The receipt is kept with the figures as sent.
* Filed returns compared with HMRC's copy, and a warning when orders of a filed period have changed.
* Liabilities, payments and penalty points from HMRC. A warning if HMRC has the business on the Flat Rate Scheme.
* Entries of a filed return are locked.
* Import purchases from CSV.
* E-mail reminders 14 and 3 days before a return is due.

**HMRC decides who gets production access.** Sandbox access is open to anyone with a Developer Hub account. Each application is checked by HMRC before it can touch real data. Until HMRC grants production access to the application in use, your own or CatCode's, you can test against the sandbox only.
<!-- @pro-end -->

= What it cannot do =

* The Flat Rate Scheme and margin schemes need their own calculations and are not worked out.
* Orders that are not in pounds sterling are left out and listed, because the rate you must use depends on your VAT method. Enter them in Records.
* WooCommerce does not know whether a sale with no VAT is zero-rated, exempt or outside the scope of VAT. Those sales go into box 6 in one line per UK and abroad.
* Purchases are not in WooCommerce. Box 4 and box 7 stay empty until you enter them.
* Tax of other countries is not put in box 1. The sale itself is in box 6.
* Boxes 8 and 9 come from Records only.
* Boxes 6 to 9 are whole pounds; the pence are left out.

CatCode is not connected with HMRC. This plugin is not HMRC recognised, approved or accredited.

== Installation ==

1. Install and activate WooCommerce, then this plugin.
2. Go to WooCommerce → MTD VAT → Settings. Enter the business details and check the tax date and the order statuses.
3. Make sure orders are taxed with rates whose country is GB.
4. Add purchases under Records.
5. Open VAT return and choose the period.

== Frequently Asked Questions ==

= Is this tax advice? =

No. It adds up what is in your shop and your records. The return is yours.

= Why are boxes 4 and 7 empty? =

They hold your purchases, which WooCommerce does not have. Add them under Records.

= A customer was refunded after I filed. Do I change the old return? =

No. The refund comes off in the period of the refund.

= Why is a full refund not taken off the original period? =

The sale happened in that period. The refund happened later, and it reduces the later return.

== Screenshots ==

1. The nine boxes for a period, with sales by VAT rate.
2. Records: purchases, imports and corrections.
3. Settings: the business, the tax date and the order statuses.
<!-- @pro-begin -->

== External services ==

The Pro build connects to HMRC, the UK tax authority, only when a person with access to the MTD VAT screens asks it to.

With CatCode's connection, the sign-in and each token renewal also pass through catcode.com.ua, which sends the shop's address and licence key when the site first connects, the one-time sign-in value and the refresh token. catcode.com.ua keeps no tokens and sees no VAT figures. Filing and all other calls go straight from this site to HMRC. Entering your own HMRC application's client ID and secret turns this off.

* What: HMRC's VAT (MTD) API and its OAuth sign-in, at api.service.hmrc.gov.uk and www.tax.service.gov.uk, or test-api.service.hmrc.gov.uk and test-www.tax.service.gov.uk for the sandbox.
* Why: to link the business, read open periods, send VAT returns and read liabilities, payments and penalties.
* What is sent: the VAT registration number, the figures of the return, and the fraud prevention data the law requires with each call: the IP address and port of the staff member's device, browser user agent, screen and window size, time zone, a device ID kept in the browser, their login name on this site, a hash of the licence key, the site's public IP and the versions of the software.
* Terms and privacy: [HMRC privacy notice](https://www.gov.uk/government/organisations/hm-revenue-customs/about/personal-information-charter), [GOV.UK terms and conditions](https://www.gov.uk/help/terms-conditions).

The Pro build also talks to catcode.com.ua to check the licence and offer updates, sending the key and the site address.
<!-- @pro-end -->

== Changelog ==

= 1.0.0 =
* First release.
