=== Neutrope Japanese Invoice PDFs for WooCommerce ===
Contributors: neutropeinc
Tags: woocommerce, invoice, pdf, japan, japanese-invoice
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Requires Plugins: woocommerce
Stable tag: 1.0.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Generate Japanese-style invoice PDFs from WooCommerce orders. Output from admin and customer My Account. Configure company name, address, and logo.

== Description ==

"Neutrope Japanese Invoice PDFs for WooCommerce" is a free plugin that generates Japanese-style invoice PDFs from your WooCommerce orders. It is designed for shops that need to deliver Japanese business documents (invoices and similar receipts) alongside their WooCommerce store.

= Features (Free version) =

* Invoice PDF generation (title, billing recipient block, line items, totals, consumption tax summary)
* One-click PDF output from the admin Order edit screen
* Customer-side invoice download from My Account (can be toggled on/off)
* Company name, address, and logo configurable from the settings screen
* High-Performance Order Storage (HPOS) compatible
* Japanese-language PDF output powered by mPDF
* Template (`templates/invoice.php`) can be overridden from your theme

= Planned roadmap (no committed timeline) =

The following items are being considered for a future paid version. They are not implemented in the free version and there is no guarantee they will ship.

* Qualified invoice number (Japan invoice system)
* Per-tax-rate display (10% / 8% reduced rate)
* Receipt document
* Bank transfer information
* Payment due date
* Company seal, header note, recipient honorific

The free plugin exposes filters and hooks so the items above can be added by add-on plugins without modifying the core.

== Installation ==

= Server requirements =

* PHP 7.4 or later
* PHP extensions **mbstring** and **gd** (required by the bundled mPDF library)
* WooCommerce 7.0 or later, active

= Steps =

1. Upload the plugin ZIP and activate it. The distribution ZIP already bundles the PDF library and the Japanese font, so `composer install` is not required.
2. Confirm that WooCommerce is active.
3. Open **WooCommerce > Japanese Invoice PDFs** and fill in your company name, address, and logo.
4. Open any order from the admin and click the invoice button in the "Japanese Invoice PDFs" meta box.

For developers: the distribution ZIP excludes `vendor/mpdf/mpdf/ttfonts` via `.distignore`. If you run the plugin from source, run `composer install` first. The distribution ZIP can be rebuilt locally with `powershell -File bin/build-zip.ps1`. CI builds the same ZIP via GitHub Actions.

== Frequently Asked Questions ==

= Is WooCommerce required? =

Yes. The plugin shows an admin notice and disables itself when WooCommerce is not active.

= Can other people download my invoices? =

No. Downloads from My Account require login, ownership of the order is enforced, and a nonce is verified.

= Are PDFs stored on the server? =

No. Every PDF is generated on demand and streamed to the browser, so there are no leftover files that could be linked directly.

= Japanese characters look like garbled text =

The plugin bundles Noto Sans JP (OFL 1.1), so no extra setup is needed. If you still see broken characters, verify that the PHP `mbstring` and `gd` extensions are enabled on your server.

= Amounts display with decimals like "¥2,400.00" =

The plugin follows the WooCommerce currency settings. To hide decimals for JPY, set **WooCommerce > Settings > General > Number of decimals** to 0.

= Recipient name order and the "Japan" suffix in the address =

Name order, honorifics (sama, onchu, etc.) and country labelling are roadmap items. The free version uses WooCommerce default formatting.

= Can I customize the template? =

Yes. Copy `templates/invoice.php` to `wp-content/themes/<your-theme>/neutrope-japanese-invoice-pdfs-for-woocommerce/invoice.php` to override it.

== Screenshots ==

1. Settings screen (WooCommerce > Japanese Invoice PDFs: company name, address, logo).
2. Order edit screen showing the "Japanese Invoice PDFs" meta box with the invoice button.
3. Generated invoice PDF rendered with Japanese typography.
4. My Account order detail showing the customer-facing invoice download.

== Changelog ==

= 1.0.1 =
* Fix: include shipping lines in the invoice PDF. Orders with a shipping cost now show a "送料（配送方法名）" row in the item table so the itemized rows reconcile with the subtotal and total. Zero-cost shipping is not shown; multiple shipping lines are supported.

= 1.0.0 =
* Initial release (free MVP).
* Invoice PDF generation, admin output, My Account download, settings screen, HPOS compatible.

== Upgrade Notice ==

= 1.0.1 =
Invoice PDFs now include shipping lines.

= 1.0.0 =
Initial release.

== Credits / Third-Party Licenses ==

This plugin bundles the following third-party software and fonts.

* mPDF — GPL-2.0-or-later. The PDF rendering engine. https://mpdf.github.io/
* Noto Sans JP — SIL Open Font License 1.1. Used for the Japanese text in the invoice PDF.
  Full license text is bundled at `assets/fonts/OFL.txt`. https://fonts.google.com/noto
  IPA fonts were not adopted because they are not GPL-compatible; OFL Noto Sans JP is used so the bundle stays GPL-compatible.
* DejaVu Sans Condensed — Bitstream Vera Fonts License / Public Domain.
  Four files (DejaVuSansCondensed.ttf / -Bold / -Oblique / -BoldOblique) are bundled because mPDF requires them as the internal sans-serif fallback.
  Full license text is bundled at `assets/fonts/DejaVu-LICENSE.txt`. https://dejavu-fonts.github.io/
