Skip to main content

BRAZIL TAX CHANGES

REQUIREMENT

New region/state-based tax mapping for CNPJ:

  1. If the user selects ‘CNPJ’, then ‘Brazil: State Tax Number’ and ‘Brazil: Municipal Tax Number’ should be mandatory. Brazil: 'SUFRAMA ID’ should be optional. SUFRAMA ID, this field should only accept numbers.
  2. ‘Brazil: State Tax Number’, ‘Brazil: Municipal Tax Number’, and Brazil: SUFRAMA ID’ will be 3 new tax sub-types in CMD and should be enabled if the user selects CNPJ.
  3. Formats/min/max cap limits
  4. CNPJ will exist as a separate tax reference and should have exactly 14 numbers.
  5. Brazil: State Tax Number should have a maximum of 14 numbers. If there are no numbers, then the user must enter ‘ISENTO’
  6. Brazil: Municipal Tax Number should have only numbers. There is no maximum limit.
  7. Brazil: 'SUFRAMA ID’, should only have numbers. It can have a max of 9 numbers. A blank field is accepted

APPROACH A:

IMPACTED AREA/FLOW DIAGRAM

  1. CMD PORTAL
    1. To Update the Validation ruleset change for the BRAZIL country
    2. Accommodate request & response mapping of Tax reference details

Currently how we take Tax reference details.

Currently how we display Tax reference details.

  1. INGEST CUSTOMER
    1. Tax Identifier Validation update (Validate Identifiers Endpoint)
    2. Ingest customer Create/Update Request structure change (OAS)
    3. Persistence logic change for tax identifiers in write DB
    4. Customer auto-sync logic update (Query Update)
    5. Customer History Update
  2. RELATIONAL/WRITE DB
    1. Below are the impacted tables with the above requirements
      1. mdm_smds.customer_tax_ref_info
      2. mdm_smds.ref_tax_type_local_name
      3. mdm_smdsmd.cmd_generic_country_rules
  3. ELASTIC/READ DB
    1. Customer elastic Schema update
  4. PUBLISH CUSTOMER
    1. EMP Customer Schema update
    2. Tax identifier Mapping Update
  5. SEARCH CUSTOMER
    1. Response Structure Update as per elastic schema update
    2. Will the match logic will also be impacted?
    3. Tax identifier Mapping Update
  6. BBU
    1. customer_tax_ref_num BBU template
  7. PUBLISH TO MQ
    1. Is it required?

SCHEMA CHANGES PROPOSAL’s

ELASTIC SCHEMA

CUSTOMER EMP SCHEMA

Type 1:

Type 2:

INGEST CUSTOMER REQUEST


APPROACH B : (Discussed in Tech Connect). CURRENTLY IMPLEMENTED

We will treat the sub-tax type for Brazil as a normal tax identifier type.

i.e. ‘Brazil: State Tax Number’ ‘Brazil: Municipal Tax Number’, and Brazil: 'SUFRAMA ID’ are to be considered as TAXNO3, TAXNO4, and TAXNO5 respectively.

CMD PORTAL

Need to modify the tax identifier request screen for BRAZIL country when the user selects CNPJ as the tax type

Below is the draft screen

https://www.figma.com/proto/fYug87pmXQXc4v5Qgl5TEe/CMD-Modernization?page-id=0%3A1&type=design&node-id=1504-1599&viewport=-3034%2C-742%2C0.11&t=DmLE74q26uyVwrnn-1&scaling=min-zoom&starting-point-node-id=1504%3A1599&mode=design

The sub-tax identifiers will be displayed in the same format as other tax identifier records

At max, a brazil country code will have 5 tax identifier objects.

COUNTRY RULE SET API:

To Update the rule set for BRAZIL

Earlier Response

