=== ZATCA E-Invoice for WooCommerce ===
Contributors: adil-elsaeed
Tags: woocommerce, zatca, invoice, saudi arabia, vat
Requires at least: 5.0
Tested up to: 6.9
Stable tag: 2.0.1
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Generate ZATCA compliant invoices with QR codes for WooCommerce orders (Free Version).

== Description ==

ZATCA E-Invoice for WooCommerce is a free WordPress plugin that helps Saudi Arabian businesses generate ZATCA (Zakat, Tax and Customs Authority) compliant **PDF Invoices with QR codes for WooCommerce** orders.

It supports the **First Phase (Generation Phase)** requirements of ZATCA E-Invoicing.

It generates PDF invoices containing all mandatory fields required by ZATCA, including the QR code.
[Check ZATCA Mandatory Fields](https://wooarab.com/?p=6366)

Disclaimer: This plugin is not officially affiliated with or endorsed by ZATCA (Zakat, Tax and Customs Authority).

== Features ==

*   **ZATCA Compliant PDF Invoices:** Generates PDF invoices compatible with ZATCA requirements, including all mandatory fields.
*   **Encrypted QR Code:** Generates a Base64 encoded QR code containing the required TLV (Tag-Length-Value) data (Seller Name, VAT Registration Number, Timestamp, Invoice Total, VAT Total).
*   **Automatic Generation:** Automatically generates the invoice when the order status changes to "Completed" (or any status you configure).
*   **Mandatory Fields Support:** Ensures the invoice contains:
    *   Invoice Reference Number
    *   Invoice Issue Date
    *   Seller Name & Address
    *   VAT Registration Number
    *   Line Items with VAT details
    *   Totals (Net, VAT, Gross)
*   Display QR codes on order emails
*   Display QR codes on My Account orders page
*   Generate PDF invoices with QR codes
*   Support for Arabic/RTL layout
*   HPOS (High Performance Order Storage) compatible
*   Local QR code generation (no external API required)

== Installation ==

1.  Upload the plugin files to the `/wp-content/plugins/zatca-e-invoice-for-woocommerce` directory, or install the plugin through the WordPress plugins screen directly.
2.  Activate the plugin through the 'Plugins' screen in WordPress
3.  Use the Settings → ZATCA E-Invoice screen to configure the plugin
4.  Enter your company name and tax number (15 digits)
5.  Enable QR code generation and PDF invoice generation

== Premium Version ==

Unlock advanced features with the Premium Version:

*   **Credit Notes (Refunds):** Automatically generate PDF credit notes for refunded orders.
*   **Bulk Generation:** Generate invoices for old orders in one click.
*   **Customization:** Add your Company Logo, Custom Header, and Custom Footer to the PDF.
*   **QR Code Size:** Control the size of the QR code.
*   **Priority Support.**

[**Upgrade to Premium Version**](https://wooarab.com/zatca-qr-fatora-woocommerce/)

== Electronic Invoice Phase Two (Integration Phase) ==

This plugin is designed for **Phase One (Generation)**.
If you need full compliance with **Phase Two (Integration)** requirements, which involve XML generation, cryptographic stamping, and direct integration with ZATCA servers, you need our specialized plugin:

**Phase Two Plugin Features:**
*   Full integration with ZATCA portals (Fatoora & Simulation).
*   Generation of XML files compliant with UBL 2.1 standards.
*   Cryptographic Stamp & CSR Generation.
*   Reporting of invoices.
*   PIH (Previous Invoice Hash) chaining.

[**Get ZATCA Phase Two Plugin**](https://wooarab.com/zatca-integration-woocommerce/)

== Frequently Asked Questions ==

= Does this plugin support ZATCA Phase Two? =

No, this plugin supports the **First Phase (Generation Phase)** requirements only (PDF generation + QR Code).
For **Phase Two (Integration Phase)** which requires XML generation and API integration with ZATCA, you need to purchase our specialized plugin:
[ZATCA Phase Two Integration Plugin](https://wooarab.com/zatca-integration-woocommerce/)

= What is ZATCA? =

ZATCA (formerly known as GAZT) is the Zakat, Tax and Customs Authority in Saudi Arabia. This plugin helps you generate invoices that comply with ZATCA requirements for electronic invoicing.

= What is the difference between free and premium versions? =

The free version includes:
*   ZATCA compliant PDF Invoice generation
*   Encrypted QR Code generation
*   Email and My Account display

The premium version includes all free features plus:
*   Credit note PDF generation
*   Bulk invoice/credit note generation
*   Custom company logo on invoices
*   Custom header and footer text
*   Control QR code size
*   Automatic plugin updates
*   Priority support

= Do I need WooCommerce? =

Yes, this plugin requires WooCommerce to be installed and activated.

= What PHP version is required? =

PHP 7.4 or higher is required.

= How do I generate QR codes? =

1. Go to Settings → KSA ZATCA PDF
2. Enter your company name and tax number
3. Enable QR code generation
4. Select order statuses where QR codes should appear
5. Save settings

QR codes will automatically appear on completed orders.

== Screenshots ==

1. PDF invoice with QR code
2. Plugin settings page
3. Admin Order Page with PDF Download button
4. My Account orders page with QR code and PDF Download button

== Changelog ==

= 2.0.1 (2026-06-09) =
* Fixed a fatal error that occurred in the free version due to missing license manager files.

= 2.0.0 (2026-05-20) =
* Major licensing update: Transitioned to Freemius for a better user experience and easier premium feature management.
* Enhanced settings page.
* Important: Existing premium users will be seamlessly migrated to the new licensing system.

= 1.0.1 (2025-12-27) =
* Fixed WordPress plugin repository compatibility issue
* Fixed QR code image in account orders page

= 1.0.0 (2025-12-01) =
* Initial release
* QR code generation for ZATCA compliance
* PDF invoice generation
* Email and My Account integration
* HPOS compatibility

== Upgrade Notice ==

= 2.0.0 =
Major update: We have migrated our licensing and premium features to Freemius. This provides a more robust update and license management experience. Existing premium users will be automatically transitioned.

= 1.0.0 =
Initial release. Upgrade to premium version for advanced features like credit notes, bulk generation, and ZATCA Phase Two integration.

