35 Understanding the Electronic Nota Fiscal Process

This chapter contains these topics:

35.1 Overview

The Electronic Nota Fiscal (NFe), also known as National Nota Fiscal, is an XML file required by the Brazilian government that replaces the paper Nota Fiscal. The Nota Tecnica 2013/005 requires that you use version 3.10 of the electronic file layout to format the XML file that you submit. This layout requires additional fields that were not included in previous versions of the layout. As a result of the changes, other electronic documents and files, such as the DANFe, must include the additional fields.

The changes also include a new nota fiscal type for the end consumer. The nota fiscal for the end consumer uses the acronym NFCe, and uses model 65 of the nota fiscal. The legal effective date of the 3.10 layout is August 31, 2014.

Note:

You set a processing option in the XML Generator program (P76B601) to specify the version of the NFe layout to use. If you specify a version prior to 3.10, the system does not read the database files for consumer notas fiscais, complete validations, or populate the new fields required in the version 3.10 layout version of the NFe XML file. For example, no matter which version is specified in the XML Generator program processing option, you can enter values for the additional import fields in a nota fiscal, but the system does not read the database file that stores the additional information and does not populate the fields in the XML file if you run version 2.0 instead of version 3.1. Instead, the system processes only the information required for version 2.0.

The Brazilian government provides the NFe XML schemas. Additional information regarding the NFe XML file and details on how this file is processed are available in a manual called Manual do Contribuinte.

Electronic Nota Fiscal schemas and Manual do Contribuinte are available in the Brazilian government website at:

http://www.nfe.fazenda.gov.br/portal/

35.2 Overview of the Electronic Nota Fiscal (NFe) XML File

Similar to the Paper Nota Fiscal, the NFe XML file contains information regarding the sales transactions, such as:

  • Ship From Information

  • Ship To Information

  • Product Information

  • Taxes

  • Messages

  • Import and transportation information

  • Type of consumer, such as an intermediate consumer or the final consumer

Note:

The contents of the XML file for the nota fiscal varies depending on the type of transaction, the type of consumer, and the layout version of the nota fiscal file that you specify in a processing option.

35.2.1 Legal Access Key

The NFe XML file contains many elements. An important element is the Legal Access Key that prints in the ID element of the NFe XML file and contains a summary of the XML file content. This information is used to speed up the NFe XML file identification, validation and processing.

The available Legal Access Key formats are given in the following table.

Size Layout Version UF Code Issue YYMM Issuer CNPJ Model Series Number Issue Type Numeric Code Check Digit
Size v.1.10 2 4 14 2 3 9 N/A 9 1
Size v.2.0 2 4 14 2 3 9 N/A 8 1

Example of Legal Access Key:

Id="NFe33110209506052000311550000001007291000014559"

35.2.2 Source of Data for the XML File

When you enter sales orders and stand-alone notas fiscais, you enter information about the transaction that the system will include in the XML file when you generate the NFe. Required information for NFe XML layout version 3.1 and above includes:

  • Transaction nature

  • Tax code

  • Fiscal classification

  • Whether the item is subject to a tax substitution mark-up

  • Origin of the item

  • Type of purchase

  • Taxpayer Classification Code

  • Customer Presence Indicator Code

  • Import information, if applicable

  • Item origin, if applicable

35.3 Overview of the Electronic Nota Fiscal (NFe) XML File - Normal Process

Once the NFe XML file is created it needs to be electronically signed and sent to Secretaria da Fazenda fiscal authority (SEFAZ) via web services.

The fiscal authority validates the format and content of the NFe XML file and sends a response back to you.

Their response normally contains a 3-digit code that indicates the status of the XML file. When the NFe XML file is recorded in their database (in case it is Accepted or Denied), the fiscal authority also sends you a protocol number.

The Protocol Number (DTBPTL) - is a 15-digit number

Where,

The 1st position: indicates the fiscal authority

1 - Secretaria de Fazenda Estadual

2- Receita Federal

The 2nd and 3rd positions: IBGE UF Code (IBGE State Code);

For Example:

33 - Rio de Janeiro

35 - Sao Paulo

The 4th and 5th positions are the year;

6th to 15th: sequential number

A complete list of all fiscal authority response codes is available in Manual do Contribuinte.

The table below contains an example of error codes and their meanings:

Error Code Meaning Result
Error (i.e. 201) The XML file did not pass the validation. Fiscal authority returns an error number. The error must be corrected and the XML file needs to be resent to the fiscal authority. The XML file is not stored in the fiscal authority database
Denied (i.e. 110) The XML file was not authorized by the fiscal authority. Process stops. Fiscal Authority needs to be contacted. The XML file is stored in the fiscal authority database.

A protocol number is provided by fiscal authority.

Accepted (i.e. 100) The XML file passed all validations and fiscal authority authorized its use. The XML file is stored in the fiscal authority database.

A protocol number is provided by fiscal authority


After the NFe XML file is Accepted/Approved by the fiscal authority, the Documento Auxiliar da Nota Fiscal (DANFE), a shipment note that contains the nota fiscal information, including the Legal Access Key and a barcode, can be printed and the merchandise can be shipped to your customer.

35.4 Documento Auxiliar da Nota Fiscal (DANFE) Layout

See Manual do Contribuinte (fiscal authority manual) for additional information regarding Documento Auxiliar da Nota Fiscal (DANFE). This manual is available in the Brazilian government website at:

http://www.nfe.fazenda.gov.br/portal/

35.5 Overview of the Electronic Nota Fiscal (NFe) XML File - Contingency Process

The Brazilian government understands that there will be times that either you or the fiscal authority will be unable to communicate to each other and it should not stop you from doing your business.

For these occasions, contingency processes were designed. You need to choose which contingency process is best for your business.

XML files sent through the contingency process also have their content and format validated.

Contingency Type Contingency Action After the communication with the fiscal authority is reestablished
Contingency Form (FS) (discontinued)

Contingency Form DA (FS-DA)

Print the Documento Auxiliar da Nota Fiscal Eletronica (DANFE) in a pre-approved/pre-printed form called FS. This process was replaced by FS-DA process.

Print the Documento Auxiliar da Nota Fiscal Eletronica (DANFE) in a pre-approved/pre-printed form called FS-DA.

Send a NFe XML file (FS_DA XML) with

Document number and series: same as pre-printed FS or FS_DA document number and series

tpEmis element =2.

Contingency DPEC

Declaracao Previa da Emissao em Contingencia (DPEC)

Send a small XML file with summarized information about the NFe that will be sent (DPEC XML) via web services or ftp to an alternative website provided by fiscal authority.

After the DPEC XML is approved, print the DANFE in regular paper.

Send NFe XML file with tpEmis=4
Contingency SCAN

Sistema de Contingência do Ambiente Nacional (SCAN)

Generate a new NFe XML (SCAN XML) with a new document number, new series (between 900 and 999) and tpEmis=3 and send it to SCAN website

After the SCAN XML is approved, print the DANFE in regular paper.

None.

The NFe received in SCAN is sent automatically to the fiscal authority website when the communication is reestablished.


35.6 Nota Fiscal Process

Figure 35-2 Nota Fiscal Process

Description of Figure 35-2 follows
Description of ''Figure 35-2 Nota Fiscal Process''

See Manual do Contribuinte (fiscal authority manual) for additional information regarding the NFe Contingency process. This manual is available in the Brazil government website at:

http://www.nfe.fazenda.gov.br/portal/

35.7 Overview of the NFe and NFCe XML Auxiliary Processes

You can run auxiliary processes for the electronic notas fiscais (NFe) and consumer electronic notas fiscais (NFCe) as described in this table:

Services Description
Cancel NFe Request Generate a Cancel NFe or NFCe XML file to notify the fiscal authority that an Approved nota fiscal has been cancelled.
Unused NFe Request Generate an Unused NFe or NFCe XML to notify the fiscal authority that one or several nota fiscal numbers has/have been skipped and will not be used.

See Manual do Contribuinte (fiscal authority manual) for additional information regarding this process. This manual is available in the Brazil government website at:

http://www.nfe.fazenda.gov.br/portal/

JD Edwards World programs allow you to:

  • Generate the electronic nota fiscal (NFe) or consumer nota fiscal (NFCe), XML file, to be sent through the normal process (NFe or NFCe XML)

  • Generate XML files to be sent through the contingency process (SVC, SCAN, Security Form (FS), Security Form-DA (FS-DA), DPEC-7 and DPEC-8 formats)

  • Update the JD Edwards World files based on the fiscal authority response

  • Print the Documento Auxiliar da Nota Fiscal Eletronica (DANFE)

  • Generate Cancel XML

  • Generate Unused XML

A third-party software is required to:

  • Read the XML file in the IFS area

  • Add an electronic signature to the XML file element/enviNFe/NFe/Signature)

  • Send the data to the fiscal authority.

  • Receive the response from the fiscal authority

  • Update the JD Edwards World files based on the fiscal authority response.