Skip to content

uy: Add tax regime for Uruguay with IVA rates and RUT validation #799

Open
CarlosMari wants to merge 3 commits intoinvopop:mainfrom
CarlosMari:feat/regime-uy
Open

uy: Add tax regime for Uruguay with IVA rates and RUT validation #799
CarlosMari wants to merge 3 commits intoinvopop:mainfrom
CarlosMari:feat/regime-uy

Conversation

@CarlosMari
Copy link
Copy Markdown

Summary

Adds a new tax regime for Uruguay (UY), implementing:

  • IVA (VAT) tax categories: 22% standard rate (tasa básica) and 10% reduced rate (tasa mínima), both effective since Law 18.083 (2007-07-01).
  • RUT validation: Full 12-digit structure validation including modulo-11 check digit algorithm
  • RUT normalization: Strips hyphens, spaces, and "UY" prefix

Design decisions

  • Scope: This is a base tax regime only. Invoice-level validation (e.g., requiring supplier tax ID) is intentionally left for a future CFE addon, consistent with how co and gb handle this separation.
  • Zero/exempt rates: Inherited from GlobalVATKeys(), no local rate value definitions needed since they work with NoPercent: true.
  • RUT "001" field: Positions 9-11 are always "001" per the OECD TIN specification. Branch identification is handled separately via CdgDGISucur in the CFE XML, not within the RUT itself.

Sources

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.
  • 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.

Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 13, 2026

Codecov Report

❌ Patch coverage is 96.93878% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.13%. Comparing base (e36c17e) to head (2a5b98a).
⚠️ Report is 89 commits behind head on main.

Files with missing lines Patch % Lines
regimes/uy/tax_identity.go 94.59% 1 Missing and 1 partial ⚠️
regimes/uy/uy.go 98.36% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #799      +/-   ##
==========================================
+ Coverage   93.11%   93.13%   +0.02%     
==========================================
  Files         334      336       +2     
  Lines       18086    18184      +98     
==========================================
+ Hits        16840    16935      +95     
- Misses        876      878       +2     
- Partials      370      371       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Collaborator

@samlown samlown left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Minot observation regarding the source links, but if this was up to date with the latest rules based validation changes, it'd be good to go 👍

Comment thread regimes/uy/uy.go Outdated
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.

2 participants