By Tassos Marinos on Wednesday, 18 November 2020
Posted in General Issues
Likes 0
Views 0.9K
Votes 0
Steps to reproduce the issue.

1. Add an EU-VAT app to a country, eg: Spain
2. Go to the front-end on the checkout page
3. Select Spain in the Country dropdown
4. Enter a VAT ID BUT do not fill in the Company Name field (That field is supposed to be optional and can be ignored by the user)
[/list]

Actual Behavior
The VAT ID is not get validated as a Business and no validation error is shown because the Company Name is left blank. The user doesn't know that and can result in frustration.

Expected Behavior
The VAT ID should be validated as a Business and the validation error "VAT No. is invalid or not-registered" should be shown if the VAT ID is invalid without taking into account the Company Name field. The VIES Server requires only the VAT-ID to determine whether it's valid or not.

Fix
Update the com_payplans/themes/wireframe/checkout/default/company.js file on line 94 and replace the following


if ($('[data-pp-company-bizname]').val() && $('[data-pp-company-vatno]').val()) {


with


if ($('[data-pp-company-vatno]').val()) {


I am aware that I can fix this by overriding the company.js script in my template but I think it's a rather important issue that needs to be fixed in the core.
Hey Tassos,

Yes, you are right that company validation only need vat no. not the company name. But company name is also require user to fill.
No other user complain about this.
If in your case company name can be option then it's good to do the changes with template override.

Let me know if you have any query.
·
Wednesday, 18 November 2020 11:12
·
0 Likes
·
0 Votes
·
0 Comments
·
You say
But company name is also require user to fill.


That's not true. The Company Name field is (and should remain) by default optional (no overrides/no settings changed). This means a user can proceed with the purchase by filling in just the VAT-ID while leaving the Company Name empty. In that case, if the user is charged with VAT while they are VAT-exempt, we are actually breaking the law!

Why the Company Name, an optional field, has to be a requirement in the company.js script in order for the EU-VAT validation to run properly? That doesn't make any sense and it seems like a bug.

To determine whether the user is buying as a business (purposeId = 2) and let the validation run properly you only need to check the VAT ID field, not both VAT ID and Company Name. The script that validates the VAT-ID shouldn't be responsible to check the Company Name.

How many PayPlans users does it take to consider this as a real issue?

By applying the fix I recommend in my previous reply, you won't break anything with existing users, since the Company Name field is optional! On the contrary, you're fixing a major law issue.
·
Wednesday, 27 January 2021 04:25
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Tassos,

How many PayPlans users does it take to consider this as a real issue?

No user earlier reported this flow as issue. For now you do the changes with template overriding.

I've log this and our developer will look into this as it's flow issue or not.

Thank you for understanding !
·
Wednesday, 27 January 2021 11:37
·
0 Likes
·
0 Votes
·
0 Comments
·
@Tassos Marinos
When you create an invoice the company name MUST match the EU VAT number.
So why do you want the field optional?
By applying the fix I recommend in my previous reply, you won't break anything with existing users, since the Company Name field is optional! On the contrary, you're fixing a major law issue.

Can you provide us with a link to check out this law issue?
·
Saturday, 30 January 2021 14:53
·
0 Likes
·
0 Votes
·
0 Comments
·
I am not asking to make the Company name field optional because it's already optional by default in PayPlans.

What I am asking is to update your script that validates the VAT ID to ignore the Company Name value. Right now, in order for the VAT ID validation to run requires the Company Name field to not be empty (See my fix).

Why would you require a value of an optional field in the script? Moreover, the Company Name is useless to the EU VAT API.

Imagine this scenario:

We have a configured PayPlans to add 20% VAT to France customers. The customer selects France from the Country dropdown. A VAT of 20% is applied. Then, the customer enters their VAT ID while the Company Name is still blank. In that case, the customer should be VAT except and we should not charge VAT. However, since your script requires the Company Name field in order for the VAT ID validation to run, the user is incorrectly charged with VAT.

This is where we break the law.
·
Monday, 01 February 2021 17:31
·
0 Likes
·
0 Votes
·
0 Comments
·
@Tassos
I am a user using PayPlans but not exactly like you selling digital goods...

Correct me if I am wrong, in the past PP versions users should select the buying purpose (individual / business) and then fields were displaying accordingly. Users would see only the needed / required fields.

I do get your point about the company name not needed for the VIES check.
In my point of view, the business name field is displayed before the VAT and should be filled first.
But why would a business or professional user not enter his business name in the field when YOU as a seller need it to create the invoice? At the end, the field should not be empty to generate a correct invoice.
·
Monday, 01 February 2021 20:09
·
0 Likes
·
0 Votes
·
0 Comments
·
This is a UX issue and I am talking about the case where the user hasn't submitted the form yet. He's still filling in the form.

Correct me if I am wrong, in the past PP versions users should select the buying purpose (individual/business), and then fields were displaying accordingly. Users would see only the needed/required fields.


I can't tell, as I am a relatively new PayPlans user.

I do get your point about the company name not needed for the VIES check.

Yes. There's no need for the script to take into account the Company Name value. If the VAT-ID input changes just trigger the VIES check without checking if the Company Name if it's blank or not.
·
Tuesday, 02 February 2021 00:19
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Tassos,

I already logged this into our issue tracker.
Our developer will take look into this.
·
Tuesday, 02 February 2021 11:28
·
0 Likes
·
0 Votes
·
0 Comments
·
I already logged this into our issue tracker.
Our developer will take look into this.

If you bring any change please make sure we can set the company name field compulsory if a EU-VAT id is entered...
We absolutely need it on our invoices.
Thank you
·
Tuesday, 02 February 2021 12:53
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey supporter,

Thank you for sharing your input. We will look into this.
·
Tuesday, 02 February 2021 15:07
·
0 Likes
·
0 Votes
·
0 Comments
·
This is now fixed in v4.2.6.

Thank you.
·
Thursday, 25 February 2021 02:33
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi there,

You are most welcome. Glad to hear that your issue has been resolved now.

Just for your information, I have locked and marked this thread as resolved to avoid confusions in the future. Please start a new thread if you have any other issue in the future so it will be easier for us to manage your inquiries.

Thanks for understanding.
·
Thursday, 25 February 2021 11:10
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post