Skip to content

Commit

Permalink
Rename and better document br-nfse-simples ext
Browse files Browse the repository at this point in the history
  • Loading branch information
cavalle committed Nov 21, 2024
1 parent 111ca34 commit 44a3b9e
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 14 deletions.
10 changes: 6 additions & 4 deletions addons/br/nfse/extensions.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const (
ExtKeyISSLiability = "br-nfse-iss-liability"
ExtKeyMunicipality = "br-nfse-municipality"
ExtKeyService = "br-nfse-service"
ExtKeySimplesNacional = "br-nfse-simples-nacional"
ExtKeySimples = "br-nfse-simples"
ExtKeySpecialRegime = "br-nfse-special-regime"
)

Expand Down Expand Up @@ -176,9 +176,9 @@ var extensions = []*cbc.KeyDefinition{
},
},
{
Key: ExtKeySimplesNacional,
Key: ExtKeySimples,
Name: i18n.String{
i18n.EN: "Opting for “Simples Nacional”",
i18n.EN: "Opting for “Simples Nacional” regime",
i18n.PT: "Optante pelo Simples Nacional",
},
Values: []*cbc.ValueDefinition{
Expand All @@ -199,7 +199,9 @@ var extensions = []*cbc.KeyDefinition{
},
Desc: i18n.String{
i18n.EN: here.Doc(`
Indicates whether a party is opting for the “Simples Nacional” tax regime.
Indicates whether a party is opting for the “Simples Nacional” (Regime Especial
Unificado de Arrecadação de Tributos e Contribuições devidos pelas Microempresas e
Empresas de Pequeno Porte) tax regime
List of codes from the national NFSe ABRASF (v2.04) model:
Expand Down
2 changes: 1 addition & 1 deletion addons/br/nfse/invoices.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func validateSupplier(value interface{}) error {
),
validation.Field(&obj.Ext,
tax.ExtensionsRequires(
ExtKeySimplesNacional,
ExtKeySimples,
ExtKeyMunicipality,
ExtKeyFiscalIncentive,
),
Expand Down
6 changes: 3 additions & 3 deletions addons/br/nfse/invoices_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,19 +207,19 @@ func TestSuppliersValidation(t *testing.T) {
}
err := addon.Validator(inv)
if assert.Error(t, err) {
assert.Contains(t, err.Error(), "br-nfse-simples-nacional: required")
assert.Contains(t, err.Error(), "br-nfse-simples: required")
assert.Contains(t, err.Error(), "br-nfse-municipality: required")
assert.Contains(t, err.Error(), "br-nfse-fiscal-incentive: required")
}

sup.Ext = tax.Extensions{
nfse.ExtKeySimplesNacional: "1",
nfse.ExtKeySimples: "1",
nfse.ExtKeyMunicipality: "12345678",
nfse.ExtKeyFiscalIncentive: "2",
}
err = addon.Validator(inv)
if assert.Error(t, err) {
assert.NotContains(t, err.Error(), "br-nfse-simples-nacional: required")
assert.NotContains(t, err.Error(), "br-nfse-simples: required")
assert.NotContains(t, err.Error(), "br-nfse-municipality: required")
assert.NotContains(t, err.Error(), "br-nfse-fiscal-incentive: required")
}
Expand Down
6 changes: 3 additions & 3 deletions data/addons/br-nfse-v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,13 @@
}
},
{
"key": "br-nfse-simples-nacional",
"key": "br-nfse-simples",
"name": {
"en": "Opting for “Simples Nacional”",
"en": "Opting for “Simples Nacional” regime",
"pt": "Optante pelo Simples Nacional"
},
"desc": {
"en": "Indicates whether a party is opting for the “Simples Nacional” tax regime.\n\nList of codes from the national NFSe ABRASF (v2.04) model:\n\n* https://abrasf.org.br/biblioteca/arquivos-publicos/nfs-e-manual-de-orientacao-do-contribuinte-2-04/download\n(Section 10.2, Field B-67)"
"en": "Indicates whether a party is opting for the “Simples Nacional” (Regime Especial\nUnificado de Arrecadação de Tributos e Contribuições devidos pelas Microempresas e\nEmpresas de Pequeno Porte) tax regime\n\nList of codes from the national NFSe ABRASF (v2.04) model:\n\n* https://abrasf.org.br/biblioteca/arquivos-publicos/nfs-e-manual-de-orientacao-do-contribuinte-2-04/download\n(Section 10.2, Field B-67)"
},
"values": [
{
Expand Down
2 changes: 1 addition & 1 deletion examples/br/invoice-services.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"ext": {
"br-nfse-municipality": "3304557",
"br-nfse-fiscal-incentive": "1",
"br-nfse-simples-nacional": "1",
"br-nfse-simples": "1",
"br-nfse-special-regime": "4"
}
},
Expand Down
4 changes: 2 additions & 2 deletions 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": "6b9933fc6209359b95583878eb64c358ac1b9028727c3e992ec4e78f7a196687"
"val": "d7ef87ccb18475563f8ce2aa804cd51e46b94c3adc6af2bb0867a72f13ad5ac1"
}
},
"doc": {
Expand Down Expand Up @@ -52,7 +52,7 @@
"ext": {
"br-nfse-fiscal-incentive": "1",
"br-nfse-municipality": "3304557",
"br-nfse-simples-nacional": "1",
"br-nfse-simples": "1",
"br-nfse-special-regime": "4"
}
},
Expand Down

0 comments on commit 44a3b9e

Please sign in to comment.