=== POP – European e-invoicing compliance for e-commerce ===
Contributors: popdev, Picaland, mirkolofio, babinimazzari
Tags: e-invoicing, fattura elettronica, fatture, fattura xml, fatturazione elettronica
Requires at least: 4.6
Tested up to: 7.0
Stable tag: 6.9.8
Requires PHP: 7.4
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Automate European e-invoicing for e-commerce: generate XML & PDF invoices, send via SdI and PEPPOL, manage compliance with API credits.

== Description ==
POP is an e-invoicing compliance plugin for WooCommerce, Paid Memberships Pro and Cozmos PMS. It helps European e-commerce teams generate structured XML invoices, manage invoice documents and connect their workflows to supported e-invoicing networks such as SdI, PEPPOL and KSeF.

POP focuses on the full e-invoicing lifecycle: document generation, data validation, network submission and, where enabled by the selected plan and workflow, digital signature and compliant archiving.

With POP you pay a subscription and receive a monthly allocation of API credits. A credit is the unit used to measure credit-consuming API operations, such as generating or validating XML, submitting a document to a supported network, applying digital signature or activating compliant archiving when enabled.

The principle is simple: your e-commerce can automate compliance workflows while keeping monthly usage predictable.

= Supported countries and workflows =
POP supports selected European e-invoicing workflows, depending on the country, endpoint, selected plan and configured integration.

= Italy and San Marino =
POP supports structured XML invoice generation for Italy and San Marino and, starting from the Basic plan, direct XML transmission through SdI, the Italian interchange system.
Where enabled by the selected plan and workflow, POP can also support electronic signature and compliant archiving.

= Belgium =
POP supports structured e-invoicing workflows for Belgium, including PEPPOL transmission where enabled.
Belgium introduced mandatory structured B2B e-invoicing for domestic transactions between VAT-registered businesses from January 1st, 2026. POP helps businesses manage this transition by generating structured invoices and supporting PEPPOL-based delivery according to the selected plan and workflow.

= Netherlands, France, Germany and United Kingdom =
POP can be used for PEPPOL-based electronic invoicing workflows in the Netherlands, France, Germany and the United Kingdom.
Regulatory obligations, timelines and accepted channels differ by jurisdiction, business type and transaction type. POP provides the technical capability to generate and route structured invoices through supported networks, while users remain responsible for verifying the requirements that apply to their specific case.

= Poland =
POP supports structured e-invoicing workflows for Poland through KSeF, the Polish National e-Invoicing System.
KSeF is used for issuing, receiving and storing structured invoices in Poland. Mandatory adoption is being phased in by taxpayer category, and businesses operating in Poland need reliable workflows to generate and transmit structured invoice data through the national system.
POP supports Polish invoicing workflows, including PDF and XML invoice generation, XML transmission to KSeF, credit note generation, PDF/XML download, invoice numbering, fiscal configuration, checkout invoicing fields, VAT number validation, advanced reporting and branded PDF invoices.
KSeF XML transmission is available starting from the Basic plan.
POP is also available for Shopify: <a href="https://apps.shopify.com/pop-european-invoicing">https://apps.shopify.com/pop-european-invoicing</a>

= What can POP do for you? =
POP is available in five plans: Free, Basic, Growth, Pro and Enterprise.
For paid features, visit: <a href="https://popapi.io/pricing/">https://popapi.io/pricing/</a>.

Below are the features included in the Free plan and the main capabilities available across supported workflows.

= Document Generation & Delivery =
* Automatic generation of XML electronic invoices and PDFs for completed orders
* The Free plan includes 20 API credits/month. Credit consumption depends on the operation performed
* Manual download of invoices in PDF or XML format
* Customizable PDF templates with logo and footer text
* Compatible with selected European e-invoicing workflows, depending on the country, endpoint and selected plan

= Tax Management =
* Supports invoicing data for EU and international customers, while structured e-invoicing workflows depend on the configured country and network
* Configuration of tax regimes and VAT treatments
* Regulatory references for exempt transactions
* Reverse charge management, where supported by the configured workflow and selected plan

= Verification and Data Control =
* Tax ID validation at checkout, where supported
* VAT number validation at checkout, where supported
* Customizable invoicing fields: VAT number, tax ID and, depending on the country and workflow, destination code, PEPPOL ID or other required invoicing data

= Document Numbering and Configuration =
* Fully customizable invoice numbering with prefix, suffix and yearly reset
* Progressive numbering for invoices, credit notes and receipts
* Automatic blocking of invoices with a zero total
* Exclusion of zero-value line items from invoices

= Management and Reporting =
* Filters for invoices by date, type and WooCommerce order status
* Search by invoice number or order ID
* Advanced reporting and filters, where supported
* Full integration with WooCommerce e-invoicing
* No limit on the number of WordPress installations and supported integrations

= Network and supported formats =
POP is designed to operate within structured European e-invoicing ecosystems, supporting both national systems and the PEPPOL international network.
It enables document generation and routing according to the technical and regulatory requirements of each supported jurisdiction.

= Supported transmission networks =
* Italy – SdI (Sistema di Interscambio)
Direct transmission of structured XML invoices to SdI, the Italian interchange system, where B2B and B2C e-invoicing is mandatory.

* Poland – KSeF
Transmission of structured e-invoices through the PEPPOL network, including supported workflows for:
* Belgium
* Netherlands
* France
* Germany
* United Kingdom

In Belgium, structured B2B e-invoicing is implemented through PEPPOL. In other listed countries, PEPPOL delivery may be required contractually or for interoperability purposes, depending on the business context.
Regulatory obligations may vary by country and transaction type. Users remain responsible for verifying their specific compliance requirements.

In Belgium, structured B2B e-invoicing is implemented via PEPPOL. In other listed countries, PEPPOL delivery may be required contractually or for interoperability purposes, depending on the business context.
Regulatory obligations may vary by country and transaction type. Users remain responsible for verifying their specific compliance requirements.

= Supported document formats =
* Structured XML e-invoices, including UBL where applicable
* PDF invoice copies as human-readable representations
* Credit notes in XML and PDF format, where supported by the selected workflow and plan
* Fiscal receipts, where supported by the configured workflow
* POP supports B2B e-invoicing use cases. B2G use cases are not currently supported.

POP supports B2B e-invoicing use cases. B2G use cases are not currently supported.

= POP API and Integrations =
Several advanced capabilities, such as automatic network submission, qualified electronic signature and compliant digital archiving, are built into POP depending on the selected plan, country and workflow.
Thanks to these capabilities, POP works as an e-invoicing compliance plugin for European e-commerce, automating XML creation, transmission and document management through a structured workflow.

= Invoice Options =
With POP you can customize your invoicing workflow by configuring:

* Invoice prefix and suffix
* Automatic progressive numbering
* Custom fields such as tax ID, VAT number, destination code or PEPPOL ID, depending on the configured country and workflow
* Automatic sending of PDF invoices via email
* HTML invoice display

= Supported Payment Methods =

* Cash
* Bank Transfer
* Check
* Payment Cards
* SEPA Direct Debit

= Compatibility =
POP is compatible with the latest versions of WordPress and WooCommerce:
WooCommerce: up to version 9.x.x; HPOS supported starting from WooCommerce 9.x.x
PHP: 7.4 or higher
WordPress: 4.6 or higher
For HPOS and optimal performance, we recommend using WordPress 6.x.x and WooCommerce 9.x.x and up.

= Why POP =
E-commerce invoicing is becoming more structured, more local and more connected to national systems.
A WooCommerce store may need to generate XML invoices, collect the right fiscal data at checkout, submit documents through SdI, PEPPOL or KSeF, manage credit notes and keep invoice files available for accounting or customer support.
Handling all of this manually does not scale. Building it from scratch requires ongoing technical and compliance maintenance.
POP was created to make European e-invoicing compliance easier for e-commerce teams. It helps you automate invoice generation, reduce manual work and connect your store to supported European workflows without turning compliance into a separate project.
<i>We can’t make compliance sexy, only easier.</i>

= Contributions =
"POP – European electronic invoicing for e-commerce (ex-WooPop)" is open source software.
Contribute to its development to continuously improve the plugin!

== F.A.Q. ==

= Is the POP plugin free? =
Yes. POP offers a Free plan that includes 20 API credits per month.

A credit is the unit used to measure credit-consuming API operations. Some plugin features are included without credit consumption, while operations such as XML generation, transmission, electronic signature or archiving may consume credits depending on the configured workflow.

To unlock more credits and advanced compliance features, you can activate a paid plan.

