Note
This routine was adjusted to comply with the General Personal Data Protection Law (Statute No. 13.70), so that some fields containing data regarded as sensitive and/or personal are blurred, becoming illegible.
The Withholding Income Tax Declaration - DIRF is the declaration made by the PAYING SOURCE, in order to inform the Federal Revenue Service of Brazil of the amount of income tax and/or contributions withheld from income paid or credited to its beneficiaries.
For companies that use the Payroll of the Personnel Management module integrated into the Financial Services, this routine generates the necessary data for DIRF, feeding the SRL (DIRF/Income Report) and SR4 (DIRF Items) tables.
For the bill to be considered for sending the data to SR4 and SRL (DIRF/Income Report Items), the following registrations must be configured:
In the Suppliers File (SA2), the fields checked when the DIRF is generated are:
Registrations
Adm./Fin.
For the cases with Sched. Inc. Tax, there is also the registration of Sched. Inc. Tax SSN (FKJ), to enter the Income Tax apportionment for more than one SSN.
Check further details on Registration of CPFs progressive apportionment of Federal Income Tax sent to DIRF
Tax
TMS
Residing abroad
Check further details on Generate DIRF for suppliers residing abroad
Others
Check further details on DSERFINP-8673 DT DIRF 2018 VPEIM Immune and Exempt Entities
Warning
The SSN/EIN field must always be entered so as not to generate inconsistencies in the DIRF validator, except in the case of foreign suppliers, where the mandatory information will be the NIF code (A2_NIFEX); if not, inform the NIF reason (A2_MOTNIF).
In the Natures File (SED), the fields checked in the generation of the DIRF are:
Taxes
When registering the bill payable, it is important to enter the following fields:
Taxes
How the bills must be saved once the TXs have been generated:
Invoice Bill (ORIGINAL Bill)
Field “Generate DIRF for this bill?” (E2_DIRF) must be set to 2 - No.
The field Withholding Code (E2_CODRET) must be filled out.
The field Tax Parent Bill (E2_TITPAI) must be blank.
TX Bill (Tax Bill)
Field “Generate DIRF for this bill?” (E2_DIRF) must be set to 1 - Yes.
The field Withholding Code (E2_CODRET) must be filled out.
The field "Tax Parent Bill" (E2_TITPAI) must be filled out with data from the parent bill (prefix+number+ installment+type+supplier+store).
The process for generating data for the DIRF occurs in the following manner:
For Legal Entity:
IR - Income Tax
PIS - Social Integration Program
COFINS - Contribution to the Financing of Social Security
CSLL - Contribution to the Social Security
For natural person:
IR - Income Tax
INSS - National Institute of Social Security
Important: By adding an inbound document with Type of Inflow and Outflow (TIO) configured to generate bills in Financials, check if the content of the parameter MV_VISDIRF is enabled (content 1). This parameter allows you to enter the withholding code for the taxes in the inbound document. |
Minimum value
The validation of the minimum limit of BRL 6,000.00 for sending bills without withholding to SR4 was removed. All bills in which the fields Generate DIRF = Yes and that have a withholding code will be considered for submission to SR4. That way, the minimum value treatment can be performed when generating the DIRF file using the NVLLIMDIRF and NVLLIMOUT mnemonics, used by the routine that generates the DIRF file.
* To comply with the law - Normative Instruction 1.663/2016: to establish that the exemption from withholding taxes in payments to educational and social assistance institutions, and to philanthropic, recreational, cultural, scientific institutions, and non-profit civil associations, is restricted to the services for which they have been established. Payments for these services, although exempt from withholding, must be reported in the DIRF for events occurring as of the calendar year 2017, regardless of the amount.
Consider Date (MV_PAR01)
The DIRF must be generated for the Year:
Example: Calendar 2021 (Period from 01/01/2020 to 12/31/2020).
Select the field of the date that should be considered for generating the data of the main bill* and Income Tax.
If you select Digital Issue, the system will consider the Issue Period (E2_EMIS1) between the start date and the end date entered, and thus with the Due Date (E2_VENCTO), Actual Due Date (E2_VENCREA), and Actual Issue (E2_EMISSAO).
If the Posting Dt option is selected for the question Consider Date, bills with the field E2_BAIXA are filtered first in the period entered in the fields Date from/to.
For bills not posted (blank E2_BAIXA), this same period is considered. However, the issue date (E2_EMIS1) is applied to it. This prevents any mandatory information from being suppressed from the DIRF due to a gap in parameter settings.
ATTENTION: According to our legal advice, all bills must be considered, even if they have not been posted. If you have any questions, check the Private Company - DIRF report at http://tdn.totvs.com/pages/viewpage.action?pageId=134152556
ATTENTION: The questions "DATE FROM" and "DATE TO" (MV_PAR02, MV_PAR03), which allow DIRF calculation files to be generated for a period different from the one mentioned above, are only for isolated data of a certain period, i.e., for verification purposes only.
*As parameters set for the Check Date? Question
Date From (MV_PAR02) and Date To (MV_PAR03)
The questions "DATE FROM" and "DATE TO" (MV_PAR02, MV_PAR03) allow you to select the desired period considering, for the bills filter, the date field entered in the questions "Consider Date?" and "Consider PCC Date?
Supplier Type (MV_PAR04)
Select the type of supplier (natural person or legal entity) to be considered for the generation. Only the bills of the suppliers registered as the type of person chosen in this question will be considered in the generation of the data (blank A2_TIPO will not be considered).
Notes:
A supplier of the Legal type (A2_TIPO = J) configured with Sched. Inc. Tax = Yes will be considered as a Legal Entity in this filter.
A Supplier of the Foreign type (A2_TIPO = X) will be considered as a Legal Entity in this filter.
Check Date (MV_PAR05)
Defines whether the date period entered will be applied to the main bill or to the tax bill.
It must always be generated as "MAIN BILL".
Even though the option of generation by TAX BILL is available in the routine, it is not considered as a valid mechanism to generate DIRF in any official document (Federal Revenue).
Centralize at Branch (MV_PAR06)
Enter the DIRF's centralizing branch. If no branch is entered, the DIRF will be generated with the EIN of the current branch.
Keep in mind that the DIRF delivery is per Company (Matrix).
Generate Processing Log (MV_PAR07)
When you select Yes (generate the log), the report is displayed for checking all the bills, generated in the month and per withholding code, that were sent to table SR4, and can be accessed in the File Maintenance routine (GPEM560).
Note
For each processing, a .CSV file (Excel format) is generated based on the log report and stored in the folder SYSTEM\DIRF of Protheus.
Select Branches (MV_PAR08)
This allows you to select a range of branches for processing the bills.
WARNING: In these cases, field E2_FILORIG is not verified. This means that the E2_FILIAL field will be considered for processing.
Consider PCC Date (MV_PAR09)
This works as the Consider Date (MV_PAR01) parameter, but selecting the date that refers to the Pis/Cofins/Csll bills (main or tax bills*). If you select Issue (E2_EMIS1), the system will consider the Issue period between the Start Date (MV_PAR02) and the End Date (MV_PAR03) entered, as well as the Due Date (E2_VENCTO), Actual Due Date (E2_VENCREA), Posting Dat e(E2_BAIXA), and Actual Issue (E2_EMISSAO).
Posting Date - If these bills have not been posted, they will not be sent to the DIRF.
Note:
Consider Date = Issue, Actual Issue Date, Due Date, and Actual Due Date
Check date = Tax Bill
This is a variation not stated by law, i.e. it is only available for checking and managerial view. This is because, according to the law, the PCC retention is on payment.
*As parameters set for the Check Date? Question
Consider Advance Payment (MV_PAR10)
If set to No, maintain the default submission, generating only Invoice information.
If set to Yes, only the TXs of Income Tax, PIS, COFINS, and CSLL (configured on posting) generated by the PA will be considered. The value of the Invoice settled with the PA will be ignored.
For further information about this question, refer to DIRF Considers PA submission
Processing: While bills are not processed by DIRF routine, the field E2_DTDIRF is blank.
Reprocess = No: keep the records in SR4 and consider only the records that were not processed yet (blank E2_DTDIRF).
Reprocess = Yes: SR4 records will be deleted according to the year entered in Start and End Date, and the DIRF processing date (E2_DTDIRF) will be cleared for reconsideration. The bills considered will be the same as the filter configured.
Reprocessing Option (FINA401 - SIGAFIN)
To generate data for the DIRF:
After generating the data for the DIRF, the date of processing is stored in the field Dt. Gen. field (E2_DTDIRF) for the processed bills.
FA401QRY- Change query select conditions
LF401GRV - Consider certain records of SE2
F401QRY2 - Add or change data when selecting tax bills
F401QRY3 - Add or change data when selecting tax bills
F401QRY4 - Add or change data when selecting tax bills
F401QRY5 - Add or change data when selecting tax bills
FA401PROC - Processing and generating DIRF data
F401REX - Change list of withholding codes
F401DCMP to save complementary data
LF401GRV - Consider certain records of SE2
FINCDRET - Return withholding codes
Monthly registration of the dependent's deduction amount for income tax
Registration of CPFs progressive apportionment of IRRF sent to DIRF
For further information about DIRF, refer to: