=== Factugo for WooCommerce ===
Contributors: graficaves
Tags: woocommerce, invoice, afip, arca, argentina
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.3
Requires Plugins: woocommerce
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Issue Argentine electronic invoices (ARCA, formerly AFIP) from your WooCommerce orders, without leaving WordPress.

== Description ==

Factugo connects your WooCommerce store to Argentine electronic invoicing. You invoice
from the order itself, using a panel where you can review and adjust everything before
issuing. The result is a real invoice with a CAE authorization code, and the PDF is
emailed to the buyer.

This plugin is for stores that sell in Argentina and must issue invoices through ARCA
(the Argentine tax authority, formerly known as AFIP).

**What it does**

* An "Invoice" button on every order, opening an editable panel: document type, buyer details, line items, quantities, prices and VAT rates.
* The invoice number and CAE are stored on the order, with a link to the PDF.
* Void a sale with a credit note, the way the tax authority requires: an authorized invoice is never deleted or edited.
* Optional automatic invoicing when an order reaches the status you choose.
* A tax ID (CUIT or DNI) field at checkout, which is what makes A-type invoices possible.
* Invoice several orders at once from the order list.
* An invoice screen inside WordPress, with access to every PDF.
* For "monotributo" taxpayers, how much you have invoiced against your bracket's ceiling.

**What it deliberately does not do**

The plugin knows nothing about ARCA: no certificates, no tax credentials, no numbering,
and no rules about which document type applies to your tax status. All of that lives in
Factugo, which is where the certificate and the numbering control are. The plugin asks
and displays.

= External service =

This plugin **depends on Factugo** (https://factugo.com.ar), an Argentine electronic
invoicing service, to issue documents through ARCA. Without a Factugo account the plugin
cannot issue anything: it is a client of that service, not an issuer on its own.

**What data is sent, and when.** The plugin contacts the Factugo API
(https://factugo.com.ar/api/v1) only when you perform one of these actions:

* When you save your API key in the settings and when you open the plugin screens, to read your company details (legal name, tax ID, tax status, plan, and documents issued this month).
* When you issue a document: the order line items (description, quantity, unit price and VAT rate), the buyer's name, email and tax ID if present, and an order reference used to prevent duplicates.
* When you issue a credit note, resend a document by email, or list your documents.

**Nothing is sent until you enter an API key**, and no browsing data, site data or
visitor data is ever transmitted.

Terms of service: https://factugo.com.ar/legal/terms
Privacy policy: https://factugo.com.ar/legal/privacy

= You need a Factugo account =

There is a free tier with 3 documents per month, renewed monthly. To issue documents you
must delegate your tax ID to the service from your ARCA credentials — a one-time,
free procedure that Factugo guides you through. You do not need to buy or install any
digital certificate.

The plugin interface is in Spanish, since it serves Argentine stores.

== Installation ==

1. Upload the plugin from Plugins → Add New → Upload Plugin, and activate it.
2. Go to Factugo → Settings.
3. Paste the API key you generate in your Factugo dashboard, under Settings → API Keys.
4. Save. If the connection works, your company details will be displayed.

== Frequently Asked Questions ==

= Is this a real invoice or just a receipt? =

It is a valid electronic invoice, with a CAE authorization code issued by ARCA and its QR
code. The same document you would issue from the ARCA website, without going there.

= Do I need to buy a digital certificate? =

No. Factugo uses its own certificate, and you delegate the electronic invoicing service to
it from your tax credentials. It is a one-time, free procedure.

= Can I issue the same invoice twice by mistake? =

No. Every order carries a unique reference. If you press Issue again, or if the connection
drops and you retry, Factugo returns the document that already existed instead of issuing
a new one.

= What happens if ARCA does not respond? =

The document is saved and the order shows as "Pending". You retry whenever you want and it
will not be duplicated. You will never see an order marked as invoiced without a CAE.

= My store has no taxes configured. Does it still work? =

Yes, and that is the most common setup in Argentina. For C-type invoices the price is
invoiced as-is, since that type does not itemize VAT. For A or B types, the plugin extracts
the VAT from the price you charged instead of adding it on top.

= Can I edit the line items before issuing? =

Yes, that is what the panel is for: you can edit descriptions, quantities, prices and VAT
rates, add lines and remove others. An authorized document cannot be edited afterwards, so
it is worth reviewing first.

= What if I have to void a sale? =

You issue a credit note from the same order. Factugo links it to the original invoice, as
the tax authority requires.

= Does it work with HPOS (WooCommerce High-Performance Order Storage)? =

Yes, and with the legacy post-based storage too. The same goes for the classic checkout and
the block-based checkout.

== Screenshots ==

1. The invoicing panel: review and adjust everything before issuing.
2. The Invoice column in your order list, showing the number once issued.
3. Connect your account by pasting an API key, and see your details and tax ceiling.
4. All your documents, inside WordPress, with access to every PDF.

== Changelog ==

= 1.0.3 =
* Declared the WooCommerce dependency with the "Requires Plugins" header, so
  WordPress 6.5+ checks it is installed and active before activation.

= 1.0.2 =
* The account-creation link in the settings screen now lands on the free plan
  for WooCommerce stores (14-day full trial, then 3 documents per month).

= 1.0.1 =
* Currency guard: orders in a currency other than ARS are no longer sent to be
  invoiced with their amounts misread as pesos. A clear message explains what to
  do instead.

= 1.0.0 =
* First release: invoicing panel, credit notes, automatic invoicing, tax ID field at
  checkout, bulk invoicing and a document list screen.

== Upgrade Notice ==

= 1.0.3 =
Declares the WooCommerce dependency.

= 1.0.2 =
Account-creation link lands on the right free plan.

= 1.0.1 =
Adds a currency guard for stores that sell in currencies other than ARS.

= 1.0.0 =
First release.
