=== Harvify PDF Invoices for WooCommerce ===
Contributors: jethalal
Tags: woocommerce, invoice, pdf, packing slip, credit note
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 0.14.11
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

PDF invoices and credit notes for WooCommerce, with numbering your accountant can actually check — and an import that continues your existing numbers.

== Description ==

Harvify PDF Invoices attaches a PDF invoice to the order emails WooCommerce already
sends, and issues a credit note whenever you refund.

The part that matters is not the PDF. It is the **numbering**.

= Getting started =

1. Go to **Harvify → PDF Invoices**. The **Settings** screen opens.
2. Under **Invoice numbering**, set the number format: a prefix such as `INV-{year}-`
   and how many digits the number has.
3. Under **Attach to emails**, tick the WooCommerce emails that should carry the
   invoice. Most shops choose the completed-order email.
4. Fill in **Your tax details** so they print on every invoice, then click
   **Save settings**.
5. Open **Diagnostics** to confirm nothing on your server needs attention.
6. Complete an order: the invoice is attached to the email you chose, and the order
   screen's **Harvify documents** section opens it. Refund the order and a credit note is
   issued.

If you are moving from another invoicing plugin, open **Import** first. It continues
your existing numbers instead of starting again at 1.

= Every number is accounted for =

* Numbers are allocated so that **two orders placed at the same moment can never
  receive the same one**. The database itself enforces this, not a lucky read.
* A number is **never reused**.
* A number **never silently disappears**. If a document fails after its number was
  allocated, that number is recorded as **void** — with the reason and the time —
  and stays visible in your numbering audit.

That is a stronger promise than "gapless", and unlike "gapless" it is one that
survives two customers checking out in the same second. The **numbering audit**
screen shows you the whole sequence, per period, with every void explained, and
exports it as CSV. It is the screen you show your accountant.

= Switching from another invoicing plugin =

Most people never move invoicing plugins, because restarting numbering at #1
breaks the sequence their accountant and tax authority expect.

So this one **continues your existing numbers**. The importer reads your current
plugin, shows you a dry run first — *"after import your next invoice will be
INV-2026-0004, the same number you would get today"* — and only then writes
anything. Your historical numbers are preserved exactly as they were, your number
format is adopted, and the old plugin is never modified, so you can compare the two
side by side or back out entirely.

Imports from **WooCommerce PDF Invoices & Packing Slips**, from **WebToffee
(beta)**, or from a **CSV file** of `order_id,invoice_number,invoice_date` — so you
can move from a plugin nobody has mapped, from a spreadsheet, or from a paper book.
If any line of the file cannot be read, nothing at all is imported and every problem
is listed: a half-imported invoice history is worse than none.

The WebToffee route is marked **beta** because it is newly verified: we checked it
against **WebToffee 5.0.1** by having that plugin issue real invoice numbers and then
importing them, so we know it reads what WebToffee actually stores. Older WebToffee
versions we have not tested. The dry run protects you either way — it shows the
numbers you will end up with **before** anything is written, and the import can be
rolled back afterwards.

= Dual run — try it without your customers seeing anything =

Importing your history is one thing; trusting the next real order is another. Turn
on **dual run** and this plugin produces and numbers every document exactly as it
will in production — and attaches none of them to your customers' emails. Your old
plugin carries on sending its own, so customers see no change at all, while you get
a side-by-side table of its invoice number and ours for every order placed since you
started.

It never ends on a timer. When the period you chose is up you are simply told;
nothing reaches a customer until you press the button yourself.

= What you get =

* **PDF invoices**, attached to the WooCommerce emails you choose
* **Credit notes on refund** — one per refund, on their own separate sequence
* Prefix, suffix and zero-padding, with {year} and {month} tokens
* **Yearly or monthly restart** — and earlier periods are never renumbered
* **Numbering audit** — with CSV export
* **Numbers are immutable once issued** — an order edit, a status change or a
  refund never renumbers a document that has already been issued.
* **VOID tracking** — a number is never reused and never silently disappears; a
  failure records a VOID with its reason and timestamp.