= Why does POP use API credits instead of “invoices per month”? =
POP is an e-invoicing compliance product. A single invoice may involve multiple compliance actions, such as:

* Generating and validating XML
* Submitting XML to a supported network such as SdI, PEPPOL or KSeF
* Applying digital signature, if enabled
* Activating compliant archiving, if enabled

Each credit-consuming operation uses API credits according to the selected plan and configured workflow.

= Can I automatically send invoices to supported e-invoicing networks? =
Yes. Starting from the Basic plan, POP can integrate with supported networks such as SdI, PEPPOL and KSeF, automating the transmission of structured XML invoices directly from your e-commerce workflow.

Available networks depend on the country, endpoint, selected plan and configured integration.

= Is it possible to customize invoices generated with POP? =
Yes. You can customize the PDF invoice template by adding your company logo and custom footer text.
You can also configure invoice prefix, suffix and progressive numbering.

= Does POP support invoicing for foreign customers? =
Yes. POP supports EU and international customers and can route structured XML through supported networks.
Regulatory requirements may vary by jurisdiction, transaction type and business case. Users should verify the specific obligations that apply to them.

= Is it possible to generate Credit Notes with POP? =
Yes. POP supports credit note generation where enabled by the selected plan, country and workflow.

= What happens if I run out of credits? =
This answer applies to the WordPress open source version of POP.

* Free plan: the service stops when credits are exhausted.
* Paid plans: overquota is allowed. Extra API operations are charged according to your plan’s overquota rate.

You can upgrade your plan at any time to increase your monthly credit quota.
Please note that credit enforcement rules may differ on non-open-source platforms.

= Can I use POP only to generate XML without network submission? =
Yes. POP can be used for XML generation and validation without network submission.

Network submission, digital signature and compliant archiving are optional capabilities depending on your workflow, selected plan and country configuration.

= Does the plugin offer customer support? =
Yes. For support requests, you can contact us directly through the support link in the plugin or open a ticket from our official website.

== Installation ==
This section describes how to install and run the plugin.
1. Upload the 'woopop-electronic-invoice-free' folder to the /wp-content/plugins/ directory.
2. Activate <strong>POP – European electronic invoicing for e-commerce (ex-WooPop)</strong> from the WordPress 'Plugins' page.

== Screenshots ==

== Requirements ==

PHP: >= 7.4
WordPress: >= 4.6

== Changelog ==
= 6.9.8 - 16/07/2026 =
* Security: All admin AJAX actions now require a valid nonce and the `manage_woocommerce` capability; background cron calls continue to work without a nonce as before.
* Fixed: SDI invoice sending no longer remains blocked after the first create/send attempt; the internal concurrency lock is now always released so later manual or scheduled sends can run normally.
* Fixed: KSeF invoice status check no longer crashes with a PHP notice when the API response does not include a reference number; the variable is now always initialised before use.
* Fixed: Credit notes that reuse the invoice numbering series now pick the first free invoice number correctly; previously, when separate credit-note numbering was disabled, a credit note could reuse an already assigned invoice number instead of continuing the sequence.
* Fixed: The edit button for next credit-note numbers now correctly unlocks the field for manual input; previously the field stayed read-only even after clicking the pencil icon.
* Improved: PMPro and Cozmos admin order/payment screens now show cached generated XML/PDF files in a dedicated read-only panel and clear them automatically when billing data changes, so regenerated documents stay aligned with the latest saved data.
* Improved: On Cozmos PMS forms and account pages, store admins now see an explicit POP warning when the Paid Member Subscriptions module "Tax & EU VAT" is not active, clarifying why POP fiscal billing fields are unavailable.

= 6.9.7 - 06/07/2026 =
* Fixed: Bulk CSV order download no longer crashes with a date parse error; previously the export failed with a fatal error when order dates were stored as Unix timestamps instead of formatted strings.
* Fixed: Bulk XML download now generates invoices with complete customer data and order lines; previously documents created through the batch downloader were missing customer name, address, VAT number, and product lines because the admin list index does not store the full order payload.
* Fixed: Batch XML generation no longer fails with a server-side API error for customers without an SDI code; the SDI field is now always sent as a string, preventing a null type error on the POP API.
* Fixed: A crash in the XML payment summary calculation is resolved; line item totals coming from the API response are now cast to numbers before arithmetic, preventing a PHP 8 TypeError when the values arrive as strings.

= 6.9.6 - 06/07/2026 =
* Added: Shops can now activate Zoho (via POP) as their exclusive invoice channel from the Integrations page, with readiness checks from the POP account and dedicated manual/automatic document sending for invoices and credit notes.
* Fixed: Zoho credit notes are now correctly marked as sent after a successful sync; previously the document was created in Zoho but the order status was not updated.
* Fixed: Zoho document sync now respects the sandbox/live environment setting; previously Zoho always sent to the live Zoho account even when the POP sandbox mode was active, and sandbox dry runs now return a clear confirmation instead of an error.

= 6.9.5 - 25/06/2026 =
* Added: German shops can now generate and receive ZUGFeRD documents — the hybrid PDF containing embedded XML is created via the POP API and automatically attached to the completed order email; XML and standard PDF actions are replaced by a single ZUGFeRD download button in the admin order list and order detail.
* Added: German shops can now download all three ZUGFeRD artefacts — hybrid PDF, standard PDF, and embedded XML — as a single ZIP archive directly from the admin order list and order detail; the bundle is served from the local cache and consumes no additional API credits.
* Added: A dedicated ZUGFeRD section is now visible in the settings panel for German shops configured on the ZUGFeRD corridor, showing credit usage information for each document bundle generated.
* Fixed: Resending a completed order email from the WooCommerce order detail no longer deletes the cached document files for that order.
* Fixed: The invoice/document admin list now loads correctly even when WooCommerce refunds are present, and recent documents from different providers are ordered more reliably together in the same view without early pagination cutoffs.

= 6.9.4 - 15/06/2026 =
* Added: Polish shops can now send KSeF invoices directly from the WooCommerce order detail; the invoice is transmitted to the KSeF system via the POP API and the assigned KSeF reference number is stored on the order. Auto-send on order status change and manual status check are also available.
* Added: Invoice numbering can now be restarted intentionally from a chosen value in Numeration settings, even when keeping the same prefix, making it easier to reset test sequences before going live.
* Fixed: After a manual numbering reset, older documents in the same invoice series no longer force the next number forward; duplicate protection now applies only to documents created after the reset.
* Added: Manual numbering reset is now available for the receipt series as well, with the same boundary logic as for invoices.
* Fixed: The manual numbering reset checkbox was silently ignored when saving settings; the reset now applies correctly and the sequence restarts from the chosen value.
* Fixed: Receipt numbering now always uses its own separate sequence starting from 1; the previous option to share the invoice counter by setting the receipt number to zero has been removed as it produced incorrect document numbering.
* Fixed: Fatture in Cloud automatic sending now correctly uses the trigger status configured for each document type — invoices use the invoice trigger and receipts use the receipt trigger; previously both always checked the invoice trigger, causing receipts (and invoices on non-completed triggers) to be skipped silently.
* Fixed: Receipt orders processed through payment gateways that auto-complete orders (e.g. PayPal, Stripe) are now correctly scheduled for automatic Fatture in Cloud sending; previously these orders were skipped in receipt-only mode or when the receipt trigger differed from the invoice trigger.
* Fixed: Receipt documents (corrispettivi) now always carry the order creation date as the fiscal transaction date, in all sending flows (automatic batch, immediate on status change, and manual); invoices continue to use the emission date as required by SDI sequential numbering rules.
* Fixed: When the batch processes multiple receipts in sequence, the success message is no longer duplicated for each order; each document now reports its own single confirmation line.
* Fixed: Fatture in Cloud automatic sending now recovers missed invoice and receipt orders more reliably when the first background run is delayed, including shops using `processing` as the trigger status.
* Fixed: Orders still missing `_invoice_sent` are now picked up correctly by the Fatture in Cloud recovery cron, preventing valid automatic documents from being skipped silently.

= 6.9.3 - 09/06/2026 =
* Added: When deactivating the plugin, a feedback modal now appears asking for an optional reason and comment before proceeding; the information is sent to POP to help improve the product, and deactivation always completes regardless of whether feedback is provided.

