=== Virtevo Invoices ===
Contributors: ehristov
Tags: invoice, pdf, billing, receipt, orders
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.5
WC requires at least: 6.0
WC tested up to: 9.5
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Automatic PDF invoice generation for online stores. Clean, professional, lightweight.

== Description ==

**Virtevo Invoices** generates professional PDF invoices for your orders automatically. No configuration overload — just install, set your company details, and invoices start generating.

= Free Features =

* **Automatic PDF generation** — invoices created on order status change (processing / completed)
* **Sequential invoice numbering** — fully configurable prefix, format and padding (e.g. INV-2025-0042)
* **Professional basic template** — clean, A4, printer-ready
* **Download from admin** — one click from the order list or order detail page
* **Customer download** — optional link on My Account > Order Details
* **Custom company details** — name, address, VAT/EIK, email, phone, footer note
* **Custom numbering format** — use tokens: `{prefix}`, `{year}`, `{month}`, `{seq}`, `{order}`
* **HPOS compatible** — works with both legacy and High-Performance Order Storage

= Pro Features =

* 3 additional premium templates (Modern, Minimal, Corporate)
* **Auto-send** invoice PDF as email attachment on order status change
* **Bulk export** — download multiple invoices as a ZIP archive from the orders list
* Custom logo on invoices
* Remove "Generated by Virtevo Invoices" branding
* Priority support

[Upgrade to Pro →](https://virtevo.bg/invoices?ref=wp-org-readme)

= Designed for simplicity =

Virtevo Invoices focuses on doing one thing well: generating clean, correct PDF invoices with minimal configuration. Install it, enter your company details, and invoices start generating automatically.

= Developer friendly =

* PSR-4 autoloading
* Clean hooks: `vinv_invoice_created`, `vinv_available_templates`
* Template overrides via your theme: `your-theme/virtevo-invoices/{template-name}.php`
* `Invoice_Manager::get_or_create( $order_id )` — get invoice data programmatically


== External Services ==

This plugin connects to the following external services:

= Freemius =
This plugin uses the [Freemius](https://freemius.com) SDK for licensing and updates. Upon activation, Freemius displays an opt-in dialog asking for your permission before any data is collected. No data is sent without explicit user consent.

- Service URL: https://freemius.com
- Privacy Policy: https://freemius.com/privacy/
- Terms of Use: https://freemius.com/terms/

Data collected (only after opt-in): WordPress version, PHP version, plugin version, site URL. No personal data is shared without consent.

== Installation ==

1. Upload the plugin to `/wp-content/plugins/virtevo-invoices` or install via the WordPress plugin directory
2. Activate the plugin
3. Go to **Settings → Virtevo Invoices** and enter your company details
4. That's it — invoices will be generated automatically for new orders

== Frequently Asked Questions ==

= Does it work with HPOS? =
Yes. Virtevo Invoices supports both legacy CPT orders and High-Performance Order Storage (custom order tables).

= Can I customise the invoice template? =
Yes. Copy `templates/free/basic.php` to `your-theme/virtevo-invoices/basic.php` and edit freely. The Pro version includes 3 additional premium templates.

= Can customers download their invoice? =
Yes. Enable "Customer Download" in settings and a download link appears on the My Account > Order Details page.

= Will it regenerate invoices I already issued? =
No. Each order gets exactly one invoice number, assigned once and never changed. Regenerating the PDF always uses the same number.

= Is the PDF library included? =
Yes. The plugin bundles a pre-built copy of dompdf for PDF rendering. No additional libraries needed.

= Does it support multi-currency? =
Yes. Invoices use the currency stored on each order.

= Can I change the invoice number sequence? =
Yes. Go to Settings → Virtevo Invoices → Numbering. You can change the prefix, format, padding and start number. The counter resets automatically each year.

== Screenshots ==

1. Admin settings — General tab
2. Admin settings — Numbering tab
3. Generated invoice PDF — Basic template

== Changelog ==

= 1.0.5 =
* Updated dompdf to 3.1.5

= 1.0.4 =
* PDF template CSS embedded as static HTML — no dynamic PHP output inside style tag

= 1.0.3 =
* Fixed sanitization: company_email now uses sanitize_email(), logo_url uses esc_url_raw()
* Added external services disclosure for Freemius SDK in readme

= 1.0.2 =
* Unified function/constant prefix to virtin_ for wp.org compliance
* Updated dompdf to 3.0.2
* PDF template CSS extracted to separate file

= 1.0.1 =
* Initial release

== Upgrade Notice ==

= 1.0.5 =
Initial release.
