# Duplicates in party identifier types

**URL:** https://discuss.tryton.org/t/duplicates-in-party-identifier-types/3384
**Category:** Developer
**Created:** [October 21, 2020, 1:30pm UTC](https://discuss.tryton.org/t/duplicates-in-party-identifier-types/3384 "2020-10-21T13:30:31Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![timitos](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/timitos/32/323_2.png) [@timitos](https://discuss.tryton.org/u/timitos)
#### Post date: [October 21, 2020, 1:30pm UTC](https://discuss.tryton.org/t/duplicates-in-party-identifier-types/3384/1 "2020-10-21T13:30:31Z")

</div>

The identifier type _de\_vat_ is a duplicate to the type _eu\_vat_. As both represent the same identifier i think that _de\_vat_ should be removed from the list of identifier types because only the _eu\_vat_ type can be validated by VIES and it is not clear for the user which of these two types should be used.

I think that there may be some more duplicates. Did anybody stumble over this issue for any other country?

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [October 21, 2020, 1:59pm UTC](https://discuss.tryton.org/t/duplicates-in-party-identifier-types/3384/2 "2020-10-21T13:59:00Z")

</div>

Indeed I think it will be better to find a way to make them compatible.  
For example, we could automatically fill the European or country code when one is encoded. Or have a method that returns the European version from any country VAT identifier (and so the VIES check will use it).

---

<div class="post-metadata">

### Author: ![timitos](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/timitos/32/323_2.png) [@timitos](https://discuss.tryton.org/u/timitos)
#### Post date: [October 21, 2020, 2:00pm UTC](https://discuss.tryton.org/t/duplicates-in-party-identifier-types/3384/3 "2020-10-21T14:00:48Z")

</div>

If we go this way we should extend the functionality of VIES check to check all country VAT identifiers that can be converted to an EU VAT ID, right?

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [October 21, 2020, 2:04pm UTC](https://discuss.tryton.org/t/duplicates-in-party-identifier-types/3384/4 "2020-10-21T14:04:05Z")

</div>

Yes.

Another point that makes important to keep national identifier is that now we know some country can leave the EU and so their `eu_vat` is no more valid 🙄?

---

<div class="post-metadata">

### Author: ![timitos](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/timitos/32/323_2.png) [@timitos](https://discuss.tryton.org/u/timitos)
#### Post date: [October 21, 2020, 2:06pm UTC](https://discuss.tryton.org/t/duplicates-in-party-identifier-types/3384/5 "2020-10-21T14:06:20Z")

</div>

But as currently all users may have entered the VAT ID with the type eu\_vat because VIES only checks IDs of this type they may need to change the type of all ids to the corresponding national one.

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [October 21, 2020, 2:10pm UTC](https://discuss.tryton.org/t/duplicates-in-party-identifier-types/3384/6 "2020-10-21T14:10:52Z")

</div>

That’s why I think that the best would be to create automatically each type (and have a migration for current installation). This way removing a country will be about deleting the EU identifier only.

---

<div class="post-metadata">

### Author: ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)
#### Post date: [October 21, 2020, 2:12pm UTC](https://discuss.tryton.org/t/duplicates-in-party-identifier-types/3384/7 "2020-10-21T14:12:19Z")

</div>

> [@ced](#):
>
> we could automatically fill the European or country code when one is encoded.

Then the invoice should use the correct tax identifier depending on the party. For example:

- If the customer is a national party, we shoud use the national identifier.
- If the customer is an european party, we should use the european identifier.

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [October 21, 2020, 2:14pm UTC](https://discuss.tryton.org/t/duplicates-in-party-identifier-types/3384/8 "2020-10-21T14:14:37Z")

</div>

I guess it will be better to always use the EU format. This will mean that the national identifier will need to provide a EU formatted version.

---

<div class="post-metadata">

### Author: ![timitos](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/timitos/32/323_2.png) [@timitos](https://discuss.tryton.org/u/timitos)
#### Post date: [October 21, 2020, 2:14pm UTC](https://discuss.tryton.org/t/duplicates-in-party-identifier-types/3384/9 "2020-10-21T14:14:55Z")

</div>

> [@pokoli](#):
>
> Then the invoice should use the correct tax identifier depending on the party. For example:
> 
> - If the customer is a national party, we shoud use the national identifier.
> - If the customer is an european party, we should use the european identifier.

This is not that easy as in germany for example the national identifier is not a subset of the european identifier but a completely different identifier and the companies are allowed to use the european identifier prefered over the national one 😋

---

<div class="post-metadata">

### Author: ![pokoli](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/pokoli/32/22_2.png) [@pokoli](https://discuss.tryton.org/u/pokoli)
#### Post date: [October 21, 2020, 4:03pm UTC](https://discuss.tryton.org/t/duplicates-in-party-identifier-types/3384/10 "2020-10-21T16:03:17Z")

</div>

> [@ced](#):
>
> I guess it will be better to always use the EU format.

Then why we need to have all of the identifiers? Just to create the EU format?

> [@ced](#):
>
> This will mean that the national identifier will need to provide a EU formatted version.

In Spain the EU version is exactly the same but prefixed with ‘ES’. IIRC this is the case of several other countries to.

> [@timitos](#):
>
> the companies are allowed to use the european identifier prefered over the national one

Then in germany you will only use the european identifier if available and use the national one when unique. Does it make sense?

---

<div class="post-metadata">

### Author: ![ced](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/ced/32/1237_2.png) [@ced](https://discuss.tryton.org/u/ced)
#### Post date: [October 21, 2020, 4:56pm UTC](https://discuss.tryton.org/t/duplicates-in-party-identifier-types/3384/11 "2020-10-21T16:56:19Z")

</div>

> [@pokoli](#):
>
> Then why we need to have all of the identifiers?

Because we may need them.

> [@pokoli](#):
>
> Just to create the EU format?

We do not know which input the system will receive.
