Brazil
Here are the details to validate tax registration numbers as per Brazil's validation rules:
Country Code: BR
REPORTING_TYPE_CODE/ Validation Type |
REPORTING_TYPE_NAME |
No of Digits |
Format |
Check Digit |
Check Digit Validation |
Default Validation |
Example TRN No |
---|---|---|---|---|---|---|---|
ORA_BR_SUFRAMA |
Brazil SUFRAMA |
9 |
Numeric characters only |
Yes, 9th digit (Last digit) |
S1=9*N(1)+8*N(2)+7*N(3)+6*N(4)+5*N(5)+4*N(6)+3*N(7)+2*N(8) S2=S1 % 11 if S2 = 0 Then C(1) = 0 Else if S2 = 1 Then C(1) = 0 Else Then C(1) = (S2 - 11) * (-1) End If When you enter a number that's less than 9 digits, the number is automatically prefixed with zeros to make it a 9 digit number and then the validation logic is performed. |
TAX_PAYER_ID |
|
ORA_BR_CNPJ |
Brazil CNPJ |
14 |
Numeric characters only |
Yes, 13th and 14th digits (Last 2 digits) |
S2=S1 % 11 if S2 = 1 Then C(1) = 0 Else Then C(1) = 0 Else Then C(1) = (S2 - 11) * (-1) End If To check c(2) S3=6*N(1)+5*N(2)+4*N(3)+3*N(4)+2*N(5)+9*N(6)+8*N(7)+7*N(8)+6*N(9)+5*N(10)+4*N(11)+3*N(12)+2*C(1) S4=S3 % 11 if S4=1 Then C(2) = 0 Else Then C(2) = (S4 - 11) * (-1) End If When you enter a number that's less than 14 digits, the number is automatically prefixed with zeros to make it a 14 digit number and then the validation logic is performed. |
Good:
Bad:
|
|
ORA_BR_CPF |
Brazil CPF |
11 |
Numeric characters only |
Yes, 10th and 11th digits (Last 2 digits) |
To Check C(1) S1=10*N(1)+9*N(2)+8*N(3)+7*N(4)+6*N(5)+5*N(6)+4*N(7)+3*N(8)+2*N(9) S2=S1 % 11 if S2 = 1 Then C(1) = 0 Else Then C(1) = (S2 - 11) * (-1) End If To Check C(2) S3=11*N(1)+10*N(2)+9*N(3)+8*N(4)+7*N(5)+6*N(6)+5*N(7)+4*N(8)+3*N(9)+2*C(1) S4=S3 % 11 if S4=1 Then C(2) = 0 Else Then C(2) = (S4 - 11) * (-1) End If When you enter a number that's less than 11 digits, the number is automatically prefixed with zeros to make it a 11 digit number and then the validation logic is performed. |
Good: Good:
Bad:
|
|
ORA_BR_IM |
Brazil Municipal Inscription IM |
The tax registration structure can vary based on the city as there are 5800+ municipal regions (Cities) in Brazil. This means that there are too many varieties of formats and check digits to be implemented. Hence, there's no validation for this TRN and you can enter it as a text field with special characters such as ".", "/" and "-". |
|||||
ORA_BR_IE |
Brazil State Inscription IE |
It's not possible to document different algorithms here. Each state has different logic leading to numerous complex algorithms. |
It's not possible to document different algorithms here. Each state has different logic leading to numerous complex algorithms. |
It's not possible to document different algorithms here. Each state has different logic leading to numerous complex algorithms. |
It's not possible to document different algorithms here. Each state has different logic leading to numerous complex algorithms. |
It's not possible to document different algorithms here. Each state has different logic leading to numerous complex algorithms. |
|
ORA_BR_NIRE |
Brazil NIRE |
The default CNPJ validation is considered. |
|||||
ORA_BR_OTHER |
Brazil Other |
11 |
This registration type has been entered to allow backward compatibility as this was captured in R12. there's no specific validation required for check digit and format check. However, uniqueness checks will be triggered as per the setup. |
No |
No Check Digit Validation |
CNPJ validation is now default validation. AND would be used even when the transaction type IS NULL |