62 Work With SPED Fiscal in Brazil

This chapter contains these topics:

62.1 Understanding the SPED Fiscal Process

SPED Fiscal is a legal reporting requirement in Brazil. Companies must report, via an uploaded flat file, all of their business transactions that occurred over a period of time. The government defines the period of time (reporting date range), the required information, and magnetic media layout. The purpose is to verify ICMS and IPI taxes. The report is to be run monthly.

The fiscal authority provides a manual Guia Prático EFD that contains the rules for the generation of the each block, records and fields present in the report. The format of the report varies according to the Company fiscal profile and the version of the report layout.

The government supplies a validation and import program that you can use to upload the flat file.

62.1.1 Understanding the SPED Fiscal Process

SPED Fiscal is a legal reporting requirement in Brazil. Companies must report, via an uploaded flat file, all of their business transactions that occurred over a period of time. The government defines the period of time (reporting date range), the required information, and magnetic media layout. The purpose is to verify ICMS and IPI taxes. The report is to be run monthly.

The fiscal authority provides a manual Guia Prático EFD that contains the rules for the generation of the each block, records and fields present in the report. The format of the report varies according to the Company fiscal profile and the version of the report layout.

The government supplies a validation and import program that you can use to upload the flat file.

Both manual and validation program are available for downloading in the fiscal authority website:

http://www1.receita.fazenda.gov.br/sped-fiscal/download.htm.

After the validation, the digital file is signed by means of digital certificate. That process is handled outside of JD Edwards World software.

The text files are uploaded to the government system provided by Brazilian Federal Tax Authority, and then transmitted through the Internet to the Brazilian Federal Tax Authority database.

62.1.2 Prerequisites

Nota Fiscal and SPED Contabil updates must be installed first.

Verify that Brazil is the country that you have selected for your user display preferences.

62.1.2.1 Setting Up the System

Additional Item Master Information (P704101) and Additional Item Branch Information (P704102) programs allow you to add additional information to your items.

You may want to set up generic function key exits to these programs so you can access them from Item Master (P4101) and Item Branch (P4102) Function Key 24.

Go to Generic Function Key Exits (P9601F)

Inquire on Item Master video (V4101)

Put a C (Change) in the Action Code (ACTN) and set up the function key exit as follows:

Figure 62-1 Generic Function Key Exits screen

Description of Figure 62-1 follows
Description of "Figure 62-1 Generic Function Key Exits screen"

62.1.2.2 Category Code

Item category codes must be set up in the Item Master file (F4101) or Item Branch file (F4102) or Item Master Localization Tag File (F704101) or Item Branch Localization Tag file (F704101). This information is used in Block 0, record 0200.

The category codes used are:

  • Item Owner

  • Mercosur Code

  • Item Generic Code

  • Item Type

  • EX Code

  • Service Code

Figure 62-2 Item Master screen

Description of Figure 62-2 follows
Description of "Figure 62-2 Item Master screen"

62.1.2.3 User Defined Codes

The following User Defined Codes are delivered with values:

  • UDC 76B/BL contains the description of the blocks.

  • UDC 76B / FP contains a list of Fiscal Presentation Types. This information is used in Block 0 record 0000. The system also uses the values in this UDC table to determine the records to include according to the rules that you set up in the Block Rules Control program.

  • UDC 76B /VC contains the values for Process ID which are SPED Fiscal or SPED Contabil. SF is the code for SPED Fiscal and the first position of the Special Handling Code (SPHD) is 2.

  • UDC 76B/BR contains the Record IDs and descriptions for both SPED Contabil and SPED Fiscal.

  • UDC 76B/PM contains the Transaction Nature (CFOP) for Services to be included in Block D.

  • UDC 76B/PS contains the values for canceled Notas Fiscais. These are used when Block C records are generated.

  • UDC 76B/ST contains the codes for processed electronic Notas Fiscais. Description 2 holds the 2-digit numeric code that is required.

  • UDC 76B/BS indicates the status of the blocks you process. Values are hard coded.

  • UDC 76B/LC contains the Layout Version code used in setup of SPED Fiscal.

  • UDC 76B/PC lists purpose codes for the SPED Fiscal report

The following UDC tables must be set up

  • UDC 76B/MU IBGE Codes retrieval by zip code. Populate it as follows:

    • Code (KY): Enter a valid zip code (format 99999999),

    • Description-1 (DL01): Enter a description

    • Description-2 (DL02): Enter the IBGE code (format 9999999) provided by the fiscal authority

  • UDC 76B/PA Fiscal Authority Country Code retrieval by A/B Country Code

    • Code (KY): Enter the Country Code provided by the fiscal authority, i.e. 01058

    • Description-1 (DL01): Enter a description for the Country, i.e. Brazil

    • Description-2 (DL02): Enter the Country Initials set up in Address Book files, i.e. BR

  • UDC 76B/MO Inventory Reason

    • Code (KY): Enter Inventory Reason value

    • Description (DL01): Enter Inventory Reason description

    • Special Handling Code (SPHD): Enter 1 if you want record H020 to print for this reason.

62.1.2.4 Set Up an IFS Area

You must set up an Integrated File System (IFS) area on your iSeries for the TXT files that you will provide to the government's fiscal authority.

See "Work with Import/Export" in the JD Edwards World Technical Tools Guide.

You must also:

  • Set up Constants to Block 0 Information.

  • Set up Imposto sobre Circulação de Mercadorias e Serviços (ICMS) period balance amounts.

  • Set up Imposto sobre Produtos Industrializados (IPI) balance amounts.

  • If the Presentation Type is not A, you must set up rules for each SPED Fiscal Process to indicate if the record is reported or not. Note: A set of Block Rules Control is delivered for Presentation Type A.

62.2 Setting up Information for Constants to Block 0 Program (P76B520)

Navigation

From Localizations - Brazil (G76B), choose Fiscal Books

From Fiscal Books (G76B00), choose SPED Fiscal Setup

From SPED Fiscal Set Setup (G76B0011), choose Constants to Block 0

Constants to Block 0 program (P76B520) allows you to set up constants' values by Company that are required to generate Block 0 and Block H records. The Company fiscal profile and the version of the layout are also entered through this program.

62.3 Company Information

A legal company is the company for which you report data. The system uses the data that you enter to populate fields in the files that you submit for SPED Fiscal. The Legal Company must exist in the Company Constants File (F0010) and in the Branch/Plant - Fiscal Company Cross Reference File (F7606B).

62.3.1 Additional Address Book Information

SPED Fiscal requires you to report information about your company, your accountant, and substitute contributor information (if available).

You may need to use the following to verify their information.

  • Address Book Revisions (P01051), i.e., Address Line fields (ADD1 to ADD4)

  • Email/URL Revisions (P01018)

Address Book Revisions program (P76B140) is available through SPED General Account System Setup menu option 2. It allows you to assign inscription information to an address number.

For example, inquire on your Accountant Address Number. Then populate Inscription Type field with a 30 Inscription Number.

Figure 62-3 Address Book Revisions screen

Description of Figure 62-3 follows
Description of "Figure 62-3 Address Book Revisions screen"

62.4 Setup for Block 0

On Constants to Block 0 (P76B520), populate Action Code with an A (Add), then enter the following information:

  • Company

  • Accountant A/B Number.

  • Substitute Contributor Addr

  • Layout Version Code

  • Fiscal Presentation Type

  • Activity Code

  • Item Owner Cat Code

  • Mercosur Code Category Code

  • Item Generic Code Cat Code

  • Item Type Category Code

  • Service Code Category Code

  • Email/URL Address Code

  • Mailing Address

  • Complement

  • Neighborhood

You can press F1 on any field to search and/or retrieve a value for the field.

Figure 62-4 Constants to Block 0 screen

Description of Figure 62-4 follows
Description of "Figure 62-4 Constants to Block 0 screen"

62.4.1 Additional Item Information

You must associate a Category Code value to the following fields:

  • Item Owner Category Code

  • Mercosur Code Category Code

  • Item Generic Code Category Code

  • Item Type Category Code

  • EX Code Category Code

  • Service Code Category Code

On Constants to Block 0 (P76B520), enter the Category Code number for each one of these fields:

  • 1 to 20: to associate the field with a category code from F4101 or F4102 file

  • 21 to 40: to associate the field with a category code from F704101 or F704102 file.

If you select values 21 to 40 the name of the Category Code will not match with the name of the Category Code in the file. For example,

  • Item Owner Category Code value is 21

    • The system will retrieve this value from F704101 or F704102 Category Code 01.

  • Mercosur Code Category Code is 31

    • The system will retrieve this value from F704101 or F704102 Category Code 11.

You can use the following programs to enter these category codes:

  • Classification Codes (P41011)

  • Item Branch Class Codes (P41025)

The following programs are automatically called by Item Master (P4101) and Item Branch/Plant (P41026) during an Add or Change action:

  • Master Information (P704101)

  • Additional Item Branch Information (P704102)

Figure 62-5 Additional Item Master Info screen

Description of Figure 62-5 follows
Description of "Figure 62-5 Additional Item Master Info screen"

62.5 Setup for Block H

The Item Owner Category field is mandatory.

The system writes the data that you enter to the F76B520 file.

62.5.1 Processing Options for Contact Phone Numbers

Review the processing option values for Form ID P76B532 (2/G81). You will enter which phone type you want to use for regular phone and for FAX. These values must exist in User Defined Code 01/PH.

62.6 SPED Fiscal Block Setup

This section provides an overview of blocks, sequences, and versions used to generate SPED Fiscal data. The Block Setup file, F76B147, is set up with the batch programs and versions to run for each block. You can also set up your own DREAM Writer versions for these programs or for custom programs that you create to generate blocks or populate records for data that does not reside in JD Edwards World.

62.6.1 Process ID for SPED Fiscal

Navigation

From Localization - Brazil (G76B), choose Fiscal Books

From Fiscal Books (G76B00), choose SPED Fiscal Setup

From SPED Fiscal Set Setup (G76B0011), choose Block Setup

The blocks are defined in UDC 76B / BL as Blocks C, D, E, G, H, I, J, 0, 1 and 9. The Process ID for SPED Fiscal is SF from UDC 76B / VC. The Process ID separates the sequence of steps for SPED Fiscal from other processes that use this same setup program.

Block sequence is the order in which the block appears in the flat file.

Block Block Sequence
0 1
C 2
D 3
E 4
G 5
H 6
1 7
9 8

Note:

The version field shows the version as ZJDE0001, even if the program is not a Dream Writer.

62.6.2 Setting up SPED Fiscal Block Control Rules

This section provides an overview of defining records as mandatory (or not) for a Process ID (report type).

Navigation

From Localizations - Brazil (G76B), choose Fiscal Books

From Fiscal Books (G76B00), choose SPED Fiscal Setup

From SPED Fiscal Set Setup (G76B0011), choose Block Rules Control

The Block Control file, F76B523, has information set up for all blocks and records for Fiscal Presentation Type A. These rules determine if the record must appear in the output or not. You will need to set up additional records if the Fiscal Presentation Type for the company is not A. These rules are used to indicate if the record must appear in the output file or not.

The rules specified by Brazilian law may depend on the following values:

  • Profile - The Brazilian Tax authority categorizes the different companies as Profile A, Profile B and Profile C. This value is defined in the Sped Fiscal Constants.

  • NF Input/Output: - Identifies information regarding the Fiscal Notes that are on the system related to Purchase transactions (input) or related to Sales Transactions (output)

  • Other Rules - Identifies no input/output information. It contains Master information for Inventory, Suppliers, Customers, etc.

The requirements for the rule values are the following:

Report Input Rule Output Rule Other Rule
9,D,E,C M/N/O M/N/O blank
G, H,0,1 blank blank M/N/O

Import and export functionality is available for this file.

62.7 Setting Up ICMS Period Balances

According to SPED Fiscal requirements, records E110 and E210 of Block E must contain information about the ending balances that are carried forward to the next period for ICMS and ICMS Substitution tax. For record E110, you must set up the ICMS balances for the state of the company. There should be one E210 record per state in which a company conducts business, so you must set up the ICMS balances for each state for the reporting company. The reporting company should be the Fiscal Company for which the report is being processed.

Navigation

From Localizations - Brazil (G76B), choose Fiscal Books

From Fiscal Books (G76B00), choose SPED Fiscal Setup

From SPED Fiscal Set Setup (G76B0011), choose ICMS Period Balances

This information is stored in the F76B521 file.

Figure 62-6 ICMS Period Balances screen

Description of Figure 62-6 follows
Description of "Figure 62-6 ICMS Period Balances screen"

62.8 Setting Up IPI Period Balances

This program allows you to enter ending IPI tax balance information that is then carried forward to the next period. Data entered is stored in the F76B522 file.

Navigation

From Localizations - Brazil (G76B), choose Fiscal Books

From Fiscal Books (G76B00), choose SPED Fiscal Setup

From SPED Fiscal Set Setup (G76B0011), choose IPI Period Balances

Figure 62-7 IPI Period Balances screen

Description of Figure 62-7 follows
Description of "Figure 62-7 IPI Period Balances screen"

62.9 SPED Fiscal Jobs

Navigation

From Localizations - Brazil (G76B), choose Fiscal Books

From Fiscal Books (G76B00), choose SPED Fiscal Jobs

There are two steps to the Fiscal Jobs process:

  • Set up a job using the P76B524 program.

  • Use the P76B155 program to run the block programs for the job and extract data for the flat file.

62.9.1 Set Up SPED Job

First, using the SPED Fiscal Jobs program (P76B524), you set up a new job by entering Job Description, Legal Company, Fiscal Year, Period Number, and Code of Purpose. The Job Number is assigned a Next Unique ID Number or you may assign your own job number.

The SPED Fiscal Jobs program (P76B524) allows you to inquire, add, change, or delete jobs. If you attempt to delete a job for which no records exist in the output file, F76B156, the system displays a confirmation message. You can confirm the action to delete the job. You may not delete a job if a record for it exists in F76B156.

When you add a job, the system writes data to the SPED Jobs (F76B153), SPED Job Header Blocks (F76B154) and SPED Job Detail Blocks (F76B155) files using the Process ID and values that you set up in the Block Setup program (P76B147).

The status of the Job is displayed on this video, and the Process ID is displayed in the fold.

Figure 62-8 SPED Fiscal Jobs screen

Description of Figure 62-8 follows
Description of "Figure 62-8 SPED Fiscal Jobs screen"

Through exits from this program, you can:

  • View/Change Block Setup

  • View/Change Block Rules Control

Second, place a 1 in the Option (OP) field of the job you want to execute. This takes you to the Block Revisions screen.

62.9.2 Block Revisions/Running Block Programs

This program allows you to inquire, change and or execute SPED Fiscal Process programs.

By default, when you select Action code I (Inquire), the program lists the Block, Sequence, Program ID and Version ID set up for SPED Fiscal Process (SF) in Block Setup (P76B147), but you can replace the Version ID default value with your own Dream Writer/program versions.

Option Exits allow you to:

  • Inquire/Change Block Setup

  • Inquire/Change Block Rules Control

Figure 62-9 Block Revisions screen

Description of Figure 62-9 follows
Description of "Figure 62-9 Block Revisions screen"

Figure 62-10 Block Revisions screen

Description of Figure 62-10 follows
Description of "Figure 62-10 Block Revisions screen"

To run the block programs, place a 1 in the Option field. We recommend that you run the blocks/programs in the order they appear on the Block Revisions screen. There are dependencies between the programs. See more information in Chapter 63, "Additional Block/Record Information".

The system completes these tasks for each block in the job:

  1. Reads the job information for the block that is stored in the SPED Fiscal Jobs file (F76B153).

  2. Checks the values in the SPED Fiscal Block Rules file (F76B523) to determine which records to generate.

  3. Populates the SPED Job Output Detail file (F76B156) with the information for the block, period, and records. If the SPED Job Output Detail file (F76B156) has records for the block you are generating, the system deletes all records from the file for that block, then re-populates the file with the new records.

  4. Uses a status code to indicate whether the records are queued for processing.

    Status codes are: blank (pending), P (in process), D (done), or E (error). These status codes appear for each program in the job that you run, and are displayed in the RS field of the Block Revisions video. A status code of D (done) appears for the block when all of the programs have run without error. When all programs are at status D, the Job Status field in the header portion of the video is also updated to D.

  5. Each program generates the necessary information for each block in file F76B156. Block 9 not only generates data in the F76B156 but also exports this file for the period to a .TXT file. There is one text file generated for the period. The naming convention of the TXT file is:

    SF + Job Number + Period Number + '.TXT.' An example is, SF7610000201.TXT.

The next step is to download the government validation program from the Fiscal Authority at the following link:

http://www1.receita.fazenda.gov.br/sped-fiscal/download.htm

It will be used to validate the .TXT file. You will click on the shortcut generated on the Desktop and import the corresponding IFS file to validate it. The validation is run which generates a summary with the errors or informs you that the file is correct.

62.9.2.1 Export of the TXT file to the IFS area

You must set up Export parameters for P76B169. On the DREAM Writer versions list (2/G81), choose to change your version. On the Additional Parameters screen, select F6, "Batch Export Parameters." Enter F76B169.TXT in the Import/Export name.

Enter your IFS path in the field provided for it.

Note:

The F76B169.TXT file name will be overwritten with the file name generated by the Block 9 program.

If more than one user will run Block 9, each must set up Export on the version(s) of P76B169 that they use.

62.9.2.2 SPED Fiscal Programs

Review Additional Block/Record Information for information about the SPED Fiscal programs called by the SPED Fiscal job.