@alexssmusica/emissao-nota-fiscal
Version:
Modulo que auxilia na geração de NFe e NFCe
214 lines (213 loc) • 12.5 kB
JavaScript
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.SefazNFCe = void 0;
const soap_info_1 = require("../../application/abstract/soap-info");
const autorizadores_json_1 = __importDefault(require("../../application/helpers/urls/autorizadores.json"));
class SefazNFCe extends soap_info_1.SoapAbstract {
static getAutorizadorByUF(uf) {
switch (uf) {
case 'AM':
return autorizadores_json_1.default.AM;
case 'CE':
return autorizadores_json_1.default.CE;
case 'GO':
return autorizadores_json_1.default.GO;
case 'MT':
return autorizadores_json_1.default.MT;
case 'MS':
return autorizadores_json_1.default.MS;
case 'MG':
return autorizadores_json_1.default.MG;
case 'PR':
return autorizadores_json_1.default.PR;
case 'RS':
return autorizadores_json_1.default.RS;
case 'SP':
return autorizadores_json_1.default.SP;
case 'AC':
case 'AL':
case 'AP':
case 'BA':
case 'DF':
case 'ES':
case 'MA':
case 'PA':
case 'PB':
case 'PE':
case 'PI':
case 'RJ':
case 'RN':
case 'RO':
case 'RR':
case 'SE':
case 'TO':
return autorizadores_json_1.default.SVRS;
default:
throw new Error('Autorizador não encontrado!');
}
}
static getInfoQRCodeByUF({ uf, amb }) {
if (amb === '1') {
switch (uf) {
case 'AC':
return { urlChave: 'www.sefaznet.ac.gov.br/nfce/consulta', urlQRCode: 'http://www.sefaznet.ac.gov.br/nfce/qrcode' };
case 'AL':
return { urlChave: 'www.sefaz.al.gov.br/nfce/consulta', urlQRCode: 'http://nfce.sefaz.al.gov.br/QRCode/consultarNFCe.jsp' };
case 'AP':
return { urlChave: 'www.sefaz.ap.gov.br/nfce/consulta', urlQRCode: 'https://www.sefaz.ap.gov.br/nfce/nfcep.php' };
case 'AM':
return { urlChave: 'www.sefaz.am.gov.br/nfce/consulta', urlQRCode: 'http://sistemas.sefaz.am.gov.br/nfceweb/consultarNFCe.jsp' };
case 'BA':
return {
urlChave: 'www.sefaz.ba.gov.br/nfce/consulta',
urlQRCode: 'http://nfe.sefaz.ba.gov.br/servicos/nfce/modulos/geral/NFCEC_consulta_chave_acesso.aspx'
};
case 'CE':
return { urlChave: 'www.sefaz.ce.gov.br/nfce/consulta', urlQRCode: 'http://nfce.sefaz.ce.gov.br/pages/ShowNFCe.html' };
case 'DF':
return { urlChave: 'www.fazenda.df.gov.br/nfce/consulta', urlQRCode: 'http://dec.fazenda.df.gov.br/ConsultarNFCe.aspx' };
case 'ES':
return { urlChave: 'www.sefaz.es.gov.br/nfce/consulta', urlQRCode: 'http://app.sefaz.es.gov.br/ConsultaNFCe/qrcode.aspx' };
case 'GO':
return { urlChave: 'www.sefaz.go.gov.br/nfce/consulta', urlQRCode: 'http://nfe.sefaz.go.gov.br/nfeweb/sites/nfce/danfeNFCe' };
case 'MA':
return { urlChave: 'www.sefaz.ma.gov.br/nfce/consulta', urlQRCode: 'http://www.nfce.sefaz.ma.gov.br/portal/consultarNFCe.jsp' };
case 'MG':
return {
urlChave: 'http://nfce.fazenda.mg.gov.br/portalnfce',
urlQRCode: 'https://nfce.fazenda.mg.gov.br/portalnfce/sistema/qrcode.xhtml'
};
case 'MS':
return { urlChave: 'http://www.dfe.ms.gov.br/nfce/consulta', urlQRCode: 'http://www.dfe.ms.gov.br/nfce/qrcode' };
case 'MT':
return { urlChave: 'http://www.sefaz.mt.gov.br/nfce/consultanfce', urlQRCode: 'http://www.sefaz.mt.gov.br/nfce/consultanfce' };
case 'PA':
return {
urlChave: 'www.sefa.pa.gov.br/nfce/consulta',
urlQRCode: 'https://appnfc.sefa.pa.gov.br/portal/view/consultas/nfce/nfceForm.seam'
};
case 'PB':
return { urlChave: 'www.receita.pb.gov.br/nfce/consulta', urlQRCode: 'http://www.receita.pb.gov.br/nfce' };
case 'PE':
return { urlChave: 'nfce.sefaz.pe.gov.br/nfce/consulta', urlQRCode: 'http://nfce.sefaz.pe.gov.br/nfce-web/consultarNFCe' };
case 'PI':
return { urlChave: 'www.sefaz.pi.gov.br/nfce/consulta', urlQRCode: 'http://www.sefaz.pi.gov.br/nfce/qrcode' };
case 'PR':
return { urlChave: 'http://www.fazenda.pr.gov.br/nfce/consulta', urlQRCode: 'http://www.fazenda.pr.gov.br/nfce/qrcode/' };
case 'RJ':
return { urlChave: 'www.fazenda.rj.gov.br/nfce/consulta', urlQRCode: 'http://www4.fazenda.rj.gov.br/consultaNFCe/QRCode' };
case 'RN':
return { urlChave: 'www.set.rn.gov.br/nfce/consulta', urlQRCode: 'http://nfce.set.rn.gov.br/consultarNFCe.aspx' };
case 'RO':
return { urlChave: 'www.sefin.ro.gov.br/nfce/consulta', urlQRCode: 'http://www.nfce.sefin.ro.gov.br/consultanfce/consulta.jsp' };
case 'RS':
return { urlChave: 'www.sefaz.rs.gov.br/nfce/consulta', urlQRCode: 'https://www.sefaz.rs.gov.br/NFCE/NFCE-COM.aspx' };
case 'RR':
return { urlChave: 'www.sefaz.rr.gov.br/nfce/consulta', urlQRCode: 'https://www.sefaz.rr.gov.br/nfce/servlet/qrcode' };
case 'SE':
return { urlChave: 'http://www.nfce.se.gov.br/nfce/consulta', urlQRCode: 'http://www.nfce.se.gov.br/portal/consultarNFCe.jsp' };
case 'SP':
return { urlChave: 'https://www.nfce.fazenda.sp.gov.br/consulta', urlQRCode: 'https://www.nfce.fazenda.sp.gov.br/qrcode' };
case 'TO':
return { urlChave: 'www.sefaz.to.gov.br/nfce/consulta', urlQRCode: 'http://www.sefaz.to.gov.br/nfce/qrcode' };
default:
throw new Error('URL do QRCode não encontrada pelo UF (' + uf + ') informado.');
}
}
else {
switch (uf) {
case 'AC':
return { urlChave: 'www.sefaznet.ac.gov.br/nfce/consulta', urlQRCode: 'http://hml.sefaznet.ac.gov.br/nfce/qrcode' };
case 'AL':
return { urlChave: 'www.sefaz.al.gov.br/nfce/consulta', urlQRCode: 'http://nfce.sefaz.al.gov.br/QRCode/consultarNFCe.jsp' };
case 'AP':
return { urlChave: 'www.sefaz.ap.gov.br/nfce/consulta', urlQRCode: 'https://www.sefaz.ap.gov.br/nfcehml/nfce.php' };
case 'AM':
return {
urlChave: 'https://sistemas.sefaz.am.gov.br/nfceweb-hom/formConsulta.do',
urlQRCode: 'https://sistemas.sefaz.am.gov.br/nfceweb-hom/consultarNFCe.jsp'
};
case 'BA':
return {
urlChave: 'http://hinternet.sefaz.ba.gov.br/nfce/consulta',
urlQRCode: 'http://hnfe.sefaz.ba.gov.br/servicos/nfce/modulos/geral/NFCEC_consulta_chave_acesso.aspx'
};
case 'CE':
return { urlChave: 'www.sefaz.ce.gov.br/nfce/consulta', urlQRCode: 'http://nfceh.sefaz.ce.gov.br/pages/ShowNFCe.html' };
case 'DF':
return { urlChave: 'www.fazenda.df.gov.br/nfce/consulta', urlQRCode: 'http://dec.fazenda.df.gov.br/ConsultarNFCe.aspx' };
case 'ES':
return {
urlChave: 'www.sefaz.es.gov.br/nfce/consulta',
urlQRCode: 'http://homologacao.sefaz.es.gov.br/ConsultaNFCe/qrcode.aspx'
};
case 'GO':
return {
urlChave: 'http://www.nfce.go.gov.br/post/ver/214413/consulta-nfc-e-homologacao',
urlQRCode: 'http://homolog.sefaz.go.gov.br/nfeweb/sites/nfce/danfeNFCe'
};
case 'MA':
return {
urlChave: 'www.sefaz.ma.gov.br/nfce/consulta',
urlQRCode: 'http://www.hom.nfce.sefaz.ma.gov.br/portal/consultarNFCe.jsp'
};
case 'MG':
return {
urlChave: 'http://hnfce.fazenda.mg.gov.br/portalnfce',
urlQRCode: 'https://nfce.fazenda.mg.gov.br/portalnfce/sistema/qrcode.xhtml'
};
case 'MS':
return { urlChave: 'http://www.dfe.ms.gov.br/nfce/consulta', urlQRCode: 'http://www.dfe.ms.gov.br/nfce/qrcode' };
case 'MT':
return {
urlChave: 'http://homologacao.sefaz.mt.gov.br/nfce/consultanfce',
urlQRCode: 'http://homologacao.sefaz.mt.gov.br/nfce/consultanfce'
};
case 'PA':
return {
urlChave: 'www.sefa.pa.gov.br/nfce/consulta',
urlQRCode: 'https://appnfc.sefa.pa.gov.br/portal-homologacao/view/consultas/nfce/nfceForm.seam'
};
case 'PB':
return { urlChave: 'www.receita.pb.gov.br/nfcehom', urlQRCode: 'http://www.receita.pb.gov.br/nfcehom' };
case 'PE':
return { urlChave: 'nfce.sefaz.pe.gov.br/nfce/consulta', urlQRCode: 'http://nfcehomolog.sefaz.pe.gov.br/nfce-web/consultarNFCe' };
case 'PI':
return { urlChave: 'www.sefaz.pi.gov.br/nfce/consulta', urlQRCode: 'http://www.sefaz.pi.gov.br/nfce/qrcode' };
case 'PR':
return { urlChave: 'http://www.fazenda.pr.gov.br/nfce/consulta', urlQRCode: 'http://www.fazenda.pr.gov.br/nfce/qrcode/' };
case 'RJ':
return { urlChave: 'www.fazenda.rj.gov.br/nfce/consulta', urlQRCode: 'http://www4.fazenda.rj.gov.br/consultaNFCe/QRCode' };
case 'RN':
return { urlChave: 'www.set.rn.gov.br/nfce/consulta', urlQRCode: 'http://hom.nfce.set.rn.gov.br/consultarNFCe.aspx' };
case 'RO':
return { urlChave: 'www.sefin.ro.gov.br/nfce/consulta', urlQRCode: 'http://www.nfce.sefin.ro.gov.br/consultanfce/consulta.jsp' };
case 'RS':
return { urlChave: 'www.sefaz.rs.gov.br/nfce/consulta', urlQRCode: 'https://www.sefaz.rs.gov.br/NFCE/NFCE-COM.aspx' };
case 'RR':
return { urlChave: 'www.sefaz.rr.gov.br/nfce/consulta', urlQRCode: 'http://200.174.88.103:8080/nfce/servlet/qrcode' };
case 'SE':
return {
urlChave: 'http://www.hom.nfe.se.gov.br/nfce/consulta',
urlQRCode: 'http://www.hom.nfe.se.gov.br/portal/consultarNFCe.jsp'
};
case 'SP':
return {
urlChave: 'https://www.homologacao.nfce.fazenda.sp.gov.br/consulta',
urlQRCode: 'https://www.homologacao.nfce.fazenda.sp.gov.br/qrcode'
};
case 'TO':
return {
urlChave: 'http://homologacao.sefaz.to.gov.br/nfce/consulta.jsf',
urlQRCode: 'http://homologacao.sefaz.to.gov.br/nfce/qrcode'
};
default:
throw new Error('URL do QRCode não encontrada pelo UF (' + uf + ') informado.');
}
}
}
}
exports.SefazNFCe = SefazNFCe;