=== Sąskaita plius ===
Contributors: saskaitapliuslt
Tags: woocommerce, invoices, accounting
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 8.0
Requires Plugins: woocommerce
Stable tag: 0.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Create Sąskaita plius invoices from WooCommerce orders through the public Sąskaita plius API.

== Description ==

Sąskaita plius connects a WooCommerce store to the Sąskaita plius invoicing service. It creates invoices automatically when an order reaches a selected status, or manually from the WooCommerce order actions menu.

This plugin connects to an external SaaS service. It requires an active [Sąskaita plius](https://www.saskaitaplius.lt/registracija) PRO plan and an API key with the “Read and write” access level.

Main features:

* Create invoices from WooCommerce orders automatically or manually.
* Configure a business activity, invoice series, unit, payment method, and invoice status.
* Keep separate invoice settings for each Sąskaita plius business activity.
* Update the Sąskaita plius payment status when a WooCommerce order is paid later.
* Map WooCommerce payment gateways and tax classes to Sąskaita plius values.
* Map third-party B2B order fields to company and VAT details.
* Download the generated invoice PDF from the WooCommerce order administration screen.

The plugin does not change the WooCommerce checkout form. It can read fields added by another company-details or VAT plugin when their order meta keys are configured in the integration settings.

For a 0% or non-taxable transaction, configure the specific VMI i.SAF VAT classification code that matches the transaction basis. `PVM0` is not a valid VMI classification code.

== External services ==

This plugin connects to the Sąskaita plius API only after a site administrator enters an API key and checks the connection, refreshes metadata, creates an invoice, synchronizes a payment, or downloads a PDF.

The plugin may send WooCommerce order data to the Sąskaita plius API: order and payment details; customer name, company, tax, contact and address details; and product, shipping, or fee line details. It also sends the technical idempotency fields `source=woocommerce` and `external_id=wc-order-{order_id}`.

The plugin uses WooCommerce line totals as the source of truth for invoice amounts. It does not synchronize remote inventory. Negative fee lines stop invoice creation so that an incorrect invoice is not created.

Sąskaita plius terms of service: https://www.saskaitaplius.lt/naudojimosi-salygos

Sąskaita plius privacy policy: https://www.saskaitaplius.lt/privatumo-politika

== Installation ==

1. Upload and activate the plugin in WordPress.
2. Make sure WooCommerce is installed and active.
3. In Sąskaita plius, open Integrations -> API and create an API key with the “Read and write” access level.
4. Open WooCommerce -> Sąskaita plius.
5. Enter the API key, save settings, check the connection, and refresh metadata.
6. Select the business activity and its invoice settings.

== Frequently Asked Questions ==

= Does the plugin work without a Sąskaita plius account? =

No. An active Sąskaita plius PRO plan and API key are required.

= Does the plugin send data immediately after activation? =

No. Data is sent only after an administrator configures the API key and starts a supported integration action.

= Does the plugin modify the WooCommerce checkout form? =

No. It does not add or change checkout fields.

= Are refunds or cancelled orders synchronized automatically? =

The current version does not create credit invoices for refunds automatically. A cancelled order can optionally mark the related invoice payment status as cancelled.

= Does the plugin synchronize inventory? =

No. WooCommerce SKU values are sent as invoice line codes, but the plugin does not create, update, or reserve stock.

== Support ==

For setup help or to report an issue, contact the [Sąskaita plius team](https://www.saskaitaplius.lt/kontaktai).

== Screenshots ==

1. Connection settings.
2. Invoice and business activity settings.
3. Customer field mapping.
4. VAT class mapping.
5. Sąskaita plius order metabox.

== Changelog ==

= 0.1.0 =

* Initial release.
* Invoice creation from WooCommerce orders.
* API connection check and metadata refresh.
* Business activity, payment gateway, VAT class, and customer field settings.
* Payment synchronization and PDF download.

== Upgrade Notice ==

= 0.1.0 =

Initial public release.
