ghinfe 0.6.0 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +24 -15
- package/LICENSE +21 -21
- package/README.md +491 -413
- package/docs/developer-guide.html +421 -421
- package/docs/openapi.yaml +428 -428
- package/examples/dce-homologacao.js +141 -0
- package/examples/emitir-nfce.js +51 -51
- package/examples/emitir-nfe.js +83 -83
- package/examples/emitir-nfse.js +46 -46
- package/examples/endpoints-sefaz.js +14 -14
- package/examples/eventos-nfe.js +49 -49
- package/examples/gerar-chave.js +25 -25
- package/examples/gerar-dace.js +59 -0
- package/examples/gerar-danfe.js +75 -75
- package/examples/gerar-dce.js +58 -0
- package/examples/layouts-nfse.js +51 -51
- package/examples/mock-sefaz.js +52 -52
- package/examples/nfse-eventos.js +57 -57
- package/examples/reforma-ibscbs.js +27 -27
- package/examples/reforma-nfe-xml.js +52 -52
- package/examples/status-sefaz.js +12 -12
- package/examples/validar-xsd.js +48 -48
- package/package.json +59 -68
- package/schemas/dce/PL_DCe_100a_NT2024.001/consulta/consSitDCeTiposBasico_v1.00.xsd +123 -0
- package/schemas/dce/PL_DCe_100a_NT2024.001/consulta/consSitDCe_v1.00.xsd +10 -0
- package/schemas/dce/PL_DCe_100a_NT2024.001/consulta/consStatServDCeTiposBasico_v1.00.xsd +110 -0
- package/schemas/dce/PL_DCe_100a_NT2024.001/consulta/consStatServDCe_v1.00.xsd +10 -0
- package/schemas/dce/PL_DCe_100a_NT2024.001/consulta/dceTiposBasico_v1.00.xsd +1388 -0
- package/schemas/dce/PL_DCe_100a_NT2024.001/consulta/retConsSitDCe_v1.00.xsd +10 -0
- package/schemas/dce/PL_DCe_100a_NT2024.001/consulta/retConsStatServDCe_v1.00.xsd +10 -0
- package/schemas/dce/PL_DCe_100a_NT2024.001/consulta/tiposGeralDCe_v1.00.xsd +712 -0
- package/schemas/dce/PL_DCe_100a_NT2024.001/consulta/xmldsig-core-schema_v1.01.xsd +98 -0
- package/schemas/dce/PL_DCe_100a_NT2024.001/dceTiposBasico_v1.00.xsd +1410 -0
- package/schemas/dce/PL_DCe_100a_NT2024.001/dce_v1.00.xsd +10 -0
- package/schemas/dce/PL_DCe_100a_NT2024.001/evento/evCancDCe_v1.00.xsd +36 -0
- package/schemas/dce/PL_DCe_100a_NT2024.001/evento/eventoDCeTiposBasico_v1.00.xsd +283 -0
- package/schemas/dce/PL_DCe_100a_NT2024.001/evento/eventoDCe_v1.00.xsd +9 -0
- package/schemas/dce/PL_DCe_100a_NT2024.001/evento/procEventoDCe_v1.00.xsd +10 -0
- package/schemas/dce/PL_DCe_100a_NT2024.001/evento/retEventoDCe_v1.00.xsd +9 -0
- package/schemas/dce/PL_DCe_100a_NT2024.001/evento/tiposGeralDCe_v1.00.xsd +712 -0
- package/schemas/dce/PL_DCe_100a_NT2024.001/evento/xmldsig-core-schema_v1.01.xsd +98 -0
- package/schemas/dce/PL_DCe_100a_NT2024.001/procDCe_v1.00.xsd +37 -0
- package/schemas/dce/PL_DCe_100a_NT2024.001/retDCe_v1.00.xsd +9 -0
- package/schemas/dce/PL_DCe_100a_NT2024.001/tiposGeralDCe_v1.00.xsd +712 -0
- package/schemas/dce/PL_DCe_100a_NT2024.001/xmldsig-core-schema_v1.01.xsd +98 -0
- package/schemas/nfe/PL_009_V4/enviNFe_v3.10.xsd +8 -8
- package/schemas/nfe/PL_009_V4/xmldsig-core-schema_v1.01.xsd +97 -97
- package/scripts/download-schemas.js +39 -39
- package/scripts/test-xsd.js +34 -34
- package/src/api/server.js +316 -316
- package/src/constants/sefaz.js +69 -69
- package/src/danfe/DanfeService.js +205 -205
- package/src/danfe/xml-extract.js +69 -69
- package/src/dce/builders/DCeEventoXmlBuilder.js +86 -0
- package/src/dce/builders/DCeXmlBuilder.js +345 -0
- package/src/dce/constants/dce.js +87 -0
- package/src/dce/dace/DaceService.js +356 -0
- package/src/dce/dace/dace-extract.js +114 -0
- package/src/dce/services/DCeService.js +263 -0
- package/src/dce/services/DCeSoapService.js +235 -0
- package/src/dce/services/DCeXmlService.js +67 -0
- package/src/dce/types/DCeDocument.js +106 -0
- package/src/dce/utils/qrcode.utils.js +59 -0
- package/src/errors/GhinfeError.js +13 -13
- package/src/errors/SefazError.js +25 -25
- package/src/errors/XsdValidationError.js +15 -15
- package/src/index.js +84 -60
- package/src/nfce/builders/NFCeXmlBuilder.js +178 -178
- package/src/nfce/constants/qrcode.js +26 -26
- package/src/nfce/services/NFCeService.js +188 -188
- package/src/nfce/services/NFCeXmlService.js +38 -38
- package/src/nfce/types/NFCeDocument.js +42 -42
- package/src/nfce/utils/qrcode.utils.js +92 -92
- package/src/nfe/builders/NFeEventoXmlBuilder.js +110 -110
- package/src/nfe/builders/NFeXmlBuilder.js +215 -215
- package/src/nfe/mocks/sefaz-responses.js +195 -195
- package/src/nfe/services/NFeEventoService.js +95 -95
- package/src/nfe/services/NFeService.js +196 -196
- package/src/nfe/services/NFeSignService.js +127 -111
- package/src/nfe/services/NFeSoapService.js +437 -437
- package/src/nfe/services/NFeXmlService.js +41 -41
- package/src/nfe/services/NFeXsdService.js +56 -56
- package/src/nfe/types/NFeDocument.js +92 -92
- package/src/nfe/types/NFeEvento.js +44 -44
- package/src/nfse/NFSeMunicipioResolver.js +42 -42
- package/src/nfse/builders/NFSeEventoXmlBuilder.js +92 -92
- package/src/nfse/builders/NFSeXmlBuilder.js +16 -16
- package/src/nfse/constants/municipios.js +82 -82
- package/src/nfse/layouts/adapters.js +202 -202
- package/src/nfse/mocks/nfse-responses.js +142 -142
- package/src/nfse/services/NFSeService.js +191 -191
- package/src/nfse/services/NFSeSoapService.js +232 -232
- package/src/nfse/services/NFSeXmlService.js +12 -12
- package/src/nfse/types/NFSeDocument.js +54 -54
- package/src/queue/NFCeQueue.js +63 -63
- package/src/queue/NFSeQueue.js +59 -59
- package/src/queue/NFeQueue.js +76 -76
- package/src/reforma/ibscbs.js +175 -175
- package/src/sefaz/SefazEndpointResolver.js +95 -95
- package/src/sefaz/ca/icp-brasil-raiz-v10.pem +38 -0
- package/src/sefaz/endpoints.registry.js +205 -205
- package/src/sefaz/httpsAgent.js +33 -0
- package/src/shared/fiscal.helpers.js +53 -53
- package/src/utils/certificate.utils.js +69 -47
- package/src/utils/chave.utils.js +205 -117
- package/src/utils/code128.utils.js +67 -0
- package/src/utils/date.utils.js +26 -26
- package/src/utils/xml.utils.js +44 -44
- package/src/validation/XsdValidator.js +133 -114
- package/src/validation/schemas.js +18 -14
|
@@ -1,92 +1,92 @@
|
|
|
1
|
-
import { create } from 'xmlbuilder2';
|
|
2
|
-
import { NFSE_NAMESPACE } from '../constants/municipios.js';
|
|
3
|
-
import { GhinfeError } from '../../errors/GhinfeError.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* XML de cancelamento e substituição de NFS-e (padrão ABRASF 2.04).
|
|
7
|
-
*/
|
|
8
|
-
export class NFSeEventoXmlBuilder {
|
|
9
|
-
/**
|
|
10
|
-
* @param {{
|
|
11
|
-
* numeroNfse: string,
|
|
12
|
-
* cnpjPrestador: string,
|
|
13
|
-
* inscricaoMunicipal: string,
|
|
14
|
-
* codigoMunicipio: string,
|
|
15
|
-
* codigoCancelamento?: string,
|
|
16
|
-
* }} dados
|
|
17
|
-
*/
|
|
18
|
-
buildCancelamento(dados) {
|
|
19
|
-
if (!dados.numeroNfse) throw new GhinfeError('numeroNfse é obrigatório', 'NFSE_CANCEL_NUMERO');
|
|
20
|
-
if (!dados.cnpjPrestador) throw new GhinfeError('cnpjPrestador é obrigatório', 'NFSE_CANCEL_CNPJ');
|
|
21
|
-
|
|
22
|
-
const id = `Cancelamento_${dados.numeroNfse}`;
|
|
23
|
-
const doc = create({ version: '1.0', encoding: 'UTF-8' })
|
|
24
|
-
.ele('CancelarNfseEnvio', { xmlns: NFSE_NAMESPACE })
|
|
25
|
-
.ele('Pedido')
|
|
26
|
-
.ele('InfPedidoCancelamento', { Id: id });
|
|
27
|
-
|
|
28
|
-
const inf = doc;
|
|
29
|
-
const ident = inf.ele('IdentificacaoNfse');
|
|
30
|
-
ident.ele('Numero').txt(String(dados.numeroNfse)).up();
|
|
31
|
-
ident.ele('Cnpj').txt(dados.cnpjPrestador.replace(/\D/g, '')).up();
|
|
32
|
-
ident.ele('InscricaoMunicipal').txt(dados.inscricaoMunicipal).up();
|
|
33
|
-
ident.ele('CodigoMunicipio').txt(dados.codigoMunicipio).up();
|
|
34
|
-
ident.up();
|
|
35
|
-
inf.ele('CodigoCancelamento').txt(dados.codigoCancelamento ?? '2').up();
|
|
36
|
-
|
|
37
|
-
return doc.end({ prettyPrint: false, headless: false });
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Substituição = pedido de cancelamento da NFS-e substituída + novo RPS.
|
|
42
|
-
* O XML do novo RPS deve ser passado já montado (GerarNfseEnvio / lote).
|
|
43
|
-
*
|
|
44
|
-
* @param {{
|
|
45
|
-
* numeroNfseSubstituida: string,
|
|
46
|
-
* cnpjPrestador: string,
|
|
47
|
-
* inscricaoMunicipal: string,
|
|
48
|
-
* codigoMunicipio: string,
|
|
49
|
-
* codigoCancelamento?: string,
|
|
50
|
-
* xmlRpsSubstituto: string,
|
|
51
|
-
* }} dados
|
|
52
|
-
*/
|
|
53
|
-
buildSubstituicao(dados) {
|
|
54
|
-
if (!dados.numeroNfseSubstituida) {
|
|
55
|
-
throw new GhinfeError('numeroNfseSubstituida é obrigatório', 'NFSE_SUBST_NUMERO');
|
|
56
|
-
}
|
|
57
|
-
if (!dados.xmlRpsSubstituto) {
|
|
58
|
-
throw new GhinfeError('xmlRpsSubstituto é obrigatório', 'NFSE_SUBST_RPS');
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const cancelamento = this.buildCancelamento({
|
|
62
|
-
numeroNfse: dados.numeroNfseSubstituida,
|
|
63
|
-
cnpjPrestador: dados.cnpjPrestador,
|
|
64
|
-
inscricaoMunicipal: dados.inscricaoMunicipal,
|
|
65
|
-
codigoMunicipio: dados.codigoMunicipio,
|
|
66
|
-
codigoCancelamento: dados.codigoCancelamento ?? '1',
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
// Extrai InfPedidoCancelamento e Rps interno do RPS substituto
|
|
70
|
-
const pedidoMatch = cancelamento.match(/<Pedido>[\s\S]*?<\/Pedido>/);
|
|
71
|
-
const rpsInner = this.#extrairRps(dados.xmlRpsSubstituto);
|
|
72
|
-
|
|
73
|
-
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
74
|
-
<SubstituirNfseEnvio xmlns="${NFSE_NAMESPACE}">
|
|
75
|
-
<SubstituicaoNfse Id="Substituicao_${dados.numeroNfseSubstituida}">
|
|
76
|
-
${pedidoMatch?.[0] ?? ''}
|
|
77
|
-
<Rps>${rpsInner}</Rps>
|
|
78
|
-
</SubstituicaoNfse>
|
|
79
|
-
</SubstituirNfseEnvio>`;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/** @param {string} xmlRps */
|
|
83
|
-
#extrairRps(xmlRps) {
|
|
84
|
-
const inf = xmlRps.match(/<(InfRps|InfDeclaracaoPrestacaoServico)[\s\S]*?<\/\1>/);
|
|
85
|
-
if (inf) return inf[0];
|
|
86
|
-
const rps = xmlRps.match(/<Rps[\s\S]*?<\/Rps>/);
|
|
87
|
-
if (rps) {
|
|
88
|
-
return rps[0].replace(/^<Rps[^>]*>/, '').replace(/<\/Rps>$/, '');
|
|
89
|
-
}
|
|
90
|
-
return xmlRps.replace(/^<\?xml[^?]*\?>/, '').trim();
|
|
91
|
-
}
|
|
92
|
-
}
|
|
1
|
+
import { create } from 'xmlbuilder2';
|
|
2
|
+
import { NFSE_NAMESPACE } from '../constants/municipios.js';
|
|
3
|
+
import { GhinfeError } from '../../errors/GhinfeError.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* XML de cancelamento e substituição de NFS-e (padrão ABRASF 2.04).
|
|
7
|
+
*/
|
|
8
|
+
export class NFSeEventoXmlBuilder {
|
|
9
|
+
/**
|
|
10
|
+
* @param {{
|
|
11
|
+
* numeroNfse: string,
|
|
12
|
+
* cnpjPrestador: string,
|
|
13
|
+
* inscricaoMunicipal: string,
|
|
14
|
+
* codigoMunicipio: string,
|
|
15
|
+
* codigoCancelamento?: string,
|
|
16
|
+
* }} dados
|
|
17
|
+
*/
|
|
18
|
+
buildCancelamento(dados) {
|
|
19
|
+
if (!dados.numeroNfse) throw new GhinfeError('numeroNfse é obrigatório', 'NFSE_CANCEL_NUMERO');
|
|
20
|
+
if (!dados.cnpjPrestador) throw new GhinfeError('cnpjPrestador é obrigatório', 'NFSE_CANCEL_CNPJ');
|
|
21
|
+
|
|
22
|
+
const id = `Cancelamento_${dados.numeroNfse}`;
|
|
23
|
+
const doc = create({ version: '1.0', encoding: 'UTF-8' })
|
|
24
|
+
.ele('CancelarNfseEnvio', { xmlns: NFSE_NAMESPACE })
|
|
25
|
+
.ele('Pedido')
|
|
26
|
+
.ele('InfPedidoCancelamento', { Id: id });
|
|
27
|
+
|
|
28
|
+
const inf = doc;
|
|
29
|
+
const ident = inf.ele('IdentificacaoNfse');
|
|
30
|
+
ident.ele('Numero').txt(String(dados.numeroNfse)).up();
|
|
31
|
+
ident.ele('Cnpj').txt(dados.cnpjPrestador.replace(/\D/g, '')).up();
|
|
32
|
+
ident.ele('InscricaoMunicipal').txt(dados.inscricaoMunicipal).up();
|
|
33
|
+
ident.ele('CodigoMunicipio').txt(dados.codigoMunicipio).up();
|
|
34
|
+
ident.up();
|
|
35
|
+
inf.ele('CodigoCancelamento').txt(dados.codigoCancelamento ?? '2').up();
|
|
36
|
+
|
|
37
|
+
return doc.end({ prettyPrint: false, headless: false });
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Substituição = pedido de cancelamento da NFS-e substituída + novo RPS.
|
|
42
|
+
* O XML do novo RPS deve ser passado já montado (GerarNfseEnvio / lote).
|
|
43
|
+
*
|
|
44
|
+
* @param {{
|
|
45
|
+
* numeroNfseSubstituida: string,
|
|
46
|
+
* cnpjPrestador: string,
|
|
47
|
+
* inscricaoMunicipal: string,
|
|
48
|
+
* codigoMunicipio: string,
|
|
49
|
+
* codigoCancelamento?: string,
|
|
50
|
+
* xmlRpsSubstituto: string,
|
|
51
|
+
* }} dados
|
|
52
|
+
*/
|
|
53
|
+
buildSubstituicao(dados) {
|
|
54
|
+
if (!dados.numeroNfseSubstituida) {
|
|
55
|
+
throw new GhinfeError('numeroNfseSubstituida é obrigatório', 'NFSE_SUBST_NUMERO');
|
|
56
|
+
}
|
|
57
|
+
if (!dados.xmlRpsSubstituto) {
|
|
58
|
+
throw new GhinfeError('xmlRpsSubstituto é obrigatório', 'NFSE_SUBST_RPS');
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const cancelamento = this.buildCancelamento({
|
|
62
|
+
numeroNfse: dados.numeroNfseSubstituida,
|
|
63
|
+
cnpjPrestador: dados.cnpjPrestador,
|
|
64
|
+
inscricaoMunicipal: dados.inscricaoMunicipal,
|
|
65
|
+
codigoMunicipio: dados.codigoMunicipio,
|
|
66
|
+
codigoCancelamento: dados.codigoCancelamento ?? '1',
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
// Extrai InfPedidoCancelamento e Rps interno do RPS substituto
|
|
70
|
+
const pedidoMatch = cancelamento.match(/<Pedido>[\s\S]*?<\/Pedido>/);
|
|
71
|
+
const rpsInner = this.#extrairRps(dados.xmlRpsSubstituto);
|
|
72
|
+
|
|
73
|
+
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
74
|
+
<SubstituirNfseEnvio xmlns="${NFSE_NAMESPACE}">
|
|
75
|
+
<SubstituicaoNfse Id="Substituicao_${dados.numeroNfseSubstituida}">
|
|
76
|
+
${pedidoMatch?.[0] ?? ''}
|
|
77
|
+
<Rps>${rpsInner}</Rps>
|
|
78
|
+
</SubstituicaoNfse>
|
|
79
|
+
</SubstituirNfseEnvio>`;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** @param {string} xmlRps */
|
|
83
|
+
#extrairRps(xmlRps) {
|
|
84
|
+
const inf = xmlRps.match(/<(InfRps|InfDeclaracaoPrestacaoServico)[\s\S]*?<\/\1>/);
|
|
85
|
+
if (inf) return inf[0];
|
|
86
|
+
const rps = xmlRps.match(/<Rps[\s\S]*?<\/Rps>/);
|
|
87
|
+
if (rps) {
|
|
88
|
+
return rps[0].replace(/^<Rps[^>]*>/, '').replace(/<\/Rps>$/, '');
|
|
89
|
+
}
|
|
90
|
+
return xmlRps.replace(/^<\?xml[^?]*\?>/, '').trim();
|
|
91
|
+
}
|
|
92
|
+
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { obterAdapter } from '../layouts/adapters.js';
|
|
2
|
-
import { NFSE_LAYOUTS } from '../constants/municipios.js';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Gera XML RPS conforme layout municipal (ABRASF, GINFES, Betha, ISSNet).
|
|
6
|
-
*/
|
|
7
|
-
export class NFSeXmlBuilder {
|
|
8
|
-
/**
|
|
9
|
-
* @param {import('../types/NFSeDocument.js').NFSeDocumento} documento
|
|
10
|
-
* @param {string} [layout] abrasf | ginfes | betha | issnet
|
|
11
|
-
* @returns {string}
|
|
12
|
-
*/
|
|
13
|
-
buildGerarNfse(documento, layout = NFSE_LAYOUTS.ABRASF) {
|
|
14
|
-
return obterAdapter(layout).build(documento);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
1
|
+
import { obterAdapter } from '../layouts/adapters.js';
|
|
2
|
+
import { NFSE_LAYOUTS } from '../constants/municipios.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Gera XML RPS conforme layout municipal (ABRASF, GINFES, Betha, ISSNet).
|
|
6
|
+
*/
|
|
7
|
+
export class NFSeXmlBuilder {
|
|
8
|
+
/**
|
|
9
|
+
* @param {import('../types/NFSeDocument.js').NFSeDocumento} documento
|
|
10
|
+
* @param {string} [layout] abrasf | ginfes | betha | issnet
|
|
11
|
+
* @returns {string}
|
|
12
|
+
*/
|
|
13
|
+
buildGerarNfse(documento, layout = NFSE_LAYOUTS.ABRASF) {
|
|
14
|
+
return obterAdapter(layout).build(documento);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -1,82 +1,82 @@
|
|
|
1
|
-
/** Layouts NFS-e suportados pela biblioteca. */
|
|
2
|
-
export const NFSE_LAYOUTS = {
|
|
3
|
-
ABRASF: 'abrasf',
|
|
4
|
-
GINFES: 'ginfes',
|
|
5
|
-
BETHA: 'betha',
|
|
6
|
-
ISSNET: 'issnet',
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
/** Layout ABRASF 2.04 — padrão mais adotado pelos municípios. */
|
|
10
|
-
export const NFSE_LAYOUT = '2.04';
|
|
11
|
-
export const NFSE_NAMESPACE = 'http://www.abrasf.org.br/nfse.xsd';
|
|
12
|
-
export const GINFES_NAMESPACE = 'http://www.ginfes.com.br/servico_enviar_lote_rps_envio';
|
|
13
|
-
export const BETHA_NAMESPACE = 'http://www.betha.com.br/e-nota-contribuinte-ws';
|
|
14
|
-
export const ISSNET_NAMESPACE = 'http://www.issnetonline.com.br/webserviceabrasf/vsd/servico_enviar_lote_rps_envio.xsd';
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Endpoints NFS-e por município (IBGE).
|
|
18
|
-
* layout: abrasf | ginfes | betha | issnet
|
|
19
|
-
* URLs são exemplos — valide com a prefeitura / provedor.
|
|
20
|
-
*/
|
|
21
|
-
export const NFSE_MUNICIPIOS = {
|
|
22
|
-
'3550308': {
|
|
23
|
-
nome: 'São Paulo/SP',
|
|
24
|
-
layout: NFSE_LAYOUTS.ABRASF,
|
|
25
|
-
homologacao: 'https://nfe.prefeitura.sp.gov.br/ws/lotenfe.asmx',
|
|
26
|
-
producao: 'https://nfe.prefeitura.sp.gov.br/ws/lotenfe.asmx',
|
|
27
|
-
},
|
|
28
|
-
'3304557': {
|
|
29
|
-
nome: 'Rio de Janeiro/RJ',
|
|
30
|
-
layout: NFSE_LAYOUTS.ABRASF,
|
|
31
|
-
homologacao: 'https://notacarioca.rio.gov.br/WSNacional/nfse.asmx',
|
|
32
|
-
producao: 'https://notacarioca.rio.gov.br/WSNacional/nfse.asmx',
|
|
33
|
-
},
|
|
34
|
-
'3106200': {
|
|
35
|
-
nome: 'Belo Horizonte/MG',
|
|
36
|
-
layout: NFSE_LAYOUTS.ABRASF,
|
|
37
|
-
homologacao: 'https://bhissdigital.pbh.gov.br/bhiss-ws/nfse',
|
|
38
|
-
producao: 'https://bhissdigital.pbh.gov.br/bhiss-ws/nfse',
|
|
39
|
-
},
|
|
40
|
-
'4106902': {
|
|
41
|
-
nome: 'Curitiba/PR',
|
|
42
|
-
layout: NFSE_LAYOUTS.ABRASF,
|
|
43
|
-
homologacao: 'https://isscuritiba.curitiba.pr.gov.br/Iss.NfseWebService/NfseService.svc',
|
|
44
|
-
producao: 'https://isscuritiba.curitiba.pr.gov.br/Iss.NfseWebService/NfseService.svc',
|
|
45
|
-
},
|
|
46
|
-
'4314902': {
|
|
47
|
-
nome: 'Porto Alegre/RS',
|
|
48
|
-
layout: NFSE_LAYOUTS.BETHA,
|
|
49
|
-
homologacao: 'https://e-gov.betha.com.br/e-nota-contribuinte-ws/nfseWS',
|
|
50
|
-
producao: 'https://e-gov.betha.com.br/e-nota-contribuinte-ws/nfseWS',
|
|
51
|
-
},
|
|
52
|
-
'4205407': {
|
|
53
|
-
nome: 'Florianópolis/SC',
|
|
54
|
-
layout: NFSE_LAYOUTS.BETHA,
|
|
55
|
-
homologacao: 'https://e-gov.betha.com.br/e-nota-contribuinte-test-ws/nfseWS',
|
|
56
|
-
producao: 'https://e-gov.betha.com.br/e-nota-contribuinte-ws/nfseWS',
|
|
57
|
-
},
|
|
58
|
-
'2927408': {
|
|
59
|
-
nome: 'Salvador/BA',
|
|
60
|
-
layout: NFSE_LAYOUTS.GINFES,
|
|
61
|
-
homologacao: 'https://homologacao.ginfes.com.br/ServiceGinfesImpl',
|
|
62
|
-
producao: 'https://producao.ginfes.com.br/ServiceGinfesImpl',
|
|
63
|
-
},
|
|
64
|
-
'2611606': {
|
|
65
|
-
nome: 'Recife/PE',
|
|
66
|
-
layout: NFSE_LAYOUTS.ISSNET,
|
|
67
|
-
homologacao: 'https://www.issnetonline.com.br/webserviceabrasf/homologacao/servicos.asmx',
|
|
68
|
-
producao: 'https://www.issnetonline.com.br/webserviceabrasf/producao/servicos.asmx',
|
|
69
|
-
},
|
|
70
|
-
'2304400': {
|
|
71
|
-
nome: 'Fortaleza/CE',
|
|
72
|
-
layout: NFSE_LAYOUTS.ISSNET,
|
|
73
|
-
homologacao: 'https://iss.fortaleza.ce.gov.br/group/guest/nfe',
|
|
74
|
-
producao: 'https://iss.fortaleza.ce.gov.br/group/guest/nfe',
|
|
75
|
-
},
|
|
76
|
-
mock: {
|
|
77
|
-
nome: 'Mock GHINFE',
|
|
78
|
-
layout: NFSE_LAYOUTS.ABRASF,
|
|
79
|
-
homologacao: 'http://localhost/mock/nfse',
|
|
80
|
-
producao: 'http://localhost/mock/nfse',
|
|
81
|
-
},
|
|
82
|
-
};
|
|
1
|
+
/** Layouts NFS-e suportados pela biblioteca. */
|
|
2
|
+
export const NFSE_LAYOUTS = {
|
|
3
|
+
ABRASF: 'abrasf',
|
|
4
|
+
GINFES: 'ginfes',
|
|
5
|
+
BETHA: 'betha',
|
|
6
|
+
ISSNET: 'issnet',
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
/** Layout ABRASF 2.04 — padrão mais adotado pelos municípios. */
|
|
10
|
+
export const NFSE_LAYOUT = '2.04';
|
|
11
|
+
export const NFSE_NAMESPACE = 'http://www.abrasf.org.br/nfse.xsd';
|
|
12
|
+
export const GINFES_NAMESPACE = 'http://www.ginfes.com.br/servico_enviar_lote_rps_envio';
|
|
13
|
+
export const BETHA_NAMESPACE = 'http://www.betha.com.br/e-nota-contribuinte-ws';
|
|
14
|
+
export const ISSNET_NAMESPACE = 'http://www.issnetonline.com.br/webserviceabrasf/vsd/servico_enviar_lote_rps_envio.xsd';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Endpoints NFS-e por município (IBGE).
|
|
18
|
+
* layout: abrasf | ginfes | betha | issnet
|
|
19
|
+
* URLs são exemplos — valide com a prefeitura / provedor.
|
|
20
|
+
*/
|
|
21
|
+
export const NFSE_MUNICIPIOS = {
|
|
22
|
+
'3550308': {
|
|
23
|
+
nome: 'São Paulo/SP',
|
|
24
|
+
layout: NFSE_LAYOUTS.ABRASF,
|
|
25
|
+
homologacao: 'https://nfe.prefeitura.sp.gov.br/ws/lotenfe.asmx',
|
|
26
|
+
producao: 'https://nfe.prefeitura.sp.gov.br/ws/lotenfe.asmx',
|
|
27
|
+
},
|
|
28
|
+
'3304557': {
|
|
29
|
+
nome: 'Rio de Janeiro/RJ',
|
|
30
|
+
layout: NFSE_LAYOUTS.ABRASF,
|
|
31
|
+
homologacao: 'https://notacarioca.rio.gov.br/WSNacional/nfse.asmx',
|
|
32
|
+
producao: 'https://notacarioca.rio.gov.br/WSNacional/nfse.asmx',
|
|
33
|
+
},
|
|
34
|
+
'3106200': {
|
|
35
|
+
nome: 'Belo Horizonte/MG',
|
|
36
|
+
layout: NFSE_LAYOUTS.ABRASF,
|
|
37
|
+
homologacao: 'https://bhissdigital.pbh.gov.br/bhiss-ws/nfse',
|
|
38
|
+
producao: 'https://bhissdigital.pbh.gov.br/bhiss-ws/nfse',
|
|
39
|
+
},
|
|
40
|
+
'4106902': {
|
|
41
|
+
nome: 'Curitiba/PR',
|
|
42
|
+
layout: NFSE_LAYOUTS.ABRASF,
|
|
43
|
+
homologacao: 'https://isscuritiba.curitiba.pr.gov.br/Iss.NfseWebService/NfseService.svc',
|
|
44
|
+
producao: 'https://isscuritiba.curitiba.pr.gov.br/Iss.NfseWebService/NfseService.svc',
|
|
45
|
+
},
|
|
46
|
+
'4314902': {
|
|
47
|
+
nome: 'Porto Alegre/RS',
|
|
48
|
+
layout: NFSE_LAYOUTS.BETHA,
|
|
49
|
+
homologacao: 'https://e-gov.betha.com.br/e-nota-contribuinte-ws/nfseWS',
|
|
50
|
+
producao: 'https://e-gov.betha.com.br/e-nota-contribuinte-ws/nfseWS',
|
|
51
|
+
},
|
|
52
|
+
'4205407': {
|
|
53
|
+
nome: 'Florianópolis/SC',
|
|
54
|
+
layout: NFSE_LAYOUTS.BETHA,
|
|
55
|
+
homologacao: 'https://e-gov.betha.com.br/e-nota-contribuinte-test-ws/nfseWS',
|
|
56
|
+
producao: 'https://e-gov.betha.com.br/e-nota-contribuinte-ws/nfseWS',
|
|
57
|
+
},
|
|
58
|
+
'2927408': {
|
|
59
|
+
nome: 'Salvador/BA',
|
|
60
|
+
layout: NFSE_LAYOUTS.GINFES,
|
|
61
|
+
homologacao: 'https://homologacao.ginfes.com.br/ServiceGinfesImpl',
|
|
62
|
+
producao: 'https://producao.ginfes.com.br/ServiceGinfesImpl',
|
|
63
|
+
},
|
|
64
|
+
'2611606': {
|
|
65
|
+
nome: 'Recife/PE',
|
|
66
|
+
layout: NFSE_LAYOUTS.ISSNET,
|
|
67
|
+
homologacao: 'https://www.issnetonline.com.br/webserviceabrasf/homologacao/servicos.asmx',
|
|
68
|
+
producao: 'https://www.issnetonline.com.br/webserviceabrasf/producao/servicos.asmx',
|
|
69
|
+
},
|
|
70
|
+
'2304400': {
|
|
71
|
+
nome: 'Fortaleza/CE',
|
|
72
|
+
layout: NFSE_LAYOUTS.ISSNET,
|
|
73
|
+
homologacao: 'https://iss.fortaleza.ce.gov.br/group/guest/nfe',
|
|
74
|
+
producao: 'https://iss.fortaleza.ce.gov.br/group/guest/nfe',
|
|
75
|
+
},
|
|
76
|
+
mock: {
|
|
77
|
+
nome: 'Mock GHINFE',
|
|
78
|
+
layout: NFSE_LAYOUTS.ABRASF,
|
|
79
|
+
homologacao: 'http://localhost/mock/nfse',
|
|
80
|
+
producao: 'http://localhost/mock/nfse',
|
|
81
|
+
},
|
|
82
|
+
};
|