=== Prize Draw Profit for WooCommerce ===
Contributors: thelotterycfo
Tags: prize draw, competition, raffle, lottery, profit
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 0.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

See what each prize draw, competition or raffle really made: ticket money, VAT, card fees, prize cost, free entries and break-even.

== Description ==

Your competition plugin tells you how many tickets you sold. It doesn't tell you whether the draw made money.

Prize Draw Profit adds one report under **WooCommerce → Draw P&L**. For every draw it shows:

* **Paid tickets sold** and the money they brought in, after discounts. Refunds made against the ticket line are subtracted, and fully refunded orders are left out.
* **Free and postal entries**, as a number and as a share of all entries.
* **Profit two ways.** On HMRC's view, once you're VAT-registered (or must register), paid prize-draw entries are standard-rated, so one sixth of every ticket is VAT. The exempt view shows where you'd stand without it.
* **Card fees**, using your own rate (for example 1.5% + 20p per order).
* **Break-even:** how many paid tickets the draw needs at the average price players actually paid, and what share of the paid places that is. If a draw can't break even even when every paid place sells, it says so.
* **Pace for live draws:** how many tickets you'll have sold by the end date at today's rate, in red if that's short of break-even.
* **The £90,000 VAT registration line:** ticket money from your draws for the last 12 months against the threshold. Add any other taxable sales you make.

You type in the prize cost and any other costs for each draw. Everything else is read from your shop.

= What it stores, and what it doesn't =

It never edits your orders, prices, stock or competition settings. The only things it saves are your card-fee rate, the costs you type in and the draw fields you tick on a product. Those are removed if you delete the plugin. It doesn't send any data anywhere: the figures are worked out on your own site each time you open the report.

= Works with =

* **WooCommerce Lottery** (wpgenie). Relisted draws on the same product are split into separate draws, each with its own orders and costs.
* **WPHostee Competitions for WooCommerce**, including postal entries recorded with WPHostee Pro.
* **Any WooCommerce product**: tick "This product is a draw" on the product and enter the number of places and the dates.

You can always type in the number of free entries yourself.

Works with both WooCommerce order storage types (HPOS and the classic posts table).

= Not tax advice =

The figures are estimates to help you plan and price draws. HMRC treats paid prize-draw entries as standard-rated. Whether they are exempt is being tested at the First-tier Tribunal. Check your own position with a VAT adviser.

Built by The Lottery CFO, 18 years in lottery finance. If you'd like a second pair of eyes on your draws, see [thelotterycfo.com](https://thelotterycfo.com/services).

== Installation ==

1. Install and activate WooCommerce, then this plugin.
2. Go to **WooCommerce → Draw P&L**.
3. Check the card fee rate, then enter the prize cost (and any other costs) for each draw and press **Save and recalculate**.

If you don't use a supported competition plugin, edit a product and tick **This product is a draw** under Product data → General.

== Frequently Asked Questions ==

= Which VAT view should I look at? =

Both. HMRC's current view is that paid entries are standard-rated once you're VAT-registered. If the tribunal finds otherwise, the exempt column shows where you'd stand. A draw that only works in the exempt column relies on a court result nobody can promise.

= Why can the exempt view be lower than HMRC's view? =

If the VAT on a prize can be reclaimed, that only happens on HMRC's view. A business making only exempt sales can't reclaim it, so the prize costs more in the exempt column.

= Why is break-even shown as a share of paid places? =

Free entries take places in the draw but bring in no money. If a draw has 20,000 places and 1,000 free entries, only 19,000 places can be paid for. Break-even is measured against those.

= What counts as a sale? =

Orders with the status Processing or Completed. Refunds made against the ticket line are subtracted, and fully refunded orders are left out. A refund entered only as an amount, not against the line, isn't picked up unless it refunds the whole order. When WooCommerce Lottery refunds a failed draw and that was the whole order, the order is marked Refunded and left out; in a mixed basket that refund isn't picked up. Cancelled, failed and pending orders are ignored. Developers can change the statuses with the `drawpnl_paid_statuses` filter.

= One order has tickets for several draws. How are card fees counted? =

The fixed fee per order is counted once for each draw in that order, so mixed baskets can show slightly higher fees than you actually paid.

= Does it slow down my shop? =

No. It only runs when you open the report in the admin area; your shop's pages aren't affected.

= What happens if I delete the plugin? =

Its settings, the costs you typed in and the draw fields on products are removed. Your orders, products and competitions are not touched.

== Screenshots ==

1. The Draw P&L report: profit on HMRC's view and the exempt view, break-even and pace for each draw.

== Changelog ==

= 0.1.0 =
* First release.
