=== Invoicing Integration for inFakt and WooCommerce ===
Contributors: Devikit
Tags: woocommerce, infakt, accounting, invoice, faktura
Requires at least: 5.8
Tested up to: 7.0
Stable tag: 1.0.28
Requires PHP: 7.4
License: GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.html

WooCommerce integration with inFakt accounting system.

== Description ==

This plugin provides an integration between WooCommerce and the inFakt accounting system, allowing automatic (PRO version) and manual invoice generation based on WooCommerce orders.

https://youtu.be/Zeb7GAentI4

= Features (Free version) =
*   Manual invoice generation from order edit screen.
*   Customer data synchronization (create/update in inFakt).
*   Storing invoice number in order.
*   Invoice link preview.
*   API communication logs.
*   Advanced VAT rate mapping.
*   Flat rate tax support.

= Pro Version =

A Pro version is also available with additional features:

*   Automatic invoice generation after status change.
*   Proforma invoice support.
*   Email notifications with PDF attachments.
*   Bulk operations on orders list - generate invoices/proformas and send emails for multiple orders at once.
*   KSeF integration via InFakt - manual and automatic sending to Polish National e-Invoice System.
*   WooCommerce Subscriptions compatibility.
*   Technical support.

**[Get PRO Version](https://devikit.pl/produkt/infakt-woocommerce-pro/)**

== Installation ==

1. Upload `invoicing-integration-for-infakt-and-woocommerce` folder to `/wp-content/plugins/` directory.
2. Activate the plugin in WordPress Plugins menu.
3. Go to WooCommerce -> InFakt and enter your API key.

== External services ==

This plugin relies on the inFakt API, a third-party accounting service, to generate invoices and manage customer data.

= What is inFakt API? =

inFakt is a Polish online accounting system that provides invoicing and accounting services for businesses. This plugin uses their official API to:
*   Create and manage customers (clients) in your inFakt account.
*   Generate invoices and proforma invoices (PRO version).
*   Retrieve bank accounts, VAT exemption reasons, and other accounting data from your inFakt account.
*   Download invoice PDFs.
*   Send invoices to KSeF (Polish National e-Invoice System) via InFakt (PRO version).

= What data is sent and when? =

The plugin sends the following data to inFakt API (https://api.infakt.pl/v3) in these situations:

**When you click "Create Invoice" or when automatic invoice generation is triggered (PRO version):**
*   Customer billing information: first name, last name, company name, VAT number (NIP), email, phone number, billing address (street, city, postal code, country).
*   Order information: order items (product names, quantities, prices, VAT rates), shipping details, payment method, order date, order total.

**When the plugin connects to inFakt API (on settings page load or when needed):**
*   Your inFakt API key (for authentication).
*   Requests to retrieve your account settings: bank accounts, VAT exemption reasons, income categories, flat rate tax options.

**No data is sent automatically without your action.** The plugin only communicates with inFakt API when:
*   You manually create an invoice from the order screen.
*   You enable automatic invoice generation in PRO version.
*   You open the plugin settings page (to load account configuration).

= Service provider information =

*   **Service name:** inFakt API
*   **Service URL:** https://www.infakt.pl/
*   **API documentation:** https://www.infakt.pl/api/
*   **Terms of Service:** https://www.infakt.pl/regulamin/
*   **Privacy Policy:** https://www.infakt.pl/polityka-prywatnosci/

By using this plugin, you acknowledge that customer and order data will be transmitted to inFakt for invoice generation purposes. You are responsible for ensuring compliance with applicable data protection laws (including GDPR) and informing your customers about this data processing.

== Screenshots ==

1. Invoice creation panel on order edit screen - manually generate invoices from WooCommerce orders.
2. API Connection settings - connect your inFakt account with API key and test connection.
3. Invoicing settings (part 1)
4. Invoicing settings (part 2)
5. Shop settings
6. Automations settings (part 1) (PRO)
7. Automations settings (part 2) (PRO)
8. Advanced settings - plugin logs, debugging options and troubleshooting tools.

== Changelog ==

= 1.0.28 =
* Add: Devikit Care banner in WordPress admin with dismiss options
* Add: Devikit Care sidebar widget on plugin settings page
* Add: Devikit Care dashboard widget
* Fix: Pro upgrade banner restyled to match Care banner style

= 1.0.27 =
* Fixed: PRO upgrade banner styling after WordPress 7.0 admin refresh (button borders and notice link styles).
* Improved: Banner layout with dedicated CSS and increased top padding.

= 1.0.26 =
*   Fix: NIP field now saves correctly in WP Admin user profile and synchronises with My Account edit address (bidirectional sync).
*   Fix: NIP is now populated when selecting a customer or clicking "Load billing address" in admin order edit screen.

= 1.0.25 =
*   Updated: Tested up to WordPress 7.0.

= 1.0.24 =
*   Updated: readme Pro purchase link text (Get PRO Version).

= 1.0.23 =
*   Updated: readme Pro CTA restored as subsection heading with bold link anchor.

= 1.0.22 =
*   Updated: readme Description layout (intro + bare YouTube URL for directory embed); Pro CTA link formatting.

= 1.0.21 =
*   Added: demo video link in readme (YouTube).

= 1.0.20 =
*   Fixed: VAT class mapping for WooCommerce "Standard" rate (empty tax class slug): product lines now respect ZW / 0% / NP mapping from plugin settings instead of skipping mapping and sending tax_symbol "0", which broke invoices when vat_exemption_reason was set.

= 1.0.19 =
*   Fixed: paid amount on invoice (paid_price) is now sent to the inFakt API in minor currency units (grosze), matching other amounts — previously PLN values were interpreted as grosze, so e.g. 1199.00 PLN appeared as 11.99 PLN.

= 1.0.18 =
*   Updated: screenshot #4 (assets) for plugin directory.

= 1.0.17 =
*   Updated: screenshot #4 (assets) for plugin directory.

= 1.0.16 =
*   Added: optional setting (Invoicing) — sale date on inFakt invoice can match invoice issue date instead of WooCommerce order date; Polish translations and compiled pl_PL.mo.

= 1.0.15 =
*   Fixed: map WooCommerce payment gateways to inFakt API payment_method codes (transfer, przelewy24, paypal, delivery, card, etc.) instead of sending the checkout title string; added filter devikit_infakt_payment_method.
*   Fixed: payment due date calculation used an undefined variable when payment deadline days were set (now based on invoice issue date).

= 1.0.14 =
*   Maintenance: release republish (same codebase as 1.0.13 shipping VAT fixes).

= 1.0.13 =
*   Fixed: VAT on shipping lines now follows WooCommerce order data (tax amounts) and tax-class mapping (including Standard rate and zw/np/0), instead of inheriting from cart products or defaulting to 0% incorrectly. Shipping with tax class "inherit" falls back to product line rates when appropriate.

= 1.0.12 =
*   Improved: when billing address line 1 is street-only and line 2 contains building and/or flat (e.g. PL formats like 15/3, 15 m. 3), values are mapped to Infakt street_number and flat_number. Filters: devikit_infakt_parse_billing_address_line2, devikit_infakt_client_address_from_order.

= 1.0.11 =
*   Fixed: save_admin_order_nip - WooCommerce może przekazać WP_Post zamiast WC_Order; użycie instanceof WC_Order zapobiega błądowi "Call to undefined method WP_Post::update_meta_data()".

= 1.0.10 =
*   Edytowalne pole NIP w meta zamówienia (sekcja adresu rozliczeniowego).

= 1.0.9 =
*   Walidacja sumy zamówienia vs faktura w kolumnie listy zamówień.
*   Opóźniona wysyłka e-maila (5 min) przy automatycznym tworzeniu faktur/proform.

= 1.0.8 =
*   Fixed Pro upgrade banner dismiss functionality (remind later and don't remind buttons).

= 1.0.7 =
*   Small fixes.

= 1.0.6 =
*   Fixed default checkbox label translation on first installation.

= 1.0.5 =
*   Added plugin screenshots.
*   Updated readme descriptions.

= 1.0.4 =
*   Added Plugin URI for WordPress.org integration.

= 1.0.3 =
*   Removed "Including product variants in invoices" from Pro features list.

= 1.0.2 =
*   Fixed Pro banner title.

= 1.0.1 =
*   Added promotional banner for Pro version.
*   Updated feature list.

= 1.0.0 =
*   First public release.


