Skip to content

Commit

Permalink
Add CNAE extension for BR items
Browse files Browse the repository at this point in the history
  • Loading branch information
cavalle committed Nov 19, 2024
1 parent 4683cdc commit 9047358
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 19 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
### Added

- `org`: `Address` includes `LineOne()`, `LineTwo()`, `CompleteNumber()` methods to help with conversion to other formats with some regional formatting.
- `br`: supplier extensions, validations & identities
- `br-nfse-v1`: new extensions, validations & identities for the typical service note and supplier.

### Changes

Expand Down
26 changes: 23 additions & 3 deletions addons/br/nfse/extensions.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

// Brazilian extension keys required to issue NFS-e documents.
const (
ExtKeyCNAE = "br-nfse-cnae"
ExtKeyFiscalIncentive = "br-nfse-fiscal-incentive"
ExtKeyMunicipality = "br-nfse-municipality"
ExtKeyService = "br-nfse-service"
Expand All @@ -16,6 +17,22 @@ const (
)

var extensions = []*cbc.KeyDefinition{
{
Key: ExtKeyCNAE,
Name: i18n.String{
i18n.EN: "CNAE code",
i18n.PT: "Código CNAE",
},
Desc: i18n.String{
i18n.EN: here.Doc(`
The CNAE (National Classification of Economic Activities) code for a service.
For further details on the list of possible codes, see:
* https://www.ibge.gov.br/en/statistics/technical-documents/statistical-lists-and-classifications/17245-national-classification-of-economic-activities.html
`),
},
},
{
Key: ExtKeyFiscalIncentive,
Name: i18n.String{
Expand Down Expand Up @@ -43,7 +60,8 @@ var extensions = []*cbc.KeyDefinition{
Indicates whether a party benefits from a fiscal incentive.
List of codes taken from the national NFSe standard:
https://abrasf.org.br/biblioteca/arquivos-publicos/nfs-e-manual-de-orientacao-do-contribuinte-2-04/download
* https://abrasf.org.br/biblioteca/arquivos-publicos/nfs-e-manual-de-orientacao-do-contribuinte-2-04/download
(Section 10.2, Field B-68)
`),
},
Expand Down Expand Up @@ -110,7 +128,8 @@ var extensions = []*cbc.KeyDefinition{
Indicates whether a party is opting for the “Simples Nacional” tax regime.
List of codes taken from the national NFSe standard:
https://abrasf.org.br/biblioteca/arquivos-publicos/nfs-e-manual-de-orientacao-do-contribuinte-2-04/download
* https://abrasf.org.br/biblioteca/arquivos-publicos/nfs-e-manual-de-orientacao-do-contribuinte-2-04/download
(Section 10.2, Field B-67)
`),
},
Expand Down Expand Up @@ -170,7 +189,8 @@ var extensions = []*cbc.KeyDefinition{
Indicates a special tax regime that the party is subject to.
List of codes taken from the national NFSe standard:
https://abrasf.org.br/biblioteca/arquivos-publicos/nfs-e-manual-de-orientacao-do-contribuinte-2-04/download
* https://abrasf.org.br/biblioteca/arquivos-publicos/nfs-e-manual-de-orientacao-do-contribuinte-2-04/download
(Section 10.2, Field B-66)
`),
},
Expand Down
3 changes: 2 additions & 1 deletion examples/br/invoice-services.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@
"name": "Consultancy Services",
"price": "100.00",
"ext": {
"br-nfse-service": "10.5"
"br-nfse-service": "10.5",
"br-nfse-cnae": "62.01-5-01"
}
},
"taxes": [
Expand Down
3 changes: 2 additions & 1 deletion examples/br/out/invoice-services.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"uuid": "8a51fd30-2a27-11ee-be56-0242ac120002",
"dig": {
"alg": "sha256",
"val": "b1fc7b37b41dc9df2148365e52dd97cdc3a3847de92d5b7560b3cf40cda10f77"
"val": "31573fb261adbfa6011c8c21e5e53c4a7546389e6a39fc47124d0e34fb698811"
}
},
"doc": {
Expand Down Expand Up @@ -83,6 +83,7 @@
"name": "Consultancy Services",
"price": "100.00",
"ext": {
"br-nfse-cnae": "62.01-5-01",
"br-nfse-service": "10.5"
}
},
Expand Down
61 changes: 48 additions & 13 deletions regimes/br/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ For example:

```js
"supplier": {
//...
//...
"addresses": [
{
"num": "75",
Expand All @@ -38,7 +38,7 @@ For example:
"country": "BR"
}
],
//...
//...
```
### Service Notes
Expand All @@ -55,11 +55,11 @@ For example:
```js
"supplier": {
//...
//...
"ext": {
"br-igbe-municipality": "2927408"
"br-nfse-municipality": "2927408"
},
//...
//...
```
#### National and municipal registration
Expand All @@ -70,7 +70,7 @@ For example:
```js
"supplier": {
//...
//...
"identities": [
{
"key": "br-nfse-municipal-reg",
Expand All @@ -81,7 +81,7 @@ For example:
"code": "12345012345678"
}
],
//...
//...
```
#### “Simples Nacional”
Expand All @@ -97,11 +97,11 @@ For example:
```js
"supplier": {
//...
//...
"ext": {
"br-nfse-simples-nacional": "1", // Opt-in
},
//...
//...
```
#### Special Tax Regime
Expand All @@ -121,11 +121,11 @@ For example:
```js
"supplier": {
//...
//...
"ext": {
"br-nfse-special-regime": "4" // Cooperative
},
//...
//...
```
#### Fiscal Incentive
Expand All @@ -141,9 +141,44 @@ For example:
```js
"supplier": {
//...
//...
"ext": {
"br-nfse-fiscal-incentive": "2" // No tax incentive
},
//...
//...
```
#### Municipality service code
Specify the code assigned by the municipality to a service using the
`br-nfse-service` extension at item level. Typically, one of the codes listed in the [Lei Complementar 116/2003](https://www.planalto.gov.br/ccivil_03/leis/lcp/lcp116.htm), but municipalities can make their own changes.
For example:
```js
"lines": [
{
"item": {
//...
"ext": {
"br-nfse-service": "1.01"
//...
```
#### CNAE code
Set the CNAE code (National Classification of Economic Activities) for a service using the `br-nfse-cnae` at item level. Find the list of possible codes [at the IGBE](https://www.ibge.gov.br/en/statistics/technical-documents/statistical-lists-and-classifications/17245-national-classification-of-economic-activities.html).
For example:
```js
"lines": [
{
"item": {
//...
"ext": {
"br-nfse-cnae": "62.01-5-01"
//...
```

0 comments on commit 9047358

Please sign in to comment.