* **Import your existing numbers** — from WooCommerce PDF Invoices & Packing
  Slips, WebToffee (beta) or a CSV file — with a dry run, a rollback and a
  dual-run mode
* Multiple tax rates per document, VAT number, reverse-charge note
* **Diagnostics screen** — a live test render, memory headroom, storage,
  numbering health, the language a given order's document will be produced in,
  and font coverage checked against *your own recent orders*, each with the fix
  stated
* **Fonts for non-Latin invoices** — one-click download of the matching Noto
  font, or upload your own
* **Bulk generate and bulk ZIP download** — straight from the Orders list
* **Customer self-service** — your buyers download their own invoice from My
  Account
* **WP-CLI** — regenerate a document, export the numbering audit, check sequence
  status

= Pro — the Harvify Pro Bundle =

* **Visual template designer** — logo, colours, type sizes, page margins, the
  order of the blocks on the page, and your own CSS, with a **live preview that
  is real PDF output** rather than an HTML approximation of one. A save is only
  accepted **if it renders**: if the candidate template throws, the save is
  refused and the documents your customers receive are left exactly as they
  were.
* **More document types** — **proforma invoices**, **delivery notes** and
  **dunning (payment reminder) letters**, plus **packing-slip customisation**:
  retitle it, drop the SKU column, hide the customer note or the shipping
  method, add a footer line of your own. The basic packing slip stays free. The
  three new documents are deliberately **unnumbered** — a quotation that never
  becomes a sale must not consume an invoice number, because a number is never
  reused and a gap is permanent.
* **Bulk generation at scale, and automation** — Pro does not raise the free
  bulk limit, it **queues the work on Action Scheduler**, one order per job, so
  nothing renders inside the request and a run across thousands of orders cannot
  time out. Plus **per-status auto-attach rules** — choose which of
  WooCommerce's own emails carry a document for orders in a given status. Rules
  are evaluated at send time, so switching one off takes effect on the very next
  email rather than after a queue drains.
* **Scheduled accountant export** — a weekly, monthly or quarterly package of
  the numbering audit CSV and that period's documents, delivered to an **email
  address or an FTP server**. Consecutive delivery failures **pause the
  schedule** and say why, on the screen and in Diagnostics — because a monthly
  export bouncing off a dead mailbox for a year is exactly the sort of thing
  nobody notices.
* **Multi-language documents — the language follows the customer, not the
  admin.** — German, French, Spanish, Italian, Dutch, Portuguese and Polish ship
  with the plugin, so documents translate on a shop with nothing else installed;
  WPML and Polylang are honoured when present and never required. A language is
  used only if it can translate **every** string on the document: a page reading
  "Rechnung" above "Subtotal" is worse than English throughout, so the fallback
  is the whole document rather than the missing phrase. The same order produces
  the same language from the order screen, from WP-CLI and from the customer's
  own My Account download.
* **Per-document-type sequences and per-country legal blocks** — where your
  jurisdiction requires sequentially numbered delivery notes, give that type
  **its own series**: it starts at 1 and never draws a number from the invoice
  sequence. And attach the legal wording a given billing country requires,
  printed in the document's notice box rather than buried in footer grey.

= Harvify Pro Bundle =

One subscription unlocks the Pro features of every Harvify plugin. Install only
the tools your store needs.

= What we translate, and what we do not =

The seven bundled languages cover **the wording of the document itself** -- its
headings, its column titles, its totals and its notices. The country name in the
customer's address and WooCommerce's own tax labels come from the WordPress and
WooCommerce language packs, so on a shop that has never installed the German pack
they stay in English however complete our translation is. The Languages screen
tells you which packs this site has. The date is the one thing we handle
ourselves: when a pack is missing it is printed numerically, so it never appears
in the wrong language.

= Non-Latin invoices are refused, not mangled =

The bundled font covers Latin, Greek and Cyrillic. If an order contains Japanese,
Arabic, Hebrew, Thai or Devanagari characters, most plugins render a document full
of empty boxes and nobody notices until a customer complains.

This one **refuses to produce that document**, names the script, and offers you the
font — one click to download it to your own server, or upload your own `.ttf`.

= We never email your customers =

