Jump to content

Recommended Posts

GimpArm

I'm sorry I do not speak any Portuguese.

I was tasked by my German company to implement the new QR code regulations for our online sales to Portugal. I hope I'm not offending anyone but it seems these regulations are quite chaotic. I've implemented similar rules for various countries and this is the first one that I have had the need to seek out local developers to ask questions. There seems to be no official place to ask technical questions or even questions over how the regulations were written.

I have the technical specifications of the QR code in English https://info.portaldasfinancas.gov.pt/pt/docs/Conteudos_1pagina/Documents/QR_Code_Technical_Specifications.pdf

It seems fairly straight forward but then I get to Code H "ATCUD".  After some searching I come across what looks like an announcement that says this isn't possible to generate this and to just fill it with "0" Is this correct? Is there any information about when and how this will eventually work? https://info.portaldasfinancas.gov.pt/pt/destaques/Paginas/Codigo_QR_20201029.aspx

Code Q "4 characters from Hash" which it says  "Complete in accordance with Article 6(3)(a) of Ordinance No. 363/2010 of June 23rd" I read this ordinance https://info.portaldasfinancas.gov.pt/pt/docs/Portug_tax_system/Documents/Ordinance_363_2010_Certification_of_computer_invoicing_programs.pdf It says nothing about encryptions. It just says the developer should be the only one with the private key. So I can choose any encryption I want? All other governments are extremely specific about this stating the exact iso standard for the encryption. It seems here nothing stops me from using a 2 bit encryption from the 80's?

There also seems to be a lot of discussion in a previous thread here about generating the QR code to match the examples 100% exactly. Since the only specifications for the QR code are:

a) Error Correction Code (ECC): ‘M’;
b) Type: Byte;
c) Points per module (Size): 2;
d) Version: V=9 (minimum value);
e) Image dimensions: minimum 30x30 mm;
f) Margin: 0,25 cm.

Then there can't possibly be any enforcement of something like exactly which mask pattern is used because it wasn't specified. Why is there so much discussion about this? Is there more information that I am missing?

 

Link to post
Share on other sites
antseq
2 horas atrás, GimpArm disse:

I'm sorry I do not speak any Portuguese.

I was tasked by my German company to implement the new QR code regulations for our online sales to Portugal. I hope I'm not offending anyone but it seems these regulations are quite chaotic. I've implemented similar rules for various countries and this is the first one that I have had the need to seek out local developers to ask questions. There seems to be no official place to ask technical questions or even questions over how the regulations were written.

I have the technical specifications of the QR code in English https://info.portaldasfinancas.gov.pt/pt/docs/Conteudos_1pagina/Documents/QR_Code_Technical_Specifications.pdf

It seems fairly straight forward but then I get to Code H "ATCUD".  After some searching I come across what looks like an announcement that says this isn't possible to generate this and to just fill it with "0" Is this correct? Is there any information about when and how this will eventually work? https://info.portaldasfinancas.gov.pt/pt/destaques/Paginas/Codigo_QR_20201029.aspx

Code Q "4 characters from Hash" which it says  "Complete in accordance with Article 6(3)(a) of Ordinance No. 363/2010 of June 23rd" I read this ordinance https://info.portaldasfinancas.gov.pt/pt/docs/Portug_tax_system/Documents/Ordinance_363_2010_Certification_of_computer_invoicing_programs.pdf It says nothing about encryptions. It just says the developer should be the only one with the private key. So I can choose any encryption I want? All other governments are extremely specific about this stating the exact iso standard for the encryption. It seems here nothing stops me from using a 2 bit encryption from the 80's?

There also seems to be a lot of discussion in a previous thread here about generating the QR code to match the examples 100% exactly. Since the only specifications for the QR code are:

a) Error Correction Code (ECC): ‘M’;
b) Type: Byte;
c) Points per module (Size): 2;
d) Version: V=9 (minimum value);
e) Image dimensions: minimum 30x30 mm;
f) Margin: 0,25 cm.

Then there can't possibly be any enforcement of something like exactly which mask pattern is used because it wasn't specified. Why is there so much discussion about this? Is there more information that I am missing?

 

Hi,

Code H: ATCUD has been postponed, so don't worry about it and fill in with 0.
[Later this year... we will have more detailed / technical information about it...]

Code Q: It's the 4-letter/digit printable hash that your company software is already printing in all documents like:
"XXXX-Processado por programa certificado n.º????"
"XXXX"=Hash letters/digits at positions 1, 11, 21, 31

Link to post
Share on other sites
GimpArm
14 hours ago, antseq said:

Code H: ATCUD has been postponed, so don't worry about it and fill in with 0.
[Later this year... we will have more detailed / technical information about it...]

Do we know if it will be some sort of API that can be called? Or anything that we can plan for?

 

14 hours ago, antseq said:

Code Q: It's the 4-letter/digit printable hash that your company software is already printing in all documents like:
"XXXX-Processado por programa certificado n.º????"
"XXXX"=Hash letters/digits at positions 1, 11, 21, 31

I haven't a clue what accounting does. We have a large distributed system, but you're telling me the hash isn't based on the data in the QR code at all? Its just a constant value?

Link to post
Share on other sites
antseq
1 hora atrás, GimpArm disse:

Do we know if it will be some sort of API that can be called? Or anything that we can plan for?

 

I haven't a clue what accounting does. We have a large distributed system, but you're telling me the hash isn't based on the data in the QR code at all? Its just a constant value?

A) We know that in the future:
- every document "serie" must have a unique ATCUD.
- the document "serie" cannot be used to create documents until you get that unique ATCUD (from tax authority).
- probably you'll be able to get this ATCUD manually from a tax authority webpage?
- probably you'll be able to get this ATCUD automatically from a tax authority webservice?
You can plan:
- the field "ATCUD" in your document "series" table
- some sort of manual editing this "ATCUD" field? or get it from a future webservice?

B) If your company's software is certified (approved by portuguese tax authority):
- your software have a certificate number
- your software is generating a hash for every document
- that hash is being saved in your database
- your documents are being printed with this message: "XXXX-Processado por programa certificado n.ºNNNN"
--- XXXX: the 4-letter/digit printable hash => QRCODE(Q)
--- NNNN: your certificate number => QRCODE(R)
If you can print XXXX and NNNN, you can also have the same information for QRCODE(Q and R).
Ask someone in Portugal to send you a photo of a printed document to make sure your software is certified, complies with the tax/fiscal law and that you (must) have in your database all the information for the QRCODE.
 

Link to post
Share on other sites
GimpArm

Thanks you. It sounds like I need to talk to accounting for this information. We use a large commercial accounting software, so I assume it is certified but I'll check on it.

Link to post
Share on other sites
antseq
2 horas atrás, GimpArm disse:

So I’ve been banned for this thread? Wow, just incredible.

Sorry to hear that.
There are a lot of other posts that do not follow 100% the forum general rules: from "not programmers" (they don't even have a clue how to programme something basic), from abroad (not Portuguese), written in bad Portuguese and I do not see them being banned.

Whatever goes around comes around... Maybe some day a portuguese will need help to solve a programming problem in Germany and besides asking (politely in english) for help in a german forum he/she will be promptly banned.

If you have more questions fell free to sent me a private message.

“Do not do to others what you don’t want to be done to you.” [Confucius]

Link to post
Share on other sites
Rui Carlos
3 horas atrás, GimpArm disse:

So I’ve been banned for this thread? Wow, just incredible.

As already mentioned by PM, not sure about what happened, but you were not banned, and your account has no restrictions at the moment.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.