=== Faro Receipt & Invoice PDF for WooCommerce ===
Contributors: kazukiyamashita80
Tags: woocommerce, receipt, invoice, pdf, japan
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Requires Plugins: woocommerce
Stable tag: 1.0.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

WooCommerce の注文から領収書・適格請求書 PDF を発行。マイページから購入者がセルフダウンロードできます。

== Description ==

=== 日本語の説明 ===

**このプラグインが向いている方:** WooCommerce で販売していて、「領収書ください」「適格請求書をください」とメールで対応するのが面倒な店舗オーナー。

**できること:**

注文から **領収書（適格請求書）PDF** をワンクリックで発行します。購入者はマイページから自分でダウンロードできるので、問い合わせ対応が減ります。

**主な機能（無料）:**

* 管理画面の注文詳細から PDF 発行
* マイページ（注文詳細）から購入者がセルフダウンロード（設定でオン/オフ）
* 適格請求書の記載要件に対応（登録番号・税率区分・8%/10% 混在）
* 宛名の入力（マイページで変更可能）
* 2回目以降の発行に「再発行」表示
* 返金済み注文に「返金済み」透かし

**よく使う流れ:**

1. WooCommerce → 設定 → **領収書PDF** で店舗名・登録番号を入力
2. 注文詳細の「領収書 PDF を発行」からダウンロード
3. 購入者はマイページ → 注文詳細 → 宛名を確認 → PDF ダウンロード

**関連プラグイン:**

* [Faro Qualified Invoice Number for WooCommerce](https://wordpress.org/plugins/kazuki-qualified-invoice-number-for-woocommerce/) — 購入者の登録番号をチェックアウトで収集
* [Faro Accounting Export for WooCommerce](https://wordpress.org/plugins/kazuki-accounting-export-for-woocommerce/) — 注文を弥生・freee・MF 形式でエクスポート

---

**Who this is for:** WooCommerce shop owners in Japan who need receipt and qualified invoice PDFs with proper tax breakdown (8% / 10%).

**What it does:**

Generate a PDF receipt from any order. Customers can download from My Account. Includes issuer registration number, tax-by-rate table, and re-issue marking.

**Disclaimer:** This plugin does not provide tax or accounting advice. Review PDFs before sending to customers.

**Third-party libraries:** Bundled [TCPDF](https://tcpdf.org/) 6.10.1 (LGPL-3.0) for PDF generation. Loaded only when generating a PDF; skipped if another plugin already loaded a compatible TCPDF version. No external API calls.

**Enjoying this plugin?** [Leave a review on WordPress.org](https://wordpress.org/support/plugin/faro-receipt-invoice-pdf-for-woocommerce/reviews/#new-post) — thank you.

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/`.
2. Activate through the Plugins menu.
3. Ensure WooCommerce is active.
4. Configure under WooCommerce → Settings → 領収書PDF.

== Frequently Asked Questions ==

= Does this replace an accountant? =

No. It generates PDFs from order data. Have your accountant review before use.

= Can customers download receipts themselves? =

Yes, if enabled in settings. They enter the addressee name on the order details page in My Account.

= What about mixed 8% and 10% tax orders? =

The PDF shows separate lines per tax rate, as required for qualified invoices.

== Changelog ==

= 1.0.4 =
* Load WooCommerce settings page class only when registering settings (fixes fatal error when WC_Settings_Page is not loaded yet under WP_DEBUG).

= 1.0.3 =
* Remove UTF-8 BOM from all PHP files so declare(strict_types=1) is the first statement.
* Move declare(strict_types=1) to the opening tag of the main plugin file.

= 1.0.2 =
* Upgrade bundled TCPDF to 6.11.3 (latest stable 6.x).
* Rename plugin prefixes from jp_receipt_pdf to faro_receipt_pdf.
* Load TCPDF via bundled config only; defer K_PATH_* setup to tcpdf_config.php.
* Rename classes to Faro_Receipt_Pdf_*.

= 1.0.1 =
* Upgrade bundled TCPDF to 6.10.1.
* Load TCPDF lazily with version checks to avoid conflicts with other plugins.
* Fix PHP strict_types placement in included files.

= 1.0.0 =
* Initial release: receipt PDF, My Account download, qualified invoice fields, re-issue stamp.