Invoices reach buyers by being attached to WooCommerce's own order emails. This
plugin has no path of its own for sending anything to a customer, so your
existing mail setup keeps working exactly as it does, and a delivery problem
stays a mail-configuration question rather than becoming ours.

There is exactly one thing this plugin sends, and it is not to a customer: the
Pro **accountant export**, which mails your own records to the address you type
in yourself. Nothing about what your customers receive changes.

= What this does not claim =

We generate invoices containing the fields **commonly required** for VAT and GST.
We do **not** claim to make you tax compliant, and you should confirm with your
accountant that the documents meet the requirements in your jurisdiction.

== Installation ==

1. Install and activate. WooCommerce must be active.
2. Go to **Harvify → PDF Invoices → Settings** and choose your number format and
   which emails should carry the invoice.
3. Check **Diagnostics** — it will tell you if anything on your server needs
   attention before the first document is issued.

== Frequently Asked Questions ==

= Will it change my existing invoice numbers? =

No. The importer preserves every historical number exactly, and continues the
sequence from where your current plugin left off. The dry run shows you the next
number before anything is written, and you can roll the import back.

= What happens if two orders are placed at exactly the same moment? =

They receive different numbers. Allocation is enforced by a uniqueness constraint
in the database, so a collision is impossible rather than unlikely.

= Why was my invoice not created? =

Check the Diagnostics screen — it reports the actual cause with the fix. The most
common one is an order containing characters the installed fonts cannot draw, which
is refused deliberately rather than rendered as empty boxes.

= Does it work with HPOS (High-Performance Order Storage)? =

Yes. All order data is read through the WooCommerce CRUD API rather than post meta.

== Screenshots ==

1. Invoice numbering: prefix, padding and restart rules, with the next number
   shown before it is used.
2. The numbering audit — every number accounted for, exportable as CSV.
3. Diagnostics: a live test render, font coverage checked against your own
   recent orders, and the fix for anything that is wrong.
4. Free and Pro, side by side.
5. Customers download their own invoice from My Account, without emailing you
   for it.

== External services ==

This plugin connects to Freemius, the licensing and update service Harvify uses to
sell and deliver the Pro tier of its plugins.

Nothing is sent to Freemius unless you choose to send it. On activation you are shown
Freemius's standard opt-in screen. Until you answer it a fresh install makes no
outbound request at all, and if you choose Skip the free tier stays fully usable
and still sends nothing. Data is transmitted only when you take one of these
actions:

* **You click "Allow & Continue" on the Freemius opt-in screen.** This sends your
  site address, your administrator email address, and your WordPress, PHP and active
  plugin/theme details, so Harvify can provide support and know which environments to
  test against. Skipping that screen sends nothing and leaves the plugin working
  normally.
* **You enter a Pro Bundle licence key.** This sends the key together with your site
  address so the licence can be activated for that site. While a licence is active the
  site also re-checks periodically that it is still valid and whether a Pro update is
  available.

Service provided by Freemius, Inc. - https://freemius.com/
Terms of service: https://freemius.com/terms/
Privacy policy: https://freemius.com/privacy/

= Font downloads (optional, one click per script) =

Invoices render in Latin scripts using fonts bundled with the plugin. If you need
Japanese, Arabic, Hebrew, Thai or Devanagari, the Fonts screen offers to download the
matching Noto font, and that download runs only when you click install for that
specific script.

Sent: a request to raw.githubusercontent.com for the font file itself. Like every
request WordPress makes, it carries WordPress's standard User-Agent header, which
names your WordPress version and your site address, and GitHub sees your server's
IP address. Nothing about your orders or your customers is included.

Fonts are the Noto family, hosted on GitHub - https://github.com/notofonts
Terms: https://docs.github.com/en/site-policy/github-terms/github-terms-of-service
Privacy: https://docs.github.com/en/site-policy/privacy-policies/github-general-privacy-statement

= Accountant export =

The Pro accountant export can upload documents to an FTP server that you configure.
It is part of the Pro tier and is not included in this free download.

== Changelog ==

= 0.14.11 =

