Skip to content

fix: accept swiss VAT IDs from customers (backport #233)#235

Merged
barredterra merged 1 commit intoversion-15-hotfixfrom
mergify/bp/version-15-hotfix/pr-233
Feb 20, 2026
Merged

fix: accept swiss VAT IDs from customers (backport #233)#235
barredterra merged 1 commit intoversion-15-hotfixfrom
mergify/bp/version-15-hotfix/pr-233

Conversation

@mergify
Copy link
Copy Markdown
Contributor

@mergify mergify bot commented Feb 19, 2026

This pull request adds support for validating and normalizing Swiss VAT IDs (UIDs) within the European e-invoice system. The main changes include implementing Swiss VAT ID validation logic, integrating this logic into the sales invoice workflow, and adding corresponding unit tests.

Swiss VAT ID validation and normalization:

  • Added normalize_swiss_vat_id and is_valid_swiss_vat_id functions to eu_einvoice/switzerland.py for cleaning and validating Swiss VAT IDs according to official rules, including checksum verification.
  • Integrated Swiss VAT ID validation into the _set_buyer_tax_id method in sales_invoice.py, so that Swiss VAT IDs are recognized and normalized before further processing.
  • Imported the new Swiss VAT ID utilities in sales_invoice.py to enable their use.

Testing:

* fix: accept swiss VAT IDs from customers

* fix: validate_swiss_vat

* refactor: normalize and validate vat id

(cherry picked from commit b8575ea)
@barredterra barredterra merged commit 9c49cd4 into version-15-hotfix Feb 20, 2026
6 checks passed
@barredterra barredterra deleted the mergify/bp/version-15-hotfix/pr-233 branch February 20, 2026 14:48
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