= 6.9.2 - 05/06/2026 =
* Fixed: The temporary order filter data is no longer loaded on every page of the WordPress admin; on large stores this option could reach several megabytes and was causing slow database queries and site crashes under normal traffic.
* Improved: Fatture in Cloud diagnostic log now traces the full scheduling and execution flow for both invoices and receipts, including order status transitions, payment method, and the reason when an automatic document send is skipped; requires WP_FATT_CLOUD_LOG enabled.
* Fixed: Webhook delivery via n8n connector (e.g. Zoho) now works correctly — the connector response is recognised and passed through instead of being treated as invalid XML, both when triggered manually and via scheduled cron.
* Fixed: Saving webhook settings without making any changes no longer shows a false error message; a save with no modifications now correctly returns success.

= 6.9.1 - 03/06/2026 =
* Added: A dedicated "Ricevute/Corrispettivi" automation section is now available in Fatture in Cloud settings, with its own trigger status and enable/disable toggle independent from invoice automation; receipt documents are sent immediately when the selected order status is assigned.
* Added: Receipt orders are now visible in the invoice admin list and show the document data section inside the order detail when Fatture in Cloud is active, regardless of order status.
* Added: Manual upload of receipt documents is now always allowed from the order detail, regardless of the order status.

= 6.9.0 - 27/05/2026 =
* Fixed: PMPro order items now report the correct unit price and VAT rate in the XML payload; when the PMPro global `$pmpro_default_country` is not initialised during API-based XML generation the rate lookup returned 0, causing `unit_price` to show the gross amount instead of the net and `rate` to show `0.00`; `taxRate()` now falls back to calculating the aliquota directly from item totals (`total_tax / subtotal × 100`) for non-WooCommerce providers when the provider lookup returns zero, and the strict integer comparison `0 === $vat` in `calcUnitPrice()` is replaced with `0.0 === floatval($vat)` so the safety fallback triggers correctly when `$vat` is the string `"0.00"`.
* Added: SDI and PEPPOL integration settings now display Live and Sandbox environments as separate labelled sections, each with its own status indicators; PEPPOL identifier, endpoint value, UUID, address, city and zip-code fields are shown for both environments independently.
* Changed: Two new static helpers `Integrations::isSdiPopIntegrationActive()` and `Integrations::isPeppolIntegrationActive()` centralise the live-or-sandbox activation gate; all call sites in `Integrations`, `InvoiceApi`, `PeppolApi` and `Wizard` now use these helpers instead of raw `get_option` comparisons.
* Changed: `getSdiPOPIntegrationData()` and `getPEPPOLPOPIntegrationData()` return objects now expose separate `live_integration` / `sandbox_integration` boolean flags (plus `live_signature`, `live_storage`, `sandbox_signature`, `sandbox_storage` for SDI and sandbox PEPPOL identifier fields) so UI and consumers can distinguish the two environments without re-reading options.
* Fixed: Various admin CSS adjustments — added `min-height` to inputs, action buttons and table-cell title column; corrected `line-height` on action icon links for refund and order rows.

= 6.8.9 - 25/05/2026 =
* Fixed: Fatture in Cloud invoice sending now refreshes cached VAT rates safely before using standard-rate IDs, preventing stale shipping tax mappings from blocking document creation after VAT changes in Fatture in Cloud.
* Fixed: removed radio input and checkbox style that conflicted with WP 7 styling

= 6.8.8 - 19/05/2026 =
* Added: Admin notifications can now be shown or hidden by platform, so messages can target only WordPress or external platform contexts such as Shopify.
* Added: Shops configured for Poland now generate KSeF XML on the dedicated route and keep the saved XML files in a dedicated local directory.
* Fixed: Poland shops now show only the native actions expected by their configured route, and private KSeF customers now see PDF-only document actions instead of PEPPOL/UBL XML options and notices.
* Added: New environment setting (live/sandbox) in account panel to send the environment flag in POP API requests; default is "live". The environment is shown in the admin menu title next to the plugin name.
* Added: New ReverseChargeSettings class to centralize conditional display logic for reverse-charge fields; ref_norm_rc (tax rule reference) is now shown only in Italy, San Marino and Spain, while other EU countries and extra-EU contexts show only nature_rc.
* Fixed: Poland shops now show reverse-charge fields with KSeF-ready labels and accepted values, while unused private and tax-reference fields are hidden and no longer saved on orders.
* Fixed: Reverse-charge settings in WooCommerce, PMPro and Cozmos now align with the new conditional logic, saving ref_norm_rc only when the field is displayed and avoiding empty values on orders.
* Fixed: PMPro checkout now saves reverse-charge metadata only when nature is not empty, preventing stale empty values on subsequent order processing.
* Added: New extra-EU zero-tax handling: when cart contains items shipped to non-EU countries, the reverse-charge process now applies the 0% tax rate without requiring reverse-charge validation, supporting export scenarios where VAT is not applicable.
* Fixed: Poland KSeF context now hides SDI fields and Tax Code like PEPPOL does, and the address format is updated to include invoice_type and vat_number correctly.
* Changed: Reverse-charge settings UI is now simplified, removing redundant country-specific fields that are handled by the new centralized logic.

= 6.8.7 - 08/05/2026 =
* Fixed: Failed include RefundOrderItem.php

= 6.8.6 - 07/05/2026 =
* Fixed: PMPro admin order save and invoice sent/undo actions now guard against recursive re-entry on the same order during internal meta/XML persistence, preventing memory exhaustion, stalled redirects and duplicate nested processing on `pmpro_updated_order`.
* Fixed: PMPro refunded orders now keep the original invoice row and the generated credit note as separate POP table documents; admin search/action routing now resolves the correct refund document context for XML/PDF generation, local cache reuse and bulk file handling instead of collapsing both documents onto the same source order id.
* Fixed: PMPro native SDI/PEPPOL actions now resolve invoice vs credit-note document context explicitly, so a UUID saved for the original invoice no longer disables send/state actions on the PMPro refund credit-note row that shares the same source order id.
* Fixed: Admin document search is now provider-aware; when a specific provider is selected, direct order-id lookup and filtered search results query only that provider instead of scanning every registered provider.
* Fixed: Fatture in Cloud line-item VAT-type resolution now prioritizes the XML/order fiscal `Natura` before Italian `0%` fallback mappings, so cases such as `N2.2` no longer degrade to the generic domestic N4 path when the normative reference is missing; targeted helper tests cover exact, ambiguous and fallback cases.
* Fixed: PMPro checkout no longer blocks company/freelance submissions with browser error `An invalid form control with name='billing_tax_code' is not focusable` when tax code is disabled; PMPro now aligns CF required/visibility handling with the WooCommerce flow and clears stale browser custom-validation state when the field is hidden or excluded from validation.
* Fixed: Credit-note XML refund assembly no longer assumes WooCommerce-only parent-order lookups; refund data building now resolves the parent order through the active provider and hardens fee-item data access for non-Woo provider adapters, improving compatibility for provider-based refund flows.
* Changed: Local frontend/admin asset versioning now uses the real file modification time for plugin-managed scripts and styles, including PMPro and Cozmos checkout assets, reducing stale-browser/cache issues after JS/CSS updates without requiring a plugin version bump.

= 6.8.5 - 28/04/2026 =
* Fixed: Shipping VAT-rate resolution is now hardened across standard invoices and shipping refund / credit note flows; shipping items can now recover their tax rate and tax-rate id from item tax data when `tax_class` is empty, location matching now prefers city-specific rates over generic country-wide matches, and targeted tests cover the shared resolution path.

= 6.8.4 - 27/04/2026 =
* Changed: POP API requests that already send `license_key` in the JSON body now also send the same value in the `X-API-Key` header for channel, wizard, addon-allowlist, and document-generation endpoints while keeping backward-compatible body payloads unchanged.
* Fixed: PMPro XML auto-saving now skips recursive re-entry when the current request is already the internal `format=xml` generation request for the same order/provider, preventing self-triggered loops during internal XML generation on shared POP/site domains.
* Fixed: Invoice-number formatting/build fallback no longer degrades to the order ID when the raw progressive is missing during interrupted status-change/save flows; formatted-number generation is now centralized, recovery prefers the stored `order_number_invoice` or a valid parse from the existing formatted value, and missing progressives now fail explicitly with logs instead of persisting the order number as the visible invoice number.
* Changed: PMPro legacy formatted-number fallback is aligned with core and no longer uses the order ID as a surrogate invoice number when no valid progressive is available.
* Fixed: Greece VIES checks now normalize the member-state code from `GR` to `EL` in the shared VIES path, so Greek VAT numbers entered/stored with checkout country `GR` are validated with the expected VIES country code; updated core helpers and validator flow in `src/Functions/Utils.php` and `src/WooCommerce/Fields/InvoiceFields.php`, with targeted coverage in `tests/ViesCountryCodeTest.php`.
* Changed: The account setup wizard popup `otpWindow` now sizes itself dynamically from the opener browser window instead of using a fixed width, targeting about `80%` of the available width and centered positioning for better adaptation across screen resolutions; updated `assets/js/wizard.js` and regenerated `assets/js/wizard.min.js`.

