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

Add Spanish CAE Number #446

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

Conversation

quiqueporta
Copy link

The CAE (Código de Actividad y Establecimiento) number is a 13-digit number and that allows you to identify an activity and the establishment in which it is carried out.

This is the official BOE (Boletín Oficial del Estado) about the CAE number:
https://www.boe.es/boe/dias/2006/12/28/pdfs/A46098-46100.pdf

This is the offical web site about the CAE number:
https://sede.agenciatributaria.gob.es/Sede/impuestos-especiales-medioambientales/censo-impuestos-especiales-medioambientales/registro-impuestos-especiales-fabricacion.html?faqId=3cc75c714b11c710VgnVCM100000dc381e0aRCRD

@Antonio-Vela
Copy link

@Antonio-Vela
Copy link

@arthurdejong
Copy link
Owner

Hi @quiqueporta,

Thanks for providing this and sorry it took a while for me to get around to this. The link in the code appear to be broken:

https://www2.agenciatributaria.gob.es/wlpl/inwinvoc/es.aeat.dit.adu.adce.cae.cw.AccW

I get "Error en la recuperación de la acción seleccionada. (Se esperaba fAccion)".

This page suggests additional checks that can be performed:

  • that all digits after "ES" are digits (e.g. other modules use the isdigits() function to check that)
  • the "ES" part is followed by "000"
  • the last digit appears to be a check digit

Do you have any idea of what the check digit function would be? Searching for hints on the check digit algorithm is generally easier in the applicable language (and I read Spanish through Google Translate). Without an actual reference to what the algorithm is it is sometimes possible to reverse-engineer the check digit algorithm from a large number of valid numbers (also see https://github.com/arthurdejong/python-stdnum/blob/master/CONTRIBUTING.md)

Thanks,

@quiqueporta
Copy link
Author

@arthurdejong Ok, I will chek it and make the appropriate changes if needed
Thanks

@quiqueporta
Copy link
Author

Regardless of the check digit, you cannot check it through the official web page because it only checks if the CAE is registered in its database, not the format itself.

@arthurdejong
Copy link
Owner

Do you have a link to the site where I can check a hand full of numbers or do you some other way to get a large-ish set of numbers to try to reverse-engineer the check digit algorithm?

@quiqueporta
Copy link
Author

No 😞 , the only official webpage to check the codes is this:
https://www2.agenciatributaria.gob.es/L/inwinvoc/es.aeat.dit.adu.adce.cae.cw.AccW?fAccion=consulta

However, this page doesn't tell you if the code is correct; it only checks whether the code is registered in the official database.

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.

3 participants