* **Admin messages no longer travel in the address bar.** The bulk-action, Fonts and
  Settings screens used to print their message from the URL, so a crafted link could
  show any sentence on those screens. Messages are now kept for the user whose action
  caused them, and shown once.
* **The Diagnostics order lookup now needs a security token and the WooCommerce
  manager capability.** Without both, the lookup is ignored.
* **`wp harvify-pdf export-audit --file` only writes to the plugin's protected folder**
  in your uploads directory. Only the file name you give is used.
* The document translations used by Pro are no longer included in the free plugin.
* Readme: a formatting error in the feature list is fixed, and a Getting started
  section is added.

= 0.14.10 =

* **Fixed: the PDF Invoices settings screen could not be opened on a site with no
  other Harvify plugin.** The menu was registered too late to be built, so
  WooCommerce stores that installed only this plugin saw "Sorry, you are not
  allowed to access this page" instead of the settings.

= 0.14.9 =

* **Fixed: deleting the plugin with "delete data on uninstall" switched on now
  removes all of its settings.** Twelve options survived an opted-in delete, among
  them the main settings, the importer's saved state and, on Pro, the accountant
  export's stored secret. Generated PDF files and the invoice numbers recorded on
  your orders are still always kept, as the setting says. With the setting off
  (the default) nothing is removed, as before.
* Fixed: the External services section and the Fonts screen now say exactly what
  a font download sends. The request goes to raw.githubusercontent.com and carries
  WordPress's standard User-Agent, which names your WordPress version and site
  address. It was previously described as sending nothing about your site.
* Changed: the External services section now describes the Freemius opt-in screen
  shown on activation. Until you answer it a fresh install makes no outbound
  request, and choosing Skip keeps the free tier fully usable and sends nothing.
* Fixed: two lines on the Pro panels promised more than Pro does. Pro numbering
  gives each document type its own prefix (padding and the reset period follow
  your invoice settings), and the Automation screen lists recent background
  failures rather than showing progress.

= 0.14.8 =

* Added: a single **Support** entry in the Harvify menu, so you can reach us from
  inside WordPress. Until now no plugin offered a contact route at all. One entry for
  the whole suite rather than one per plugin.
* No behaviour changes.

= 0.14.7 =

* Added: an **External services** section to this readme, naming every third-party
  service the plugin can contact, exactly what is sent, when, and each provider's terms
  and privacy policy. Required for WordPress.org submission.
* Changed: the `Contributors` field now names the correct WordPress.org account.
* No behaviour changes.

= 0.14.6 =

* Fixed: deactivating or deleting the plugin now cancels queued document
  generation and the scheduled accountant export. A bulk run could leave one
  queued job per order behind, each firing against a plugin that was no longer
  active.

= 0.14.5 =

* Fixed: a delivery note, proforma invoice or payment reminder printed itself as a
  "Packing slip" when that document type had been switched off in the settings. The
  heading was looked up in the list of ENABLED documents, so turning one off left the
  document with no name of its own. On a German shop the note went out headed
  "Packzettel". What a document is CALLED no longer depends on whether it is
  currently OFFERED.
= 0.14.4 =
* Added: a single **Manage licence** link on the Plan screen, so an active customer can
  deactivate this site, change their licence key or re-check their licence without
  needing a URL from support. No per-plugin Account tab is added.
= 0.14.3 =
* **Fixed: updating the plugin did not update its database.** WordPress only runs a plugin's
  setup routine when you *activate* it, never when it updates — so a change to the plugin's own
  tables never reached sites that had simply updated. On those sites some features failed with a
  database error. The update now applies itself on the next page load.
* **One upgrade link instead of one per plugin.** With several Harvify plugins active the
  menu showed a row called "Upgrade" for each of them, all identically labelled, and it kept
  saying Upgrade to people who had already bought. They are replaced by a single **Plan**
  screen that says what the bundle costs, what it covers, and whether your licence is active.
* **The dashboard is quiet again.** Each plugin used to add its own "opt in to make this
  better" notice to the main WordPress dashboard, so five plugins meant five notices. Harvify
  plugins now share one queue: promotional notices appear only on Harvify's own screens, and
  only one at a time. Licence and account messages are never held back.
