Skip to content
This repository was archived by the owner on Apr 23, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions autorizadores.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@
"inutilizacao": {
"url_producao": "https://nfe.sefa.pr.gov.br/nfe/NFeInutilizacao4",
"url_homologacao": "https://homologacao.nfce.sefa.pr.gov.br/nfce/Nfeinutilizacao4.asmx"
},
"recepcaoEvento": {
"url_producao": "https://nfce.sefa.pr.gov.br/nfce/NFeRecepcaoEvento4",
"url_homologacao": "https://homologacao.nfce.sefa.pr.gov.br/nfce/NFeRecepcaoEvento4"
}
}
},
Expand Down
4 changes: 4 additions & 0 deletions autorizadoresNFe.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@
"consultarStatusServico": {
"url_producao": "https://nfe.sefa.pr.gov.br/nfe/NFeStatusServico4?wsdl",
"url_homologacao": "https://homologacao.nfe.sefa.pr.gov.br/nfe/NFeStatusServico4?wsdl"
},
"recepcaoEvento": {
"url_producao": "https://nfe.sefa.pr.gov.br/nfe/NFeRecepcaoEvento4",
"url_homologacao": "https://homologacao.nfe.sefa.pr.gov.br/nfe/NFeRecepcaoEvento4"
}
}
},
Expand Down
18 changes: 17 additions & 1 deletion lib/factory/interface/nfe/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ export interface RetornoProcessamento {
xml_recebido: string;
status: number;
success: boolean;
data: Object;
data: {
retEnviNFe?: Object;
};
error: string;
}
export interface NFeBase {
Expand Down Expand Up @@ -66,12 +68,17 @@ export interface DocumentoFiscal {
justificativaContingencia: string;
isContingenciaOffline: boolean;
indIntermed?: string;
NFref?: {
refNFe?: string;
}[];
}
export interface Produto {
prod: DetalhesProduto;
imposto: Imposto;
infoAdicional: string;
numeroItem: string;
pis: Object | undefined;
cofins: Object | undefined;
}
export interface DetalhesProduto {
codigo: string;
Expand Down Expand Up @@ -116,6 +123,7 @@ export interface Imposto {
pisst: PisST;
cofinsst: CofinsST;
icmsUfDest: IcmsUfDest;
IBSCBS: any;
}
export interface Icms {
orig: string;
Expand Down Expand Up @@ -238,10 +246,16 @@ export interface Issqn {
nProcesso: string;
indIncentivo: string;
}
export interface IbsCbsTot {
vIBS: string;
vCBS: string;
vIS: string;
}
export interface Total {
icmsTot: IcmsTot;
issqnTot: IssqnTot;
retTrib: RetTrib;
IBSCBSTot?: IbsCbsTot;
}
export interface IcmsTot {
vBC: string;
Expand Down Expand Up @@ -293,6 +307,8 @@ export interface RetTrib {
}
export interface Transporte {
modalidateFrete: string;
transporta: Object;
vol: Object;
}
export interface Cobranca {
fatura: Fatura;
Expand Down
40 changes: 20 additions & 20 deletions lib/factory/processor/enviaProcessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,9 @@ class EnviaProcessor {
}
configuraUrlsSefaz() {
const { geral: { modelo, ambiente }, empresa } = this.configuracoes;
if (!soapAutorizacao || !soapRetAutorizacao) {
let Sefaz = modelo == '65' ? sefazNfce_1.SefazNFCe : sefazNfe_1.SefazNFe;
soapAutorizacao = Sefaz.getSoapInfo(empresa.endereco.uf, ambiente, nfe_1.ServicosSefaz.autorizacao);
soapRetAutorizacao = Sefaz.getSoapInfo(empresa.endereco.uf, ambiente, nfe_1.ServicosSefaz.retAutorizacao);
}
let Sefaz = modelo == '65' ? sefazNfce_1.SefazNFCe : sefazNfe_1.SefazNFe;
soapAutorizacao = Sefaz.getSoapInfo(empresa.endereco.uf, ambiente, nfe_1.ServicosSefaz.autorizacao);
soapRetAutorizacao = Sefaz.getSoapInfo(empresa.endereco.uf, ambiente, nfe_1.ServicosSefaz.retAutorizacao);
}
appendQRCodeXML(documento, xmlAssinado) {
let qrCode = null;
Expand Down Expand Up @@ -137,7 +135,7 @@ class EnviaProcessor {
log(jsonOneLevel(retornoEnvio), 'retornoEnvio.full');
}
catch (e) {
log(`ja deu erro pra logar.......${e.toString()}`, 'retornoEnvio');
log(`ja deu erro pra logar.......${e === null || e === void 0 ? void 0 : e.toString()}`, 'retornoEnvio');
}
if (retornoEnvio && retornoEnvio.data) {
const data = Object(retornoEnvio.data);
Expand Down Expand Up @@ -319,6 +317,7 @@ class EnviaProcessor {
dhSaiEnt: documento.dhSaiEnt,
dhCont: documento.dhContingencia,
xJust: documento.justificativaContingencia,
NFref: documento.NFref,
};
if (documento.indIntermed) {
ide.indIntermed = Utils.getEnumByValue(schema.TNFeInfNFeIdeIndIntermed, documento.indIntermed); // NT 2020.006
Expand Down Expand Up @@ -394,7 +393,7 @@ class EnviaProcessor {
prod: this.getDetProd(produtos[i].prod, ambiente, i == 0),
imposto: this.getDetImposto(produtos[i].imposto, modelo, produtos[i].prod.CFOP),
infAdProd: produtos[i].infoAdicional,
impostoDevol: (produtos[i].prod.percentualDevolucao && (produtos[i].prod.percentualDevolucao > 0)) ? this.getImpostoDevolucao({ pDevol: produtos[i].prod.percentualDevolucao, vIPIDevol: produtos[i].prod.valorIPIDevolucao }) : undefined
impostoDevol: (produtos[i].prod.percentualDevolucao && (produtos[i].prod.percentualDevolucao > 0)) ? this.getImpostoDevolucao({ pDevol: produtos[i].prod.percentualDevolucao, vIPIDevol: produtos[i].prod.valorIPIDevolucao }) : undefined,
});
}
return det_list;
Expand Down Expand Up @@ -443,6 +442,7 @@ class EnviaProcessor {
II: imposto.ii ? [this.getImpostoII(imposto.ii, cfop)] : [],
ICMSUFDest: imposto.icmsUfDest ? [this.getIcmsUfDest(imposto.icmsUfDest)] : [],
ISSQN: '',
IBSCBS: imposto.IBSCBS
};
return detImposto;
}
Expand Down Expand Up @@ -929,6 +929,7 @@ class EnviaProcessor {
CST: pis.CST
}
};
break;
case '49':
case '50':
case '51':
Expand Down Expand Up @@ -965,6 +966,7 @@ class EnviaProcessor {
vPIS: pis.vPIS
}
};
break;
default:
result = {
PISOutr: {
Expand Down Expand Up @@ -1158,27 +1160,25 @@ class EnviaProcessor {
};
}
getTotal(total) {
return {
ICMSTot: total.icmsTot
};
return Object.assign({ ICMSTot: total.icmsTot }, (total.IBSCBSTot ? { IBSCBSTot: total.IBSCBSTot } : {}));
}
getIcmsTot(icmsTot) {
return icmsTot;
}
getTransp(transp) {
return {
modFrete: transp.modalidateFrete
modFrete: transp.modalidateFrete,
transporta: transp.transporta,
/**
* transporta: TNFeInfNFeTranspTransporta;
retTransp: TNFeInfNFeTranspRetTransp;
//balsa
//reboque
//vagao
//veicTransp
* retTransp: TNFeInfNFeTranspRetTransp;
balsa
reboque
vagao
veicTransp
items: object[];
itemsElementName: ItemsChoiceType5[];
vol: TNFeInfNFeTranspVol[];
*/
*/
vol: transp.vol,
};
}
getCobr(cobranca) {
Expand Down Expand Up @@ -1221,13 +1221,13 @@ class EnviaProcessor {
detPag = {};
detPag.indPag = Utils.getEnumByValue(schema.TNFeInfNFePagDetPagIndPag, pag.indicadorFormaPagamento);
detPag.tPag = Utils.getEnumByValue(schema.TNFeInfNFePagDetPagTPag, pag.formaPagamento);
detPag.vPag = pag.valor;
if (pag.descricaoFormaPagamento) {
detPag.xPag = pag.descricaoFormaPagamento; // YA02A NT 2020.006
}
if (pag.dadosCartao) {
detPag.card = this.getDetalhamentoCartao(pag.dadosCartao);
}
detPag.vPag = pag.valor;
listPagamentos.push(detPag);
}
return listPagamentos;
Expand Down
2 changes: 2 additions & 0 deletions lib/factory/processor/nfeProcessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -984,6 +984,7 @@ class NFeProcessor {
CST: pis.CST
}
};
break;
case '49':
case '50':
case '51':
Expand Down Expand Up @@ -1020,6 +1021,7 @@ class NFeProcessor {
vPIS: pis.vPIS
}
};
break;
default:
result = {
PISOutr: {
Expand Down
Loading