Skip to content

regimes/cl: add Chile tax regime - #905

Open
Ignacio-Garro wants to merge 1 commit into
invopop:mainfrom
Ignacio-Garro:feat/cl-regime
Open

regimes/cl: add Chile tax regime#905
Ignacio-Garro wants to merge 1 commit into
invopop:mainfrom
Ignacio-Garro:feat/cl-regime

Conversation

@Ignacio-Garro

@Ignacio-Garro Ignacio-Garro commented Jul 17, 2026

Copy link
Copy Markdown

Adds the Chilean (CL) tax regime.

What's included

  • RUT tax identity validation using the modulo 11 check digit algorithm, with normalization handled by the standard tax.NormalizeIdentity (strips punctuation like 76.086.428-5 and uppercases before validation).
  • Single flat-rate VAT (IVA) category at 19% (Ley N° 19.888, effective 2003-10-01); Chile has no reduced or intermediate rates, so the category defines a single standard rate value.
  • Credit and debit note correction definitions, mirroring the SII's Nota de Crédito/Débito Electrónica document types.
  • Examples for a standard invoice, credit note, and debit note, with their generated outputs.

Decisions and scope

  • Electronic invoicing (DTE) is deliberately out of scope. Chile requires invoices to be signed and cleared by the SII before delivery, but that flow (CAF folio ranges, certificates, SOAP web services) is an integration concern rather than core tax rules. It would fit a future addon, the same way es/tbai and es/verifactu extend the Spanish regime. This is also noted in the regime description.
  • RUT bodies of 1-8 digits are accepted, not just the modern 7-8: shorter historic RUTs are still valid (the well-known 1-9 is the classic example, covered in the tests).
  • Sources: the SII doesn't publish the check digit algorithm step by step on any official page. The code links the SII DTE web service spec (confirms modulo 11 and the uppercase "K") plus a detailed algorithm reference verified against this implementation. The VAT rate is sourced from the SII FAQ.

Pre-Review Checklist

  • Opened this PR as a draft
  • Read the CONTRIBUTING.md guide.
  • Performed a self-review of my code.
  • Added thorough tests with at least 90% code coverage. (96%)
  • Modified or created example GOBL documents to show my changes in use, if appropriate.
  • Added links to the source of the changes in tax regimes or addons, either structured or in the comments.
  • Run go generate . to ensure that the Schemas and Regime data are up to date.
  • Reviewed and fixed all linter warnings.
  • Been obsessive with pointer nil checks to avoid panics.
  • Updated the CHANGELOG.md with an overview of my changes.
  • Marked this PR as ready for review.

Adds the Chilean (CL) tax regime with:

- RUT tax identity validation using the modulo 11 check digit
  algorithm, with normalization handled by tax.NormalizeIdentity.
- Single flat-rate VAT (IVA) category at 19% (Ley 19.888, effective
  2003-10-01); Chile has no reduced or intermediate rates.
- Credit and debit note correction definitions, mirroring the SII's
  Nota de Credito/Debito Electronica document types.
- Examples for a standard invoice, credit note, and debit note.

The SII electronic invoicing clearance flow (DTE, CAF folios, digital
signatures) is intentionally out of scope for the base regime and
would fit a future addon, similar to es/tbai or es/verifactu.
@Ignacio-Garro
Ignacio-Garro marked this pull request as ready for review July 17, 2026 04:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant