The Mexican government, by Section 29 of National Tax Code published at the Official Federal Gazette on January 5th 2004, allowed taxpayers to use electronic invoices that are digital representations of a digital tax receipt (CFD) type and hold the same tax properties as the physical invoice. These digital representations are XML format files.
Taxpayers that have adopted electronic invoices count on a pair of keys for electronic signature (one public and other private, a public key encryption is used), a certificate related to the electronic signature, a certificate of digital seals and valid files intervals. The certificates and files intervals must be acquired from SAT (Tax Administration Services). A monthly report must be also sent to SAT with all required information on the issued invoices.
These reports must be delivered in a text type file (.TXT extension), following standard defined by SAT.
SAT offers the SOLCEDI application to create the electronic signature keys and requirements for electronic signature and digital seal certificates. SOLCEDI creates a file with ".KEY" extension along with the private key. For requirements, it creates files with .REQ extension. These requirements must be sent to SAT to generate the certificates, files with .CER extension.
The private key is encrypted in a DER format file. Distinguished Encoding Rules. This file must be converted to PEM format Privacy Enhanced Mail to be used by Protheus. The conversion can be made by openssl tools www.openssl.org for example:
openssl pkcs8 -inform DER -in <arquivo_chave_privada.key> -out <arquivo_convertido.pem>
The certificate for electronic signature generated by SAT holds the public key that can be extracted through the command:
openssl x509 -inform DER -outform PEM -in <arquivo_certificado.cer> -out <arquivo_convertido.pem> -pubkey
Once you hold the certificates and the private key, the next step is to acquire from SAT, valid intervals of forms. To acquire them, access SICOFI - Tax Receipts Integral System website. The series and files intervals necessary to generate electronic invoices must be informed in this website.Afterwards, the taxpayer will count on severalfiles intervals recognized by SAT.
For more information on how to use SOLCEDI, check website www.sat.gob.mx.
Each electronic invoice is a digital seal. It is used to confirm source and integrity of invoice. This seal is created from information from the invoice and encrypted with private key. The invoices can be sent and kept in electronic or physical copies, when necessary.
When requesting the forms intervals, the taxpayer must check on the number of characters allowed for the series and for the form to avoid intervals not supported by Protheus. Originally, the system is limited to three characters for series and six characters for forms. Thus, the form, for a certain series, will be from 1 to 999999. |
Procedures
To answer this legal provision, observe:
1. The parameters configuration, described in the tax receipts changes, required to run the routine.
2. The Forms Control routine for Mexico.
3. The option Electronic Invoices, in the Manual Invoice, which allows the generation of CFDs (Digital Tax Receipts) from existing invoices.
4. The Automatic Invoicing routine.
After the creation of all invoices by Automatic Invoicing, the electronic invoices will be automatic created, in case the invoice series are in the form control records.
5. CFDs Generation to generate the electronic invoices, allowing the creation of digital tax receipts from a group of invoices selected by issuance date, series, and invoice number.
6. The CDF Printing routine - CDF Printing is an UserFunction that issues electronic invoices, selecting them by issuance date, series, and number.
7. Files Generation is used to create the file in magnetic format to send to SAT (Tax Administration System). The system, after processing this routine, will create a text type file with .TXT extension.
Practical Application
To create digital tax receipts, access Generate CFD.