From 44a3b9ee9e6c524f59385ad1886f05340421f7e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luismi=20Cavall=C3=A9?= Date: Thu, 21 Nov 2024 16:01:49 +0000 Subject: [PATCH] Rename and better document br-nfse-simples ext --- addons/br/nfse/extensions.go | 10 ++++++---- addons/br/nfse/invoices.go | 2 +- addons/br/nfse/invoices_test.go | 6 +++--- data/addons/br-nfse-v1.json | 6 +++--- examples/br/invoice-services.json | 2 +- examples/br/out/invoice-services.json | 4 ++-- 6 files changed, 16 insertions(+), 14 deletions(-) diff --git a/addons/br/nfse/extensions.go b/addons/br/nfse/extensions.go index 07cbf99f..4dbe1faa 100644 --- a/addons/br/nfse/extensions.go +++ b/addons/br/nfse/extensions.go @@ -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" ) @@ -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{ @@ -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: diff --git a/addons/br/nfse/invoices.go b/addons/br/nfse/invoices.go index a106a8cf..04e2ffcf 100644 --- a/addons/br/nfse/invoices.go +++ b/addons/br/nfse/invoices.go @@ -69,7 +69,7 @@ func validateSupplier(value interface{}) error { ), validation.Field(&obj.Ext, tax.ExtensionsRequires( - ExtKeySimplesNacional, + ExtKeySimples, ExtKeyMunicipality, ExtKeyFiscalIncentive, ), diff --git a/addons/br/nfse/invoices_test.go b/addons/br/nfse/invoices_test.go index bf491c06..050e5984 100644 --- a/addons/br/nfse/invoices_test.go +++ b/addons/br/nfse/invoices_test.go @@ -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") } diff --git a/data/addons/br-nfse-v1.json b/data/addons/br-nfse-v1.json index c74084ca..6d9ad191 100644 --- a/data/addons/br-nfse-v1.json +++ b/data/addons/br-nfse-v1.json @@ -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": [ { diff --git a/examples/br/invoice-services.json b/examples/br/invoice-services.json index 9c985ff7..dc49ef87 100644 --- a/examples/br/invoice-services.json +++ b/examples/br/invoice-services.json @@ -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" } }, diff --git a/examples/br/out/invoice-services.json b/examples/br/out/invoice-services.json index d93efb63..f87919ea 100644 --- a/examples/br/out/invoice-services.json +++ b/examples/br/out/invoice-services.json @@ -4,7 +4,7 @@ "uuid": "8a51fd30-2a27-11ee-be56-0242ac120002", "dig": { "alg": "sha256", - "val": "6b9933fc6209359b95583878eb64c358ac1b9028727c3e992ec4e78f7a196687" + "val": "d7ef87ccb18475563f8ce2aa804cd51e46b94c3adc6af2bb0867a72f13ad5ac1" } }, "doc": { @@ -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" } },