* **Fixed: the "Data & uninstall" box covered the page.** It was being drawn into the admin
  footer, which WordPress pins to the bottom of the screen, so it floated on top of whatever was
  underneath it. It now sits in the page like any other card. Saving it also tells you what it
  saved, instead of just reloading.
* **Fixed: the upgrade screen advertised the wrong number of sites.** Several plugins listed
  the Freelancer and Agency plans as covering 5 and 25 sites. They cover 3 and 10.

= 0.14.2 =
* **Deleting the plugin can now clean up after itself.** It previously had no uninstall routine
  at all, so its options stayed in your database forever with no way to remove them. A new
  **Data & uninstall** control on the plugin's own screen lets you opt in to a full cleanup; the
  default is to keep everything, so nothing changes unless you ask for it.

= 0.14.1 =
* **The plugin now looks like the rest of the Harvify suite.** Its screens were plain
  WordPress settings markup dropped onto the grey admin background -- no card, labels stranded
  in a narrow column -- under a Harvify header, so it read as a different product bolted on.
  Every section is now inside the same card the other twelve plugins use, with grouped
  headings, matching inputs and readable help text.
* **Fixed: PRO badges were shown on the tabs even when your licence was active.** On a paid
  site those screens are simply yours; labelling them PRO read like being sold something you
  had already bought. The badges now appear only while a feature is locked.
* Wide tables (numbering audit, diagnostics) scroll inside their card instead of pushing the
  page sideways.

= 0.14.0 =
* **You can now see that a Pro tier exists.** This plugin had no Pro visibility at all: the
  paid screens are registered by the Pro code, so on the free build they simply were not
  there. A free user saw five tabs, nothing labelled Pro, and no way to find out what the
  paid tier does or what it costs -- from inside the plugin, the paid tier did not exist.
* Every Pro feature now has a tab in the free build, marked **PRO**: Template, Documents,
  Numbering & legal, Automation, Languages and Accountant export. Opening one explains what
  the feature does, what you get, and the price -- rather than a blank screen. It never shows
  the working feature.
* New **Upgrade** tab (it becomes **Plan** once licensed, showing that Pro is unlocked as
  part of your Harvify Pro Bundle, with a link to manage the licence).
* A dismissible upgrade card on the free working screens. Dismiss it and it stays dismissed.
* The plugin now uses the shared Harvify admin design the other twelve plugins use: branded
  header, Free/Pro plan pill, and the section nav. The shared packages it already expected
  were never actually bundled with it, so none of that had been loading.
* Fixed: with all twelve tabs present the section nav ran off the right-hand edge of the
  window and the last tab could not be reached without scrolling the whole page sideways.
  It now wraps onto a second row.
* Fixed: WordPress admin notices were being drawn inside the plugin's header panel.


= 0.13.3 =
* **Fixed: the WebToffee importer read the wrong fields and would have found nothing.** It looked
  for meta keys that no version of WebToffee writes, so on a real WebToffee shop it would have
  reported an empty history — and that shop would have restarted its invoice numbering at 1,
  which is the exact thing this importer exists to prevent. Checked against WebToffee 5.0.1 by
  having that plugin issue real invoice numbers and reading back what it stored, the importer now
  reads the right fields, understands that WebToffee keeps only a finished (prefixed and padded)
  number, and reads its invoice date correctly.
* The **WebToffee** source is now offered on the Import screen, marked **beta** while it is newly
  verified: 5.0.1 is checked, older versions are not. The dry run shows you the numbers you will
  end up with before anything is written, and the import can be rolled back.

= 0.13.2 =
* Documentation: the Pro features are now described in the plugin description. The template
  designer, the extra document types, queued bulk generation, the scheduled accountant export,
  multi-language documents and per-country legal blocks were all built, drilled and shipped --
  but they appeared only in this changelog, so nobody reading the description ever learnt the
  plugin does them. No code changed.

= 0.13.1 =
* Fixed: the Pro accountant-export download now reads its package through WordPress's own
  filesystem layer, like every other download in the plugin. It was the one route still using a
  direct PHP call, under a suppression comment that named a rule which does not exist — so the
  suppression did nothing and the call was flagged.
