Closed toncijajic closed 3 years ago
@Automattic/shilling
Let's start with a backend fix to validate the data, but then additionally modify both forms (Calypso and MC) allow for dynamic validation (i.e. if I input a VAT number with country code, auto-select country from the dropdown and remove it from the VAT number).
I had a user with this issue here 31721115-HC The validation was failing for them until I suggested that they use only the number without the country code.
The validation was failing for them until I suggested that they use only the number without the country code.
I had a similar case today as well. Glad this is already reported.
Hi, may I take this one? I already have a working solution in my local env.
@romokebi PRs are certainly welcome!
Closed with #57686. Thank you @romokebi!
Steps to reproduce the behavior
Slack discussion: p1630936548136200-slack-C0117V2PCAE
What I expected to happen
The validator successfully validates and saves the data.
What actually happened
The validator doesn't strip the leading country code from the ID, trying to validate the wrong ID. In the case of my VAT ID, it's trying to validate HRHR------ instead of HR------. Validation returns an error. Trying to force it produces invoices with "HR HR------" VAT numbers on them
I would expect that the leading country code is trimmed if the same as the one selected during validation and saving.
Context
In the EU, VAT ID is complete with the leading country code. Users entering VAT ID in an international environment almost exclusively enter it with the leading country code.
Is there any console output or error text?
Documented only client-side errors, see screenshots
Level of impact (Does it block purchases? Does it affect more than just one site?)
All sites, all users trying to add full VAT ID