01. OVERVIEW
The calculations for withholding bills generated by the Financials, Billing and Purchases modules are performed differently at the posting time.
While bills generated by the Financials check the rate fields from the nature registration (table SED), bills generated by the Billing and Purchases modules recalculate their percentage due to the possibility of entering different rates in their items. The calculation applied in these cases is the withholding calculated value divided by the invoice total value, resulting in the rate percentage.
This document aims to explain the difference between the bill withholding calculations from the Financials, Purchases and Billing modules at posting time.
Important
The scenarios below are just mathematical examples to highlight the calculations.
With the PIS, COFINS, and CSLL withholdings configured to be deducted at posting (parameter MV_BR10925 for the accounts receivable portfolio, and MV_BX10925 for the accounts payable portfolio), we add an invoice for BRL 1,327.50.
Calculation example with rounding parameters (MV_RNDPIS, MV_RNDCOF, and e MV_RNDCSL) set to ".T." (round the values).
Invoice Addition (E1_VALOR): 1,327.50
1,327.50 x (0.65/100) = 8.62875
Rounding: 8.63
1,327.50 x (3.00/100) = 39.825
Rounding: 39.83
1,327.50 x (1.00/100) = 13.275
Rounding: 13.28
Attention
For bills originated by the Purchases and Billing modules, parameter MV_RNDSOBR is also considered.
The calculation is performed differently for bills originated directly from the Financials module and bills originated from the Billing and Purchases modules.
Partially posting the bill entered in the previous item.
Post example for a bill originated by the Financials module:
Important
For bill postings originated at the Financials, the tax rate is checked in the nature table (SED) fields: ED_PERCPIS, ED_PERCCSL, and ED_PERCCOF.
In the example below:
ED_PERCPIS: 0.65
ED_PERCCSL: 1.00
ED_PERCCOF: 3.00
Bill value: 1,327.50
First partial post for 638.13.
638.13 x (0.65/100) = 4.14785
Rounding: 4.15
638.13 x (3.00/100) = 19.1439
Rounding: 19.14
638.13 x (1.00/100) = 6.3813
Rounding: 6.38
Note: In the image example, the bill has Income Tax withheld on issuance for BRL 19.91.
Second partial posting with the balance total.
Second post value: 689.37
689.37 x (0.65/100) = 4.480905
Rounding: 4.48
689.37 x (3.00/100) = 20.6811
Rounding: 20.68
689.37 x (1.00/100) = 6.8937
Rounding: 6.89
Note: In the image example, the bill has Income Tax withheld on issuance for BRL 19.91.
Example of post for a bill coming from the Billing module
Important
For bill posts coming from the Purchases and Billing modules, the withholding rate percentages are not the tax rates entered in the SED table, since some invoice items can have different rates. To rebuild the tax rate values, the following calculation is necessary:
(Calculated withholding value) / (Invoice value) = Percentage to be considered for calculation
Percentage to be considered for calculation * 100 = Tax rate result
Example:
8.63/1,327.50 = 0.00650094
0.00650094 * 100 = 0.650094
First partial post for 638.13.
Tax rate: 8.63/1,327.50 = 0.00650094*100 = 0.650094
638.13 x (0.650094/100) = 4.14844
Rounding: 4.15
Tax rate: 39.83/1,327.50 = 0.03000376*100 = 3.000376
638.13 x (3.000376/100) = 19.1462
Rounding: 19.15
Tax rate: 13.28 / 1,327.5 = 0.01000376 * 100 = 1.000376
638.13 x (1.000376/100) = 6.38370
Rounding: 6.38
Note: In the image example, the bill has Income Tax withheld on issuance for BRL 19.91.
Second partial posting with the balance total.
Second post value: 689.37
Tax rate: 8.63/1,327.50 = 0.00650094*100 = 0.650094
689.37 x (0.650094/100) = 4.481553
Rounding: 4.48
Tax rate: 39.83/1,327.50 = 0.03000376*100 = 3.000376
689.37 x (3.000376/100) = 20.68369
Rounding: 20.68
Tax rate: 13.28 / 1,327.5 = 0.01000376 * 100 = 1.000376
689.37 x (1.000376/100) = 6.8962
Rounding: 6.90
Note: In the image example, the bill has Income Tax withheld on issuance for BRL 19.91.