Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support for CH VATs #131

Closed
wants to merge 7 commits into from
Closed

Conversation

Mollemoll
Copy link

@Mollemoll Mollemoll commented Feb 7, 2024

Why this PR?

Looking to extend Valvat with CH VAT numbers.

What's changed?

  • CH was used as a previous test case for VAT outside EU. This was changed to NO instead.
  • Added CH as a supported state and added syntax validation
  • Added CH Lookup through BFS. Default configuration is to always return false on CH lookup unless it's performed with the ch: true flag.
  • Added checksum support for CH (mod 11 checksum)

Background

CH VAT Syntax

CH VATs can take different formatting variations. They start with CHE, followed by 9 digits and an optional suffix describing the regional part of Switzerland (MWST, IVA or TVA).

Format examples:

CHE123456789
CHE123456789 MWST
CHE-123.456.789
CHE-123.456.789 MWST

BFS Lookup:

  • Does not accept CHE123456789MWST (without a whitespace before MWST)

Errors

According to Google Translate and the [Spécifications Webservice Interface 5.0 PDF](Spécifications Webservice
Interface 5.0) the ValidateVatNumber operation can only return two errors:

  • Data_validation_failed
  • Request_limit_exceeded

Sources

Lookup:

Checksum details (weight and mod):

@Mollemoll Mollemoll marked this pull request as ready for review February 12, 2024 18:44
@Mollemoll
Copy link
Author

Hi @yolk,

Any idea when you'll have time to have a look? Looking forward to your feedback.

/Jonas

@Mollemoll Mollemoll closed this Mar 17, 2024
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