= 6.8.3 - 09/04/2026 =
* Fixed: `processFileBatch()` now resolves the correct order provider from the stored batch payload and skips orphaned records safely, avoiding fatal errors when bulk XML data contains non-WooCommerce entries or deleted orders.
* Changed: Bulk XML download gating is now aligned between UI and runtime; the feature remains Growth+, the AJAX endpoint now enforces the same rule server-side, and paid-plan users below Growth see an explicit `From Growth` badge instead of the generic paid-only label.
* Fixed: XML directory saving is now enabled from the Basic plan as intended, matching the settings UI and restoring actual file creation for `createXMLOnProviderOrderCompleted()`.
* Changed: XML auto-saving is now provider-aware in core and is wired for WooCommerce, PMPro and Cozmos payment flows, so completed-provider orders can save XML files without relying on WooCommerce-only assumptions.
* Changed: Added localized `From %s` plan badge strings in core language catalogs and regenerated compiled translations.

= 6.8.2 - 07/04/2026 =
* Fixed: `transferee_client.personal_data.tax_id_vat.country_id` and `transferee_client.place.country_id` now receive the customer country reliably during XML/PDF payload assembly; `CreateXml` initializes `$transfereeCountryId` before the payload is built, avoiding undefined-variable notices and empty country values in generated documents.
* Changed: PMPro order billing resolution is now more defensive for address, city, state, postcode and country, with fallback lookup across POP order metas (`billing_*`), WordPress user metas and legacy PMPro user metas (`pmpro_b*`) when the `MemberOrder->billing` object is incomplete.

= 6.8.1 - 07/04/2026 =
* Fixed: PMPro bridge now restores pre-6.8.0 addon bootstrap timing by firing `wc_el_inv-after_init` after plugin bootstrap, so PMPro callbacks are registered before checkout/gateway order flows emit their hooks.
* Fixed: PMPro addon filter loading is now merged explicitly across `filtersAlways`, `filtersFront`, `filtersAdmin`, and `filtersAjax`, preventing loss of shared `inc` hooks such as invoice/date assignment and fiscal-meta sync.
* Fixed: PMPro order success handling now backfills missing POP fiscal metas (`billing_choice_type`, `billing_invoice_type`, `billing_sdi_type`, `billing_vat_number`, `billing_company`, `billing_tax_code`) even when the success transition happens later via Stripe/webhook and the original checkout `POST` is no longer available.
* Fixed: When PMPro front-end document-type choice is disabled, the effective default now becomes `invoice` instead of inheriting the receipt-oriented field default.
* Fixed: PMPro provider billing-company resolution now prioritizes the POP order meta `billing_company` over stale PMPro billing object values, so updated company names entered at checkout are reflected consistently in orders and generated documents.
* Changed: PMPro Council Directive price-label formatting now uses the current site language instead of the account country, appending `+IVA` only for Italian and `+VAT` for all other languages.
* Changed: Core helper `getCurrentLanguage()` is now normalized and WPML-aware, using `isWpmlActive()` with `ICL_LANGUAGE_CODE` when available and otherwise falling back reliably to the current WordPress locale.
* Added: Targeted PMPro/WPML language-label tests covering WordPress locale fallback and WPML current-language precedence.
* Added: Centralized diagnostic log helpers in core for shared path resolution, bootstrap, write-status tracking and protected admin log viewing.
* Fixed: Fatture in Cloud, Aruba and SdI via PEC now prepare their event-log directory/file on activation and surface path/permission issues immediately in addon settings.
* Changed: Addon event logs are now opened through a nonce-protected admin endpoint instead of direct public `/wp-content/*.log` URLs, reducing false 404s caused by cache, rewrite rules or WAF policies.
* Added: Targeted diagnostic-log tests covering bootstrap, write flow, early conflict detection and protected viewer URL generation.
* Added: Unified POP API overquota payload (`pop_api_overquota`) with shared normalization helpers, localized titles/messages/CTA labels, and admin/order persistent state stored in the global option `wc_el_inv_pop_api_overquota_state`.
* Fixed: POP API overquota business blocks no longer terminate with legacy `wp_die()` in programmable flows; AJAX/admin and addon consumers now receive a structured payload, while `_blank` document generation renders a dedicated HTML fallback page.
* Changed: Overquota handling is now aligned across core and indirect addon consumers (`getXmlFromOrder() -> CreateXml -> popApi()`), with shared detection/extraction helpers in PHP and a single SweetAlert2 renderer in `assets/js/admin.js`.
* Fixed: Core AJAX flows and Fatture in Cloud, Aruba, and SdI via PEC addon UIs now intercept `pop_api_overquota` before generic error handling and render the shared dialog instead of degrading to “invalid XML” or generic API errors.
* Added: Persistent overquota notices on POP XML settings (`page=wc_el_inv-options-page&tab=xml`) and WooCommerce order screens, dismissible per page view but automatically shown again until the global overquota state is cleared on a successful document flow.
* Fixed: Overquota business copy is now clearer across reason-code states, including explicit cause/unblock guidance for plan limit, disabled overquota, settlement required, cap reached, payment-method and overdue-balance cases.
* Fixed: Updated translation catalogs (`el-inv.pot`, `it_IT`) and rebuilt the `it_IT` `.mo` file for the refined overquota titles/messages, CTA labels (`Open POP`, `Contact support`) and step label (`Next step`).
* Added: Extended CloudApi quota/overquota test coverage for normalized payloads, global option persistence/cleanup, admin notice rendering, settlement-required branching and unpaid-overquota fallback CTA mapping.
* Fixed: PMPro Council Directive tax hooks now initialize correctly even when the PMPro bridge is loaded after `init`, restoring `pmpro_format_price`, `pmpro_tax` and `pmpro_vat_by_country` on checkout.
* Added: Targeted bootstrap-hardening coverage for the PMPro Council Directive snippet when it is included after `init`.
* Fixed: Cozmos PMS admin payment form no longer fatals when `pms_in_tax_eu_vat_enabled()` is unavailable; the bridge now falls back to local tax settings when the PMS VAT helper is not loaded.
* Added: PMPro order view (`pmpro-orders` view page) now shows read-only POP “Invoice Fields” and “Invoice Data” sections after the main order details, so saved billing/fiscal data is visible without entering edit mode.
* Fixed: PMPro and Cozmos now align saved fiscal meta (`nature_rc`, `ref_norm_rc`, `order_vies_check`) more closely with the WooCommerce provider flow, including `company_no_vies` handling and San Marino support during order/meta persistence.
* Fixed: Cozmos VIES checks now call the shared validator with the correct VAT/country argument order, avoiding false negatives that could block the correct fiscal meta assignment.
* Changed: Legacy `stripTags()` has been removed and replaced by explicit text helpers that separate HTML-to-plain-text extraction from SDI and PEPPOL normalization policies.
* Changed: SDI text normalization now uses deterministic ASCII-safe business tokens for disallowed symbols (`& -> AND`, `% -> PCT`, `# -> NUM`, `€ -> EUR`) together with stronger transliteration for accented and extended Latin characters.
* Added: Targeted text-normalization tests covering HTML cleanup, SDI-safe replacements, extended Latin transliteration, control-character filtering and conservative PEPPOL business-text preservation.
* Fixed: SdI via PEC filename progression is now centralized and persisted in the visible order custom field `invoice_progressive_file_number`, with a new unique 5-character code reserved on each real transmission and reinvio.
* Changed: Local `ProgressivoInvio` generation has been removed from the plugin XML payload so SdI transmission progressives remain owned exclusively by the API.

= 6.8.0 - 13/03/2026 =
* Fixed: Registered `wc_el_inv_swal2` globally in admin so `wc_el_inv_admin` dependencies resolve correctly outside POP settings pages without forcing SweetAlert2 enqueue on every admin screen.
* Fixed: Restored `POP Checkout Fields` block visibility in the block inserter by registering `pop-checkout-block-editor` before `register_block_type()`.
* Fixed: Simplified POP checkout block editor dependencies to valid Gutenberg/Woo Blocks handles, removing missing dependency issues that prevented block loading.
* Fixed: Hardened `assets/js/pop-block.js` against missing `wc_el_inv_admin` / `wc_el_inv_invoice` globals by using localized fallback data for messages and field positioning.
* Changed: Free-plan premium settings now remain visible with disabled UI, including `Paid only` badges, while server-side save and runtime enforcement prevent unavailable features from being used on `free`.
* Fixed: Free-plan endpoint cards now show an explicit upgrade message with plans CTA, with updated locale catalogs.
* Fixed: Premium runtime enforcement now blocks VIES, reverse charge, XML directory saving, automatic sending and webhook execution on `free` while preserving stored values for paid-plan reactivation.
* Changed: Membership entrypoints `PMPro` and `Cozmos` can now coexist without forced mutual reset, with integration bootstrap updated to support both providers in the same installation.
* Fixed: PMPro and Cozmos addon bootstrap now supports late loading after `init`, restoring correct field/provider initialization after moving `wc_el_inv-after_init` to the proper lifecycle point.
* Fixed: Provider enqueue is now re-run after membership addon loading so late-loaded providers are registered before downstream order/tax flows use them.
* Fixed: Composer autoloaders for core and local addons now use explicit unique suffixes, preventing class-name collisions when multiple POP addons are loaded together.
* Changed: Plan-based gating has been realigned for `basic`, `growth` and `pro` across settings, runtime checks and integration cards, including `Paid only` visibility, upgrade messages, country-specific PEPPOL notices and dependency notices for Fatture in Cloud receipts/warehouse cards.
* Fixed: `basic` now correctly enables credit notes, XML directory, reverse charge/VIES, POP SdI/PEPPOL automations, webhooks and activation of `SdI` / `PEPPOL`, while unsupported endpoints show the explicit upgrade message.
* Fixed: `growth` and higher plans now consistently show the PEPPOL country-specific notice whenever the plan allows activation but the configured country is not eligible.
* Added: Pro-only dependency notices for `Fatture in Cloud (receipts)` and `Fatture in Cloud (warehouse management)` when the base FIC integration is not active, with localized strings across supported languages.
* Fixed: `to/*` addon bootstrap hardening now covers late loading after `init` for Fatture in Cloud, Aruba, SdI PEC, FIC Receipts and FIC Stock, including immediate execution of internal `init` jobs registered via addon loaders.
* Added: Targeted tests for post-`init` addon loader behavior and test bootstrap action stubs; full local suite passing.
* Fixed: Fatture in Cloud payment-account handling now avoids undefined-property warnings on missing `payAccountID` mappings and re-validates payment account data after filters before building the API payload.

= 6.7.5 - 11/03/2026 =
* Fix: SweetAlert2 admin assets are now loaded only on POP plugin pages, preventing conflicts with other admin plugins that use different SweetAlert2 versions.

= 6.7.4 - 11/03/2026 =
* Change: admin SweetAlert2 confirm and notification buttons now use plugin-consistent styling
* Fix: PMPro applies stamp duty after rivalsa so stamp duty does not affect rivalsa calculation
* Change: PMPro admin order shows stamp duty and rivalsa values as read-only reference fields with a checkout consistency notice
* Fix: PMPro admin order save repairs taxes only when tax calculation is enabled, the order is not sent and totals are inconsistent
* Fix: XML stamp duty by customer force-apply remains limited to invoice orders and excludes credit notes
* Change: Integrations > Entrypoint cards are now visible independently from allowed-addon license checks; activation remains gated by allowed add-ons and account configuration.
* Add: New WooCommerce Entrypoint card (native integration) with documentation link and active/disabled visual state based on WooCommerce availability.
* Change: Integrations tooltips now show a dedicated pre-wizard message when account setup is incomplete, while preserving context-specific messages after wizard completion.
* Fix: VIES VAT normalization now supports alphanumeric EU VAT formats in both WooCommerce checkout and PMPro VIES checks.
* Change: PMPro Council Directive tax-rate check now uses normalized VAT/country values before VIES validation.
* Change: Settings > Numeration helper text updated from “Recommended 4 (you can leave it blank)” to “Enter a value from 1 to 6.” with updated locale catalogs.
* Fix: Invoice next-number candidate scan now continues when a recent WooCommerce order is outside the active series, instead of stopping early.
* Fix: Shared numeration yearly scope now also applies when "Reset the numbers at each year change" is enabled (even if year suffix is disabled), preventing historical previous-year numbers from affecting current-year assignment.
* Fix: Updated translation catalogs (it_IT, fr_FR, es_ES) and rebuilt locale binaries (.mo) for new integration and numeration strings.

= 6.7.3 - 04/03/2026 =
* Add: Native response helpers `safeJsonDecode` and `prefixNativeFlowMessage` to centralize robust JSON parsing and channel-prefixed diagnostics.
* Change: SDI/PEPPOL create-and-send user-facing errors now use clear channel prefixes (`SDI:` / `PEPPOL:`) with simplified messages, while technical detail remains in logs/payload fields.
* Fix: SDI (`InvoiceApi::createAndSendInvoice`) response handling is now hardened for invalid/malformed JSON and missing properties, with safer UUID extraction and no contract-breaking output changes.
* Fix: PEPPOL (`PeppolApi::createAndSendUblInvoice`) response handling is now hardened for invalid/malformed JSON and mixed response shapes, including guarded access to nested `data` fields.
* Fix: PEPPOL state check (`PeppolApi::stateInvoice`) now safely parses mixed response bodies and falls back gracefully when body is not valid JSON.
* Add: `CloudApi` JSON parser helper (`parsePopApiJsonBody`) for internal no-breaking normalization and decode-error tracking.
* Fix: `CloudApi` error path now returns consistent JSON-safe fallback payloads when upstream body is not valid JSON (`error`, `status_code`, `decode_error`, `raw`) without changing successful v2 response formats.
* Fix: `CloudApi` integration JSON handling now validates shape before reading `xml_string`, avoiding silent/fatal failures on unexpected payloads.
* Fix: Admin native-actions UI (`assets/js/admin.js`) now uses robust `fetch` parsing with `response.text()` fallback when response is not JSON, preventing generic JSON parse crashes and preserving actionable toasts.
* Add: Unit tests for new native helpers (`safeJsonDecode`, `prefixNativeFlowMessage`) and for `CloudApi` parser behavior on valid/invalid/non-string inputs.
* Fix: Updated translation catalogs (it_IT, fr_FR, es_ES) for new simplified runtime strings and rebuilt locale binaries (`.mo`).

= 6.7.2 - 25/02/2026 =
* Fix: Integration cards for Aruba, Fatture in Cloud (core/receipts/stock), and SDI via PEC are now correctly disabled for non-Pro accounts.
* Fix: Integration toggle AJAX now validates option names against a whitelist and blocks unsupported option writes.
* Fix: Integration toggle AJAX now enforces account-level and integration-status checks before enabling add-ons, preventing invalid activations.
* Fix: Add-on options are now normalized at runtime (license/plan/status aware) to reset stale active flags after plan or integration status changes.
* Fix: Active invoice channel resolution now requires both option enabled and add-on plugin loaded (Fatture in Cloud, Aruba, SDI via PEC), preventing false-active channels.
* Fix: PMPro admin order save now avoids resetting existing user billing/fiscal metas when POP fields are submitted empty from the order edit screen.
* Fix: Cozmos PMS checkout scripts are now enqueued using registration-page context detection (including `[pms-register]`) instead of relying only on query params.
* Fix: Cozmos PMS tax callbacks now fail-safe when PMS Pro Tax classes are unavailable, preventing fatal errors on non-Pro or inactive-license setups.
* Change: Removed unused `PMS_IN_Tax_Extra_Fields` instantiations in Cozmos filters callbacks.
* Add: New cross-provider candidate resolver for invoice next-number alignment via `wc_el_inv-next_number_last_assigned_candidate_for_series`.
* Add: Candidate utilities now track number/timestamp/provider/order_id and apply deterministic tie-break (timestamp, number, order_id).
* Change: PMPro and Cozmos next-number integrations now contribute structured candidates (chronological winner) instead of max-number merges.
* Add: Unit tests for candidate chain propagation, chronological selection, tie-break behavior, and legacy integer-filter fallback.
* Fix: Tests bootstrap now stubs FIC/Aruba/SDI-PEC plugin classes so integration-channel tests reflect runtime `class_exists` conditions.
* Add: Centralized SDI/PEPPOL context helpers in Integrations (`getNormalizedShopCountry`, `isUblCountry`, `isSdiCountryContext`, `isPeppolCountryContext`, `isSdiContext`, `isPeppolContext`) and replaced duplicated context checks across WC, PMPro, Cozmos, admin filters, and order list actions.
* Change: SDI context detection now includes third-party SDI channels (Fatture in Cloud and Aruba) in addition to native SDI channels.
* Fix: In PEPPOL context, SDI field (`billing_sdi_type`) is now consistently hidden in checkout/profile/admin areas (WC, PMPro, Cozmos), including label/description visibility where applicable.
* Fix: Cozmos checkout/UI guardrails for SDI field visibility in PEPPOL context, including fixes for residual label/description rendering and stability improvements for field toggling flows.
* Fix: SDI field validation (`La PEC o il Codice Destinatario ...`) now runs only in SDI context and is skipped in PEPPOL context for WC/PMPro/Cozmos checkout flows.
* Fix: WC PEPPOL private-customer actions now correctly disable XML generate/view/download actions while keeping PDF available; related PEPPOL private warning behavior aligned in order table/order actions.
* Fix: Hardened PEPPOL country checks to avoid undefined-country-index warnings in settings (`pageSettingsFields.php`) and to support robust UBL-country detection.
* Fix: WooCommerce email section "Tax information" now renders its info block with styled container for better readability (`color #636363`, `border #e5e5e5`, `padding 12px`).
* Add: Extended unit test coverage for new integration/context helpers and channel behavior (including FIC/Aruba SDI context), plus test bootstrap/order stubs alignment; full unit suite passing.
* Fix: SDI/PEPPOL context resolution is now mutually exclusive with shop-country precedence to handle edge cases where legacy SDI-only add-ons (FIC/Aruba) remain enabled after switching store country to PEPPOL.
* Change: PEPPOL detection in WooCommerce tax-information/admin billing views is now aligned to global store context (not per-order billing country) for consistent visibility rules.
* Fix: Cozmos checkout JS field toggling now guards null elements before `classList` operations, preventing runtime errors during invoice-type transitions.
* Fix: Added defensive `isset` checks when forcing SDI field hidden state in Cozmos billing fields to avoid PHP warnings/notices in filtered edge cases.
* Fix: In PEPPOL context, Tax Code (`billing_tax_code`) is now consistently hidden across WooCommerce/PMPro/Cozmos checkout-profile-admin-order views, aligned with SDI absence rules.
* Change: In PEPPOL context, CF-related settings are now hidden from Integration settings (`Disable Fiscal Code`, `Verify Tax Code`, `Disable PEC/SDI`) to avoid misleading configuration paths.
* Change: Runtime localization now forces PEPPOL-safe flags (`disable_pec_sdi=on`, `disable_cf=on`, `active_js_cf_check=off`) for consistent frontend behavior.
* Change: `assets/js/cf/codice-fiscale.js` is now enqueued only when `invoice_active_js_cf_check=on` and SDI context is active (WooCommerce, PMPro, Cozmos).
* Fix: PEPPOL checkout validation/process/store flows now ignore and clear Tax Code persistence for classic/block paths where required, preventing hidden-field validation regressions.
* Fix: Cozmos CF checks now fail-safe when the Tax Code input is absent, avoiding JS runtime errors in PEPPOL-hidden flows.
* Fix: In PEPPOL checkout (non-IT), `billing_invoice_type` is no longer dropped when VAT/Tax Code are empty, ensuring "Customer type" remains persisted and correctly visible in order details.
* Fix: PMPro checkout now resets `billing_company` when customer type is switched to `private` in PEPPOL context, preventing stale company value carry-over.
* Fix: PMPro server-side persistence now forcibly clears `billing_company` for PEPPOL + `billing_invoice_type=private` (checkout and renewal sync), keeping order/user meta aligned with latest customer selection.

= 6.7.1 - 18/02/2026 =
* Fix: POP API quota exceeded responses now show a readable quota-limit message instead of raw JSON output.
* Add: Dedicated quota-limit UI message for wp_die with bold title, quota usage details, and actionable upgrade/refresh steps.
* Fix: Admin error email for quota-limit events now sends a clear human-readable message instead of raw API JSON.
* Add: New translation strings for quota-limit title/messages in POT and PO catalogs (it_IT, fr_FR, es_ES).
* Add: Unit test coverage for quota-error payload parsing, detection, message formatting, and HTML output.
* Change: Replaced legacy WooPop/WooPOP/WooPoP naming with POP in user-facing localized strings across PHP/JS, file headers, and comments (without changing technical identifiers).
* Fix: Updated affected translation catalogs and rebuilt locale binaries for changed domains (.po/.mo).
* Fix: Bootstrap environment loading now fails safely in dev mode when `config/environments/dev.php` is missing (admin notice + early return), preventing unintended fallback to production config.
* Add: PMPro admin order screen now includes on-demand billing sync buttons in "Invoice Fields" to recover missing POP fiscal/billing data from the linked user profile.
* Add: PMPro admin order save flow now supports two explicit sync modes from user profile (`fill_missing`, `overwrite`) before persisting order metas.
* Change: POP profile invoice fields are now centralized in a single global WordPress user profile block (shared across providers), with one save path to user meta `billing_*`.
* Fix: Removed duplicate PMPro profile show/save hooks to avoid multi-source profile saves and key collisions on shared POP billing fields.
* Fix: In WordPress user profile screens (`profile.php`, `user-edit.php`), duplicated WC/PMPro POP fields are now forced read-only via disabled state while keeping the centralized global POP block editable.
* Add: Admin profile hardening script to enforce disabled duplicated provider fields and inject a contextual notice with anchor link to the centralized POP section.

= 6.7.0 - 17/02/2026 =
* Add: DB advisory lock helpers based on MySQL/MariaDB GET_LOCK/RELEASE_LOCK to prevent concurrent duplicate create/send/upload actions.
* Fix: Fatture in Cloud send flow now requires explicit docID and wfc-issued_send_document=false; removed implicit docID fallback from stored document meta.
* Fix: Fatture in Cloud create flow now uses atomic lock guard to avoid duplicate issued documents under concurrent Ajax/Cron execution.
* Fix: Added channel guards to SDI/PEPPOL/FIC status callbacks so native/addon flows run only when their integration channel is effectively active.
* Fix: Hardened _invoice_sent writes across channels (SDI native, PEPPOL, Aruba, SDI via PEC, FIC) by requiring minimum success/coherence conditions before setting sent.
* Fix: Added recurring cron cleanup for inactive/disabled upload schedules (FIC, Aruba, SDI via PEC) to avoid orphan scheduled events.
* Fix: Fatture table invoice number rendering now only shows dismiss icon when both order_number_invoice and formatted number are missing, with recovery from formatted where possible.
* Add: Native SDI/PEPPOL timeout-pending flow with explicit admin recovery actions in order list (Confirm UUID / Cancel timeout).
* Add: New admin AJAX actions confirmNativeSendWithUuid and cancelNativeTimeoutPending to finalize or clear timeout-pending state safely.
* Add: Native timeout helper set (meta keys/channel prefix/timeout detection) and centralized timeout pending metadata management.
* Fix: SDI and PEPPOL create/send flows now mark timeout-pending on timeout-like provider responses and clear pending state on successful UUID save.
* Fix: SDI and PEPPOL create/send error responses now include readable provider detail extracted from raw payload data when available.
* Change: Timeout pending UUID input in native actions UI is now full-width with explicit spacing before recovery buttons.
* Fix: getNextInvoiceNumber now aligns stale next numeration values to max(next, last_assigned+1) for the active series, preventing duplicates and backward numbering.
* Add: series-aware duplicate check now uses WooCommerce order queries (HPOS compatible), comparing type/prefix/year context against the latest assigned order.
* Add: provider-level series hooks for PMPro and Cozmos addons via wc_el_inv-next_number_already_assigned and wc_el_inv-next_number_last_assigned_for_series.
* Add: Extended unit test coverage for timeout helpers, native error detail extraction, resolver hardening edge cases, and wrapper/adapter behavior.
* Fix: Resolver hardening for invalid filter outputs (channels status/priority), empty priorities, non-string priority entries, and normalized shop country handling.