* Housekeeping: "Tested up to" moved to WordPress 7.1.

= 0.13.0 =
* **Pro: a visual template designer.** Colours, logo, type sizes, page margin, the order your document's blocks appear in, and your own CSS -- with a **live preview that is the real PDF**, produced by the same engine that makes your invoices, drawn from one of your own real orders.
* **Pro: a template that does not render is not saved.** Every save is checked by producing a real document with it first. If that fails, the save is refused and the template you are using stays in use -- you cannot break your invoices by pressing Save.
* **Pro: blocks can be reordered but never removed.** Each one carries something an invoice needs, and a stored layout that is damaged or out of date is repaired on the way to the document rather than producing an invoice with no totals.
* **Pro: a large logo cannot break your invoices.** Images are re-encoded and scaled down before they are stored.
* **Pro: low contrast is pointed out, not blocked.** If your text colour is hard to read the screen says which pair and what the ratio is, and leaves the decision to you -- quiet text is sometimes exactly what you want.
* **Pro: restore the default template at any time.** The shipped template is part of the plugin rather than a saved copy of one, so restoring always works.

= 0.12.0 =
* **Pro: scheduled accountant export.** Sends your invoice records to your accountant on a schedule -- the numbering audit for the period plus the documents issued in it, in one ZIP, by email or FTP. Each package covers the period that has just ENDED, because half a month is not something an accountant can file.
* **Pro: the audit and the documents reconcile.** Every issued number in the CSV says whether its PDF is in the package, so a number without an enclosed document arrives explained instead of queried.
* **Pro: a forgotten schedule stops itself.** Three consecutive delivery failures pause it, the reason is recorded, and Diagnostics says plainly that nothing is being sent. Switching the export off stops it immediately rather than after whatever was already queued.
* **Pro: your FTP password is never shown back to you.** The field is always blank and blank means "keep it"; the password is stored outside the settings, is never written to the run log or any error message, and appears in nothing this plugin can hand to a support request.
* Google Drive and Dropbox are deliberately not offered -- they would mean us running an OAuth application over your customers' invoices.

= 0.11.0 =
* **Pro: documents in your customer's language.** Seven languages ship with the plugin -- German, French, Spanish, Italian, Dutch, Portuguese and Polish -- and the language follows the CUSTOMER, not whoever is looking at the screen. The same order comes out in the same language from the order screen, from WP-CLI, and from the customer's own download in My Account.
* **Pro: a language is used only if the whole document can be translated.** If a single phrase is missing, the entire document is produced in English instead. Half-German-half-English is worse than English, so we never produce one. The Languages screen shows the coverage for each language and names any phrase that is holding one back.
* **Pro: no translation plugin required.** The translations are ours and work on a shop with nothing else installed. WPML and Polylang are used WHEN PRESENT -- for the order's language and for translated product titles -- and are never needed.
* **Pro: the billing country can supply the language** when nothing else knows it. Only for countries with one obvious language: Belgium, Switzerland, Canada and Luxembourg are deliberately left alone, because guessing there gets it wrong for real customers.
* **Diagnostics now reports which language a given order's document will use**, and where that language came from -- so you see it before your customer does. There is a box on the screen to ask about any order.
* Dates on a translated document are shown numerically when your site does not have that language's WordPress pack installed, so an English month name never appears on a German invoice.

= 0.10.0 =
* Pro: bulk generation at scale. With the background queue on, a bulk run is no longer capped at 100 orders — each order becomes its own background job, so the run finishes whatever its size and nothing happens in your browser request. The free limit is unchanged.
* Pro: attach by order status. Choose which of WooCommerce's own emails carry the invoice, per order status. Nothing is attached until you tick something, and unticking takes effect on the very next email.
* Fixed: one invoice number per order is now enforced by the database, not by a check in code. Two workers generating for the same order at the same instant could each allocate a number — no duplicate number was ever issued, but the order could end up with a second number recorded against it in the numbering audit. Found by a test that injects a genuine race.
* If your site already carries that footprint, nothing is changed behind your back: Diagnostics and the numbering audit both name the affected orders, and `wp harvify-pdf reconcile-numbers --dry-run` shows what reconciling would do. Reconciling keeps the number your customer's invoice actually shows and marks the other VOID with a reason — nothing is deleted.