{
"fieldType": "BR1",
"formatCheck": "^[0-9]{14}$",
"formatCheckDescription": "For Country Brazil, Tax Reference field length must be 14 numeric digits, format NNNNNNNNNNNNNN. Also, either CNPJ (BR1) or CPF (BR2) is mandatory for Brazil customers",
"isMandatory": false,
"isApplicable": true,
"isExternalCheckApplicable": true
},
{
"fieldType": "BR2",
"formatCheck": "^[0-9]{11}$",
"formatCheckDescription": "For country Brazil, then Tax Number 2 field (CPF) should be 11 numeric digits Also, either CNPJ (BR1) or CPF (BR2) is mandatory for Brazil customers",
"isMandatory": false,
"isApplicable": true,
"isExternalCheckApplicable": true
},
{
"fieldType": "BR2|BR3",
"formatCheck": "^[0-9]{14}$",
"formatCheckDescription": "For Country Brazil, Tax Number 3 field length must be 14 numeric digits, format NNNNNNNNNNNNNN. Also, For CNPJ (BR1) its mandatory to enter State Tax Number (BR3)",
"isMandatory": false,
"isApplicable": true,
"isExternalCheckApplicable": true
},
{
"fieldType": "BR2|BR4",
"formatCheck": "^[0-9]{11}$",
"formatCheckDescription": "For Country Brazil, Tax Number 3 field length must be 14 numeric digits, format NNNNNNNNNNNNNN. Also, For CNPJ (BR1) its mandatory to enter Municipal Tax Number (BR4)",
"isMandatory": false,
"isApplicable": true,
"isExternalCheckApplicable": true
},
{
"fieldType": "BR5",
"formatCheck": "^[0-9]{9}$",
"formatCheckDescription": "For country Brazil, then Tax Number 5 field (SUFRAMA ID) should be 9 numeric digits",
"isMandatory": false,
"isApplicable": true,
"isExternalCheckApplicable": true
}

Current Response

{
"fieldType": "BR1",
"conditionalCheck": "BR1 |BR2",
"formatCheck": "^[0-9]{14}$",
"formatCheckDescription": "For Country Brazil, Tax Reference field (CNPJ) length must be 14 numeric digits, format NNNNNNNNNNNNNN. Also, either CNPJ (BR1) or CPF (BR2) is mandatory for Brazil customers.",
"isMandatory": false,
"isApplicable": true,
"isExternalCheckApplicable": true
},
    {
"fieldType": "BR2",
"conditionalCheck": "BR1 |BR2",
"formatCheck": "^[0-9]{11}$",
"formatCheckDescription": "For country Brazil, Tax Number 2 field (CPF) should be 11 numeric digits, format NNNNNNNNNNN. Also, either CNPJ (BR1) or CPF (BR2) is mandatory for Brazil customers.",
"isMandatory": false,
"isApplicable": true,
"isExternalCheckApplicable": true
},
    {
"fieldType": "BR3",
"conditionalCheck": "BR1 &BR3",
"formatCheck": "^ISENTO$|^[0-9]{1,14}$",
"formatCheckDescription": "For country Brazil, Tax Number 3 field (State Tax) must not be more than 14 digits or ‘ISENTO’. Also, Tax Number 3 field is mandatory when TAX Number 1 is entered.",
"isMandatory": true,
"isApplicable": true,
"isExternalCheckApplicable": true
},
    {
"fieldType": "BR4",
"conditionalCheck": "BR1 &BR4",
"formatCheck": "^[0-9]{0,18}$",
"formatCheckDescription": "For country Brazil, Tax Number 4 field (Municipal Tax) must not be more than 18 digits. Also, Tax Number 4 field is mandatory when TAX Number 1 is entered.",
"isMandatory": true,
"isApplicable": true,
"isExternalCheckApplicable": true
},

BBU Case:

Problem

how we are going to handle the validations of CNPJ sub taxes check in BBU template, bcz for CNPJ tax(taxno2), it requires two sub taxes also to be entered i.e taxno4 n taxno5 then in BBU we pick each row and validate na when in template we enter three rows like below and when system picks first row it will check and will it throw error stating taxno3 n 4 also required when user selects taxno2 .. ?? but how ever user entered the required taxes in below rows in bbu file.

Solution

Internally in logic Group the BBU rows based on customer code and process multiple tax updates as single update request such that adding CNPJ, BR3, BR4 can be done in single request.

S. NoScenarioHow to provide data in excel
1Customer doesn't have either CNPJ or Sub tax types and we want to aa CNPJ and its sub tax types.Provide CNPJ, BR3, BR4 tax details in three rows with corresponding Tax value
2Customer has CNPJ doesn't have sub taxes.Provide Both BR3, BR4 on separate rows.
3Update CNPJ tax valueProvide only CNPJ tax value.
4Delete CNPJ tax value.Provide only CNPJ with %%NULL!
5Update Sub tax valueProvide the sub tax type with required value.
6Add/Update CPFProvide the CPF with value.

Validation scenario:

In case of validations errors on updating the customer with give either single tax update or multiple tax updates, each error will be written to each row in BBU ERROS File.

Was this page helpful?