= 6.6.2 - 13/02/2026 =
* Fix: WooCommerce Blocks checkout now reliably saves POP additional billing fields into order meta during checkout completion.
* Fix: Restored JS validation flow for invoice fields in block checkout after the legacyId refactor regression.
* Fix: In PEPPOL context, billing_sdi_type is now always ignored/emptied on save for both WooCommerce classic and block checkout flows.
* Fix: In PEPPOL context, _billing_sdi_type and related SdI labels/help text are hidden in WooCommerce admin billing edit/view.
* Add: New "Tax information" section on order confirmation, rendered after billing address for both classic and block checkout.
* Change: Tax information output now appears only when fiscally meaningful data is present (company/freelance with VAT, private with tax code).
* Removed: Legacy billing-address formatting hooks for POP tax fields replaced by dedicated Tax information rendering.

= 6.6.1 - 12/02/2026 =
* Add: isCheckout and isAccountPage utility
* Add: overrides filter "wc_el_inv-language_force_apply" for default PDF language
* Add: billingFields.php to pmpro addon
* Fix: Harden PMPro product provider by validating membership level objects before accessing properties, preventing fatal errors when SKU/name data is missing.
* Fix: Sanitize empty value in $refundFee array
* Fix: pmpro chckout scripts
* Fix: pmpro admin label undefined field_name
* Fix: PMPro renewals now always restore billing/fiscal data (private: codice fiscale; company/freelance: P.IVA/SDI) from user or previous order, avoiding loss when SDI is absent.
* Change: document date now always uses emission time (now); od_date uses operation date for invoices or linked document date for credit notes; invoice_date for credit notes uses the linked invoice date.
* Removed: hook 'wfc-create-invoice_datetime-invoice' to prevent external overrides on od_date.

= 6.6.0 - 23/01/2026 =
* Fix: run checkout block validation/save hooks only when WooCommerce is active.
* Fix: guard checkout block loading so the plugin doesn’t load WC blocks when only PMPro is used.
* Fix: pass the provider to Invoice API, Peppol, and Webhook actions in the order list to support non-WooCommerce providers.

= 6.5.9 - 20/01/2026 =
* Add: PEPPOL via POP action to check document state from the admin with new stateInvoice AJAX endpoint and UI button.
* Fix: Applied wc_el_inv-invoice_progressive_file_number filter when generating PDFs and pass context (pdf/xml) to the hook.
* Fix: Use peppol_pop-{type}_uuid meta key when handling PEPPOL POP documents to read the correct UUID.

= 6.5.8 - 08/01/2026 =
* Add: resolveOrder
* Fix: disableInvoiceOnOrderTotalZero, add support for auto completed order
* Fix: getNature and getRefN

= 6.5.7 - 23/12/2025 =
* Add: Freshworks widget
* Fix: PMPro update fields from admin
* Fix: Aruba - ArgumentCountError: Too few arguments to function "WooPoPToFattureArubaJobsScheduledNotify"
* Fix: Added mergeOrdersById in src/Admin/XmlOrderListTable.php to aggregate results without duplicates.

= 6.5.6 - 12/12/2025 =
* Add: localization fr_FR.po
* Fix: CF check and add setCustomValidity message
* Fix: Limit order search queries to bounded pages and meta lookups to prevent timeouts on stores with many orders while still allowing direct invoice/order number lookups.
* Fix: Sync PMPro billing fields with PMPro meta, force invoice date on success, update translations

= 6.5.5 - 03/12/2025 =
* Fix: PMPro - save invoice number from admin

= 6.5.4 - 03/12/2025 =
* Fix: vendor error

= 6.5.4 - 03/12/2025 =
* Fix: vendor error

= 6.5.3 - 03/12/2025 =
* Add: update Fatture in Cloud SDK
* Fix: lista_errori from notifications
* Fix: extend WC_EL_INV_UBL_COUNTRIES
* Fix: reactivated 'wc_el_inv-options-capability' filter
* Fix: support for custom customer type
* Fix: Force attachments for custom emails and normalize XML handling
* Fix: integrations image references
* Fix: PMPro - separate checkout/renewal logics
* Fix: PMPro - fix running during webhooks only
* Fix: PMPro - pop_pmproAdjustRenewalTax_CouncilDirective_2006_112_EC return order
* Fix: PMPro - check in pmpro_after_checkout order $orderProvider instanceof POPxPMPro\Providers\Order
* Fix: PMPro - add fallback 'invoice' to all get_billing_choice_type()
* Fix: PMPro - fix edit order url
* Add: Allow updating the invoice number from the admin order edit screen.

= 6.5.2 - 22/10/2025 =
* Fix: Removed unintended exit statement that caused script termination in certain cases.

= 6.5.1 - 22/10/2025 =
* Fix: "GeneralFields" Class not found to addon/for/pmpro/inc/snippets/billing-fields-in-order.php:200

= 6.5.0 - 22/10/2025 =
* Add: checkAndUpdateFormattedNumber to update the invoice number (if needed) when the xml is generated
* Add: sdi_pop-invoice_validation_errors contains invoice validation errors
* Add: shopCountry check for apply Bollo and Rivalsa
* Add: error message for UUID exist
* Fix: save formatted number invoice and credit note on save metabox
* Fix: getXmlFromOrder - added action and method parameter check to correctly return JSON response from integrations
* Fix: postal code to XML for PEPPOL
* Fix: retry request, only one request for integration
* Improved: Stamp duty and INPS surcharge handling in PMPro checkout
Added dynamic management of stamp duty and INPS surcharge during the Paid Memberships Pro checkout process.
Fees are now calculated and added to the order before gateway processing, with proper tax exclusion.
Metadata for both fees are stored in the order for accurate invoicing and reporting.

= 6.4.0 - 01/09/2025 =
* Fix: Uncaught Error: Class > fattureincloud/src/Jobs.php:122

= 6.3.9 - 25/09/2025 =
* Fix: getXmlFromOrder xml for integrations - error (param string is array)
* Fix: Error Uncaught ArgumentCountError: Too few arguments to function ..inc/wc/filters.php:218
* Fix: condition for Invoice not generated message

= 6.3.8 - 22/09/2025 =
* Add: allowed reverse charge for growth level
* Fix: minor fix

= 6.3.7 - 04/09/2025 =
* Fix: sdi via pec Progressive file number generator
* Fix: sdi via pec Progressive file number generator
* Fix: output_buffering XML generator
* Fix: POP billing fields current value from user logged in
* Add: customer email to popapi payload

= 6.3.6 - 01/09/2025 =
* Fix: Init frontend block

= 6.3.5 - 29/08/2025 =
* Fix: invoiceFields loadEvent from checkout standard

= 6.3.4 - 28/08/2025 =
* Fix: minor fix

= 6.3.3 - 28/08/2025 =
* Add: POP checkout fields for WooCommerce Block
* Add: extra log for cron job
* Fix: various minor fix

= 6.3.2 - 09/08/2025 =
* Fix: count error for "temp_order_filtered" options

= 6.3.1 - 07/08/2025 =
* Fix: getListKeyValue support code key

= 6.3.0 - 07/08/2025 =
* Fix: order customer display name and edit link
* Fix: added invoice number param to sdi-via-pop/document-preserve
* Fix: sdi_pop_notifications visibility
* Fix: check invoice send on uploadInvoice() (sdi via pec)
* Fix: product get meta
* Fix: FIC get invoice date from CreateXml::dateInvoice (change visibility method)
* Add: admin notice for WC prices include tax
* Add: support multi provider for JOBS
* Add: notice for reviews
* Add: log and list errors to notificationsInvoice
* Add: added functionality for batch downloads with AJAX
* Add: added API key management system and ability to create new API keys
* Add: support for PMPro as a provider for generating invoices and credit notes
* Add: SdI via POP - check to avoid sending if the invoice already has a uuid, and check notifications based on current uuid
* Improved: creation of progressive file number
* Improved: remove inline scripts (integration and wizard)
* Improved: extend extra address info for fatture in cloud - add file integration.js, wizard.js

= 6.2.5 - 14/07/2025 =
* Fix: Call to a member function format() on null - InvoiceFields.php:788
* Add: support for revolut_cc to getPaymentMethodInvoiceCode
* Add: Support for San Marino, XML creation and SdI submission for companies and freelancers, PDF creation for private clients
* Improved: SdI via POP notification error message - add error list

= 6.2.4 - 09/07/2025 =
* Fix: filterRefundedOrders for multi refund
* Fix: get_invoice_sent, get_invoice_sent_timestamp, set_invoice_sent and set_invoice_sent_timestamp order id (refund order id used)
* Fix: error "Provider name is required"

= 6.2.3 - 08/07/2025 =
* Fix: src/WooCommerce/Providers/OrderRefund get_order_number_invoice meta key
* Fix: credit note action for SdI via POP and Webhook
* Fix: style actions button

= 6.2.2 - 07/07/2025 =
* Add: Webhook integration (POP → Webhook) – automatically send invoice data to external services via JSON or XML.
* Add: Added UI on popapi.io > My Account > Integrations > POP to Webhook > Connect to create and manage custom webhooks (name, URL, format).
* Add: Plugin settings section under Advanced > Webhook to activate webhooks and configure webhook ID.
* Add: Option to enable CRON-based automation for webhook data delivery.
* Add: Flattened JSON structure for better compatibility with Zapier, Make.com, Google Sheets and other no-code tools.
* Add: Arrays (e.g., order_items) are now dynamically indexed (order_items_0, order_items_1, etc.) for easier parsing.
* Add: Proper Content-Type header based on selected format (JSON or XML).
* Add: Fallback error message if webhook is not properly configured or data is missing.
* Improved: Better separation of logic for encoding and sending webhook data for maintainability and clarity.

= 6.2.1 - 07/07/2025 =
* Fix: Undefined property

= 6.2.0 - 30/06/2025 =
* Add: added SDI integration via POP for direct sending to SDI
* Add: filter "pop_use_local_cache"
* Add: integration SDI via POP
* Add: style for integration SDI via POP
* Add: class InvoiceApi
* Add: scripts ajax call create and notify for SDI via POP
* Add: user_level localized var for admin.js
* Add: filter w3tc_can_print_comment, delete comments from XML
* Add: added configuration update request when requesting license update to align any changed data based on the active level
* Improve: I show invoice data inside the order and in the woocommerce order list even in the "suspended" status if there is a previously created invoice number

= 6.1.9 - 04/06/2025 =
* Fix: getMimeType function (application/xml and text/xml)
* Add: filter "wc_el_inv-invoice-number" to invoiceNumber

= 6.1.8 - 29/05/2025 =
* Fix: returnLocalFile for DOING_CRON context
* Fix: createFromCloud > popApi result for DOING_CRON context
* Fix: check the order status set during the invoice creation flow
* Fix: minor style fix
* Add: getMimeType function

= 6.1.7 - 21/05/2025 =
* Fix: wizard flow
* Fix: discount unit

= 6.1.6 - 20/05/2025 =
* Fix: Refactored PDF generation via REST API for authenticated access
* Fix: xml/pdf file name format
* Fix: Normalize type for XML (no XML format for receipt)
* Fix: remove abs for fee total_tax
* Fix: Cannot declare class (WooPopEmails > emailClasses)

= 6.1.5 - 28/04/2025 =
* Add: update level info button
* Fix: code optimization and cleanup
* Improve: API performance

= 6.1.4 - 22/04/2025 =
* Add: support for "scalapay" payment method
* Add: getPaymentMethodInvoiceCode and return MP08 as fallback when mapped methods do not match
* Fix: DatiTrasmissione for Aruba addon
* Fix: checked uploadFileName property Aruba response
* Fix: paymentMethodCode

= 6.1.3 - 11/04/2025 =
* Fix: check mime_content_type

= 6.1.2 - 10/04/2025 =
* Fix: Create XML API params
* Fix: Allowed addon update by level
* Fix: Set default number_next_invoice and invoice_required
* Fix: filename param
* Fix: returnLocalFile enhanced file access security by validating file paths and types.

= 6.1.1 - 09/04/2025 =
* Update version and readme

= 6.1.0 - 31/03/2025 =
* Fix: removed the options un used for ES account
* Improve: configuration panel
* Add: API v2 introduced
* Add: clear cached legal files on account change

= 6.0.5 - 12/03/2025 =
* Fix: Call to a member function get_sku() on bool
* Fix: The queried order is useful only when requesting single items
* Fix: popApi function should always return a string
* Fix: invoice table limit query to 500 results
* Fix: optimizations for getOrder and getOrders
* Fix: ES language
* Dev: two filters "wc_el_inv-list-orders-limit-default" and "wc_el_inv-list-orders-limit-max"

= 6.0.4 - 10/03/2025 =
* Fix: code work flow for attachment PDF
* Improved: invoice date, added custom meta to set date for processing status

= 6.0.3 - 07/03/2025 =
* Fix: allowed addon request
* Add: button for update allowed addon data from level

= 6.0.2 - 03/03/2025 =
* Fix: request api

= 6.0.1 - 28/02/2025 =
* Fix: getCurrentLanguage error

= 6.0.0 - 27/02/2025 =
* Starting from this version, the Pro version has been fully integrated into the core plugin.
This means a single, more powerful solution with all features included by default.

= 3.3.4 - 23/01/2025 =
* Add: POP customer notifications

= 3.3.3 - 28/10/2024 =
* Fix: string localization

= 3.3.2 - 11/10/2024 =
* Update version

= 3.3.1 - 18/11/2023 =
* Fix: toggleBillingCompany (receipt and reset event)

= 3.3.0 - 17/10/2023 =
* Add: XML tag ScontoMaggiorazione for discount
* Add: Support for High-Performance Order Storage
* Fix: choiceType method, icon for receipt (credit note)
* Fix: admin style

= 3.2.2 - 11/09/2023 =
* Fix: checkout validation (conditions)
* Fix: checkout process (conditions)

= 3.2.1 - 08/07/2023 =
* Fix: checkout invoice type empty check
* Fix: tax code billing field validation for association
* Fix: billing fields HTML Injection
* Add: support for WooCommerce 7.8.x

= 3.2.0 - 02/01/2023 =
* Fix: minor fix
* Add: support for WooCommerce 7.2.x
* Improve: moved general invoice options

= 3.1.3 - 28/11/2022 =
* Fix: sprintf() arguments

= 3.1.2 - 27/11/2022 =
* Fix: minor fix
* Add: support for WordPress 6.1.x
* Add: support for WooCommerce 7.1.x

= 3.1.1 - 28/10/2022 =
* Add: support for WooCommerce 7.x.x

= 3.1.0 - 20/10/2022 =
* Fix: wcOrderClassName class name check
* Add: support payment_method igfs Credit Card (PagOnline Imprese)

= 3.0.4 - 10/10/2022 =
* Fix: billing_company required if customer type is "company"
* Dev: Add filter hook invoice Field args "billing_invoice_field_args"

= 3.0.3 - 14/09/2022 =
* Add: support for WooCommerce 6.9.x
* Add: information and controls for the main options to configure

= 3.0.2 - 24/07/2022 =
* Fix: create xml query bug
* Add: support for WooCommerce 6.7.x

= 3.0.1 - 15/07/2022 =
* Fix: create pdf
* Fix: create pdf generate limit

= 3.0.0 - 24/06/2022 =
* Add: support for WordPress 6.0.x
* Add: support for WooCommerce 6.6.x
* Add: Download of XML invoices for the last 5 orders
* Fix: various style fix

= 2.0.4 - 25/05/2022 =
* Fix: list order XmlOrderListTable (unset order) if Invoice order not sent and order total is equal total refunded or order total is zero
* Add: support payment_method soisy
* Add: payment method info in the invoice table

= 2.0.3 - 24/05/2022 =
* Fix: filter_var support for PHP >= 8.1

= 2.0.2 - 22/05/2022 =
* Fix: optimization code and clear unnecessary
* Fix: filter_input, filter_var filter for PHP >= 8.1

= 2.0.1 - 21/05/2022 =
* Fix: Error due to missing file vendor

= 2.0.0 - 20/05/2022 =

* Dev: autoload psr-4
* Update: admin style
* Add: support for WooCommerce 6.5.x
* Add: support for WordPress 5.9.x

= 1.3.3 - 17/11/2021 =

* Fix: minor fix.
* Add: support for WooCommerce 5.9.x
* Add: support for WordPress 5.8.x

= 1.3.2 - 01/09/2021 =

* Add: support for WooCommerce 5.6.x
* Add: support for WordPress 5.8.x

= 1.3.1 - 12/05/2021 =

* Fix: minor fix and update description.

= 1.3.0 - 08/05/2021 =

* Add: support for WooCommerce 5.2.x
* Add: support for WordPress 5.7.x

= 1.2.0 - 30/03/2020 =

* Fix: support for WooCommerce 4.0.0

= 1.1.1 - 05/06/2019 =

* Fix: check on vat if you choose the receipt

= 1.1.0 - 08/05/2019 =

* Add: Receipt PDF template
* Add: Option to choose the type of document (invoice or receipt) in the checkout
* Tweak: Order/invoice list table layout

= 1.0.0 =
* Initial release
