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

Support Swiss VAT format CHE #24

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

shaunickmistry
Copy link

@shaunickmistry shaunickmistry commented Jul 10, 2023

I'm not sure if this repo is still supported, but my organisation has a fork which we would like to stop supporting individually and instead support this public repo.

As a part of this, we have recently added some support for the Swiss VAT format CHE-XXXXXXXXX and wanted to see if there was an appetite to add that here too?

@ralphje
Copy link
Owner

ralphje commented Jul 10, 2023

I doubt this is a 'new' format. We've had a discussion in #6 about this. I agree that we could open the doors for storing the 'E' as well.

In that case, I would propose to add the E as part of the 'CH' regex, and make sure that we add it in https://github.com/ralphje/django-internationalflavor/blob/master/internationalflavor/vat_number/validators.py#L22 when it is not there.

I don't think it is really a new country code, or do you think otherwise?

@shaunickmistry shaunickmistry changed the title Support new Swiss VAT format CHE Support Swiss VAT format CHE Jul 11, 2023
@shaunickmistry
Copy link
Author

Thanks @ralphje! I've updated the PR so that the E is part of the 'CH' regex as you suggested.

In terms of the VATNumberCleaner, my proposal would be to not add it there so that we can still support and store both CH and CHE formats. As in practice we're seeing both formats being used and it would be good to store them as the user intends. What do you think?

@ralphje
Copy link
Owner

ralphje commented Jul 11, 2023

I believe a single source form in the database is best. We can allow the user to submit any of them, but in principle only store one version, and display one of them.

I believe with or without the E makes no difference in terms of interpretation, so I strongly believe we should not save it in both formats.

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