= 0.9.0 =
* **Pro: give a document its own numbers.** Some countries require delivery notes to carry
  their own sequential number. Switch it on and that document gets a sequence of its OWN,
  starting at 1, with its own prefix — it never takes numbers from your invoice series, and
  your next invoice number does not move.
* Switching it back off stops new documents being numbered. Numbers already issued stay
  exactly as they are: a number that has been given out is never reused and never quietly
  disappears.
* **Pro: country legal text.** Wording printed on documents for customers billed in a
  particular country — a reverse-charge note, a local tax statement. Chosen by the billing
  country, printed in a boxed panel at readable size rather than buried in the small print,
  and shown alongside (not instead of) a proforma's own statement.
* Fixed: if a document's numbering was switched on but its sequence table was missing — after
  a restored backup or a site clone, for example — the screen could show a raw database error.
  It now repairs the table when you open the screen.

= 0.8.0 =
* **Pro: more documents.** A **proforma invoice**, a **delivery note** and a **payment
  reminder**, alongside the invoice and packing slip. Each can be switched on or off.
* None of them takes an invoice number. A proforma is a quotation, not a sale — numbering one
  would use up a real invoice number for an order that may never happen, and numbers are never
  reused. The proforma says plainly that it is not a VAT invoice and that no payment is due
  against it.
* **Pro: packing-slip appearance.** Retitle it, hide the SKU column, hide the customer note or
  the shipping method, and add your own footer line. The packing slip itself stays part of the
  free plugin — only these options are Pro.

= 0.7.0 =
* **WP-CLI commands.** `wp harvify-pdf regenerate <order>...` re-renders a document under
  the number it already has — useful after a restore, a tidied uploads folder or a template
  fix. It never issues a new number for an order that already has one.
* `wp harvify-pdf export-audit` writes the numbering audit as CSV to standard output, or with
  `--file=<name>` to the plugin's protected folder in your uploads directory, for invoices or
  credit notes. It is the same export the Numbering audit screen
  produces, built by the same code.
* `wp harvify-pdf status` shows where each sequence stands, with issued and void counts.

= 0.6.0 =
* **Customers can download their own invoice** from My Account — an Invoice button on their
  order list and a download on the order page. A customer only ever sees their own orders,
  and the button appears only once the invoice exists.
* Opening an invoice never creates one, so a customer visiting the page cannot cause a
  document number to be issued for an unfinished order.
* Can be switched off entirely on the Settings screen.
* Fixed: an error message on the Fonts screen was displayed with all of its spaces removed,
  making it very hard to read. (Same cause as the Settings-screen fix in 0.5.0; the whole
  plugin was checked for other instances.)

= 0.5.0 =
* **Bulk actions on the Orders list.** Select orders and choose *Generate invoices*, or
  *Download invoices (ZIP)* to get them all in one archive. Files inside the archive are
  named after the invoice number, so they are easy to find.
* Orders that already have an invoice **keep the number they were given** — a bulk run never
  re-issues a number, and the result tells you how many kept theirs.
* Works on both WooCommerce order storage modes, and on servers without PHP's ZIP extension.
* Fixed: a warning message on the Settings screen was displayed with all of its spaces
  removed, making it very hard to read.

= 0.4.0 =
* **Dual run** — try this plugin without your customers seeing anything. Every document is
  produced and numbered exactly as it will be in production, and none of them are attached
  to your customers' emails; your old plugin carries on sending its own. You get a
  side-by-side table of its invoice number and ours for every order placed since you
  started, so you can check the numbering before you commit to it.
* Dual run **never ends on a timer.** When the period you chose is up you are told, and
  nothing changes until you press the button yourself — because that button is the moment
  customers start receiving documents from this plugin.
* Your old plugin is never modified, switched off, or stripped from an email. Dual run only
  decides what *this* plugin attaches.
* While dual run is on, a banner on every screen of the plugin says so, so it cannot be
  forgotten.

