=== Pinzell Latam – Tax fields, geography and Libro de Reclamaciones ===
Contributors: rgcglobalnet
Tags: woocommerce, latam, ruc, rfc, libro de reclamaciones
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Latin-American checkout fields for WooCommerce: validated RUC, DNI, RUT, RFC, NIT, CUIT; district lists; Peruvian Libro de Reclamaciones.

== Description ==

Pinzell Latam adds the tax and identity fields that stores in Latin America need at checkout, checks them locally, and offers the Peruvian *Libro de Reclamaciones* (virtual complaints book). **It does not issue invoices and does not query any tax authority**: it validates the *format and check digit* of the number, which catches typing mistakes before the order is placed. Whether a RUC, RFC or CUIT is active or belongs to that person is something only the authority can tell you.

= Checkout fields (WooCommerce) =

* **Document type and number**, per billing country, with validation of length, characters and check digit:
  * Peru: DNI, RUC, CE (carné de extranjería).
  * Chile: RUT (módulo 11).
  * Mexico: RFC for persona física and moral (structure and date; the check digit is optional because the SAT has issued RFCs that do not follow the published algorithm).
  * Colombia: NIT (módulo 11 with the DIAN weights), cédula de ciudadanía, cédula de extranjería.
  * Argentina: DNI, CUIT, CUIL (módulo 11).
  * Ecuador: cédula de identidad and RUC (natural person, public and private company; for private companies only the structure is checked, because the SRI issues RUCs that do not follow the check-digit rule).
  * Uruguay: cédula de identidad and RUT.
* The type list per country, whether the document is required, and which countries are active are settings.
* **Department / province / district** (Peru), **comuna** (Chile), **municipio** (Mexico), **departamento/partido** (Argentina) and **localidad** (Uruguay), from official open datasets bundled with the plugin (no remote calls). Modes: off, *suggest* (autocomplete; unknown names are accepted) or *strict* (only the official list). The district is stored in the canonical spelling and, for Peru, with the INEI ubigeo code.
* **Block checkout and classic checkout.** The block checkout uses WooCommerce's Additional Checkout Fields API (WooCommerce 9.9 or later); validation also runs on the server when the order is placed.
* **HPOS** (custom order tables) compatible. Everything is stored with the order CRUD API.
* The values appear on the order screen (editable), on the thank-you page and in the order e-mails.

= Libro de Reclamaciones (Peru) =

A complaints book for businesses that sell to consumers in Peru. It follows the structure of the *Hoja de Reclamación* (Annex I of DS 011-2011-PCM, as amended) and works **without WooCommerce**.

* Public form on a page (shortcode `[pinzell_libro_reclamaciones]`; a button creates the page) and a permanent footer link (or shortcode `[pinzell_libro_link]`). No login or purchase is needed to file a claim.
* Consumer identification (with the guardian for minors), product or service, *reclamo* or *queja*, detail, request, optional claimed amount and order reference, optional attachments (PDF, images; stored in a private folder and checked by real file type).
* **Correlative number** `000000001-2026`, assigned automatically and without gaps by the database, with date and time.
* **E-mail copy** to the consumer (proof of submission) and notification to the business, with a link to the register. A confirmation page with a print button.
* **Admin register**: search, filter by status, detail view of the sheet with attachments, response box that can be e-mailed to the consumer, status (received, in review, answered).
* **Two-year retention**: claims cannot be deleted before the two years the regulation requires. WordPress personal-data export and erase tools are registered (erasure is refused for claims inside the retention period).
* Anti-spam without third-party services: signed time token, honeypot and a per-connection rate limit. No cookies, no CAPTCHA, no remote calls.

