Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

Commit

Permalink
funcao de processar string xml gerado em contingencia
Browse files Browse the repository at this point in the history
  • Loading branch information
fnunezzz authored and lealhugui committed Feb 14, 2022
1 parent d798a7a commit e44bea8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/factory/processor/nfeProcessor2.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ export declare class NFeProcessor {
executar(documento: NFeDocumento | NFCeDocumento): Promise<RetornoProcessamentoNF>;
inutilizarNumeracao(dados: Inutilizar): Promise<any>;
gerarEvento(evento: Evento): Promise<any>;
processarXmlContingencia(xml: string): Promise<any>;
}
6 changes: 6 additions & 0 deletions lib/factory/processor/nfeProcessor2.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ class NFeProcessor {
}
}
}
else if (result.retornoContingenciaOffline && result.success) {
return result;
}
else {
console.error('nfeProcessor.executar: Erro ao realizar requisição', result);
throw new Error('Erro ao realizar requisição');
Expand All @@ -118,5 +121,8 @@ class NFeProcessor {
async gerarEvento(evento) {
return await this.eventoProcessor.executar(evento);
}
async processarXmlContingencia(xml) {
return await this.enviaProcessor.transmitirXml(xml);
}
}
exports.NFeProcessor = NFeProcessor;
8 changes: 7 additions & 1 deletion src/factory/processor/nfeProcessor2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ export class NFeProcessor {
fs.writeFileSync(filenameConsultaRetorno, result.consultaProc.xml_recebido);
}
}
} else if (result.retornoContingenciaOffline && result.success) {
return result;
} else {
console.error('nfeProcessor.executar: Erro ao realizar requisição', result);
throw new Error('Erro ao realizar requisição');
Expand All @@ -134,4 +136,8 @@ export class NFeProcessor {
return await this.eventoProcessor.executar(evento);
}

}
public async processarXmlContingencia(xml: string) {
return await this.enviaProcessor.transmitirXml(xml);
}

}

0 comments on commit e44bea8

Please sign in to comment.