= 0.3.0 =
* **The importer now has a screen.** It could be reached from nowhere in the admin
  before this release, so nobody could actually use it. It lives under
  PDF Invoices → Import: it tells you which of your plugins it found invoice history
  in, shows the dry run, and only writes when you press Import. Undo is there too.
* **Import from a CSV file** — three columns, `order_id,invoice_number,invoice_date`,
  with an optional heading row. Semicolon-separated files (the ones Excel writes in
  much of Europe) are read correctly. If any line cannot be read, nothing at all is
  imported and every problem is listed with its line number.
* An optional **"next number"** you can set alongside a CSV, for when your sequence
  has moved on since the file was made. It can only move numbering forward.
* Fixed: two different files with the same number of rows and the same highest
  invoice number could be mistaken for one already imported, so the second import
  did nothing while reporting success.

= 0.2.0 =
* Your licence is now manageable from the plugin itself. The Account screen was previously
  hidden, which also hid **Deactivate License** — so a licence could not be released from one
  site to move it to another without contacting support. It is visible again, along with the
  licence key, plan, Sync and Change License.
* The repeated *"Opt in to make … better!"* admin notice no longer appears. Licence, plan and
  update notices are unaffected — only the opt-in prompt is suppressed.
* Packing slips (free). A packing slip for every order, from the Documents column on
  the Orders list and from the order screen: delivery address, items, SKU and
  quantity, the customer's note — and deliberately no prices, no tax and no totals,
  so it is safe to put in a gift or drop-shipped order. Packing slips carry no
  document number and never consume one; they are rebuilt each time you open one, so
  they always match the order as it stands. Optionally attachable to a WooCommerce
  email (off by default).
* Fixed: regenerating an invoice could issue it a SECOND number and overwrite the
  first. It now always reuses the number already issued, including when the PDF file
  itself has gone missing from uploads.
* WooCommerce HPOS (custom order tables) compatibility is now declared.

= 0.1.0 =
* Initial development release: PDF invoices attached to WooCommerce emails; credit
  notes on refund with an independent sequence; concurrency-safe numbering with void
  tracking and a numbering audit with CSV export; yearly/monthly restart with
  `{year}`/`{month}` tokens; import from WooCommerce PDF Invoices & Packing Slips
  with dry-run preview, format adoption and rollback; font coverage detection with
  one-click Noto download and manual upload; diagnostics self-check.

== Upgrade Notice ==

= 0.9.0 =
Pro adds per-document numbering (delivery notes can have their own sequence) and
per-country legal text on documents.

= 0.8.0 =
Pro adds proforma invoices, delivery notes and payment reminders, plus packing-slip
appearance options.

= 0.7.0 =
Adds WP-CLI: regenerate a document, and export the numbering audit.

= 0.6.0 =
Customers can now download their own invoice from My Account.

= 0.5.0 =
Adds bulk generate and bulk ZIP download from the Orders list.

= 0.4.0 =
Adds dual run: produce and number every document for real while your customers keep
receiving your old plugin's invoices, and compare the two before you commit.

= 0.3.0 =
The importer is now reachable from the admin — it was not before — and can read a
CSV file as well as WooCommerce PDF Invoices & Packing Slips.

= 0.2.0 =
Adds free packing slips, and fixes an invoice-renumbering bug — update before
regenerating any invoice.

= 0.1.0 =
First development release.

== Credits ==

This plugin bundles the following open-source libraries. Each ships with its own
licence file inside the plugin's `vendor` directory.

* **Dompdf** (LGPL-2.1) — HTML to PDF rendering. https://github.com/dompdf/dompdf
* **php-font-lib** (LGPL-2.1-or-later) and **php-svg-lib** (LGPL-3.0-or-later),
  by the Dompdf project
* **Masterminds HTML5** (MIT) — HTML parsing
* **Sabberworm PHP CSS Parser** (MIT) — CSS parsing
* **DejaVu Sans** — bundled font, released under a permissive
  Bitstream Vera / Arev derived licence

Noto fonts, offered as an optional one-click download, are published by Google
under the SIL Open Font License 1.1 and are downloaded to your own server. They are
not bundled with this plugin.