This plugin is a tool to help you comply; **it is not legal advice**. Check the current rules with INDECOPI (https://www.gob.pe/indecopi) or your adviser. A draft amendment of the Reglamento (RM 244-2026-PCM, July 2026) was published for comments while this version was written; the plugin follows the text in force and the form content proposed in the draft.

= Free vs Pro =

| Feature | Free | Pro |
| --- | --- | --- |
| Document types and validation for PE, CL, MX, CO, AR, EC, UY | Yes | Yes |
| Department / province / district lists (PE, CL, MX, AR, UY) | Yes | Yes |
| Block checkout, classic checkout, HPOS | Yes | Yes |
| Libro de Reclamaciones: form, correlative number, e-mail copy, admin register, attachments | Yes | Yes |
| Español (and Latin-American variants), English, Português | Yes | Yes |
| Hoja de Reclamación as a PDF (attached to the consumer e-mail, download link) | – | Yes |
| Tracking page: the consumer looks up status and answer with number + e-mail | – | Yes |
| 15-business-day deadline per claim, alerts by e-mail, overdue marks | – | Yes |
| CSV export of the register | – | Yes |
| Mexico: invoice request (régimen fiscal, uso de CFDI, código postal) checked against the RFC | – | Yes |

Pinzell Latam Pro is a separate add-on, sold separately at https://rgcglobalnet.com/pinzell-latam/. Everything listed as Free is complete and has no time limit.

= Data sources and licences =

The check-digit algorithms are public specifications of each authority. The place lists are open data, bundled in `data/` and shown in Settings → Pinzell Latam:

* **Peru** – INEI ubigeo codes and names, from the open compilation *ubigeo-peru-aumentado* by Jesús M. Castagnetto (MIT licence, https://github.com/jmcastagnetto/ubigeo-peru-aumentado) of INEI / RENIEC / MINSA data, checked against the MINSA table *Códigos equivalentes de UBIGEO* (datosabiertos.gob.pe) – Open Data Commons Attribution License (ODC-By 1.0), https://opendatacommons.org/licenses/by/1-0/
* **Chile** – SUBDERE / IDE Chile, *División Política Administrativa* (datos.gob.cl) – Creative Commons Attribution (CC BY)
* **Mexico** – INEGI, *Catálogo Único de Claves de Áreas Geoestadísticas* – INEGI "Términos de libre uso de la información" (free use, with attribution)
* **Argentina** – Servicio de Normalización de Datos Geográficos (Georef, datos.gob.ar: IGN, BAHRA, INDEC) – Creative Commons Attribution 4.0
* **Uruguay** – INE, *Localidades censales* via IDEUy – Licencia de Datos Abiertos (free use citing INE as the source)
* Colombia and Ecuador keep WooCommerce's own states: the open datasets available for Colombia carry a share-alike licence and the Ecuadorian portal could not be used, so they are not included.

Full text, URLs and algorithms are in `docs/SOURCES.md` of the project and in `data/LICENSES.txt`.

= External services =

None. All datasets and algorithms are in the plugin and it makes no remote requests. The Libro stores claims in your own database.

= Privacy =

The Libro de Reclamaciones stores the data the consumer types (name, document, address, phone, e-mail, claim text, attachments) in your WordPress database and in a private uploads folder, and sends an e-mail copy to the consumer. The plugin does not send data to Pinzell or to any third party. The data controller is the business that owns the site. Claims are kept two years (legal retention) and cannot be erased earlier. Order checkout fields are stored with the WooCommerce order and covered by WooCommerce's own personal-data tools.

= Credits and legal =

* Peruvian rules: Ley 29571 (Código de Protección y Defensa del Consumidor), Ley 31435, DS 011-2011-PCM and its amendments (https://www.gob.pe/indecopi).
* Mexican SAT catalogues (Pro): published by the SAT; machine-readable copy by phpcfdi/resources-sat-catalogs (public domain).
* Pinzell is a product line of RGC GLOBAL NET SERVICES SLU (Spain). This plugin is independent: it is not made, endorsed or supported by INDECOPI, the SUNAT, the SAT, the SII, the DIAN, the AFIP/ARCA, the SRI, the DGI or any other authority.

== Installation ==

1. Install and activate the plugin (WooCommerce is optional: without it only the Libro de Reclamaciones is available).
2. Go to Settings → Pinzell Latam. Choose the countries and document types for the checkout and the geography mode.
3. For the Libro: fill in your business name, RUC and address, enable it and press "Create the page".
4. Place a test order and a test claim in each language you offer.

== Frequently Asked Questions ==

= Does it issue invoices or electronic receipts? =

No. It only collects and validates the data that an invoicing tool needs (document type and number, district). Use it together with your invoicing service.

= Does it check that the RUC/RFC/CUIT exists? =

No. It checks length, characters, structure and check digit locally. Looking a number up requires the authority's service (or a paid intermediary) and is outside this plugin.

= Does it work with the block checkout? =

Yes, with WooCommerce 9.9 or later (Additional Checkout Fields). The classic checkout works with any supported WooCommerce version.

= Why is there no district list for Colombia or Ecuador? =

The open datasets we found for Colombia are share-alike and not compatible with the plugin's licence plan, and the Ecuadorian source could not be obtained. WooCommerce's own department list is kept. Ask us if you need them.

= Who must have a Libro de Reclamaciones? =

In Peru, providers that sell to consumers under the Código de Protección y Defensa del Consumidor (including online) must offer a Libro de Reclamaciones, and the regulation sets rules for the virtual book. Read the regulation or ask your adviser about your case; this plugin does not decide that for you.

= How long do I have to answer a claim? =

The regulation sets fifteen business days (not extendable). Pro shows the deadline per claim and sends alerts. The plugin does not include a holiday list because the official calendar changes by decree: you paste the dates in Settings.

= Can I delete claims? =

Only after the two-year retention period.

== Screenshots ==

1. Block checkout in Peru: document type, RUC/DNI and district.
2. Block checkout in Mexico: RFC (and the Pro invoice request).
3. The Libro de Reclamaciones form.
4. Confirmation page with the correlative number.
5. Admin register of claims.

== Changelog ==

= 1.0.0 =
* First release.

== Upgrade Notice ==

= 1.0.0 =
First release.
