From 826111550779ee0676637f5d7748a2f23fab9356 Mon Sep 17 00:00:00 2001 From: Adenilton B Silva Date: Mon, 5 Sep 2016 16:47:53 -0300 Subject: [PATCH] =?UTF-8?q?*=20Corre=C3=A7=C3=A3o=20na=20vers=C3=A3o=20do?= =?UTF-8?q?=20servi=C3=A7o=20RecepcaoEvento,=20conforme=20issue=20https://?= =?UTF-8?q?github.com/adeniltonbs/Zeus.Net.NFe.NFCe/issues/187;=20*=20Incl?= =?UTF-8?q?us=C3=A3o=20dos=20cStats=20218=20(NF-e=20j=C3=A1=20est=C3=A1=20?= =?UTF-8?q?cancelada=20na=20base=20de=20dados=20da=20SEFAZ)=20e=20420=20(R?= =?UTF-8?q?ejei=C3=A7=C3=A3o:=20Cancelamento=20para=20NF-e=20j=C3=A1=20can?= =?UTF-8?q?celada)=20para=20o=20m=C3=A9todo=20NfeSituacao.Cancelada(int=20?= =?UTF-8?q?cStat).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NFe.Servicos/Enderecador.cs | 8 ++++---- NFe.Utils/NfeSituacao.cs | 5 ++++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/NFe.Servicos/Enderecador.cs b/NFe.Servicos/Enderecador.cs index f894edcb7..7f0e6fe62 100644 --- a/NFe.Servicos/Enderecador.cs +++ b/NFe.Servicos/Enderecador.cs @@ -876,9 +876,9 @@ private static List CarregarUrlsServicos() endServico.Add(new EnderecoServico(ServicoNFe.NfeConsultaProtocolo, VersaoServico.ve310, TipoAmbiente.taHomologacao, emissao, Estado.SP, ModeloDocumento.NFCe, "https://homologacao.nfce.fazenda.sp.gov.br/ws/nfeconsulta2.asmx")); //SP possui um endereço diferente para EPEC de NFCe, serviço "RecepcaoEvento", conforme http://www.nfce.fazenda.sp.gov.br/NFCePortal/Paginas/URLWebServices.aspx if (emissao != TipoEmissao.teEPEC) - endServico.Add(new EnderecoServico(ServicoNFe.RecepcaoEvento, VersaoServico.ve310, TipoAmbiente.taHomologacao, emissao, Estado.SP, ModeloDocumento.NFCe, "https://homologacao.nfce.fazenda.sp.gov.br/ws/recepcaoevento.asmx")); + endServico.Add(new EnderecoServico(ServicoNFe.RecepcaoEvento, VersaoServico.ve100, TipoAmbiente.taHomologacao, emissao, Estado.SP, ModeloDocumento.NFCe, "https://homologacao.nfce.fazenda.sp.gov.br/ws/recepcaoevento.asmx")); else - endServico.Add(new EnderecoServico(ServicoNFe.RecepcaoEvento, VersaoServico.ve310, TipoAmbiente.taHomologacao, emissao, Estado.SP, ModeloDocumento.NFCe, "https://homologacao.nfce.epec.fazenda.sp.gov.br/EPECws/RecepcaoEPEC.asmx")); + endServico.Add(new EnderecoServico(ServicoNFe.RecepcaoEvento, VersaoServico.ve100, TipoAmbiente.taHomologacao, emissao, Estado.SP, ModeloDocumento.NFCe, "https://homologacao.nfce.epec.fazenda.sp.gov.br/EPECws/RecepcaoEPEC.asmx")); endServico.Add(new EnderecoServico(ServicoNFe.NfeStatusServico, VersaoServico.ve310, TipoAmbiente.taHomologacao, emissao, Estado.SP, ModeloDocumento.NFCe, "https://homologacao.nfce.fazenda.sp.gov.br/ws/nfestatusservico2.asmx")); #endregion @@ -911,9 +911,9 @@ private static List CarregarUrlsServicos() endServico.Add(new EnderecoServico(ServicoNFe.NfeConsultaProtocolo, VersaoServico.ve310, TipoAmbiente.taProducao, emissao, Estado.SP, ModeloDocumento.NFCe, "https://nfce.fazenda.sp.gov.br/ws/nfeconsulta2.asmx")); //SP possui um endereço diferente para EPEC de NFCe, serviço "RecepcaoEvento", conforme http://www.nfce.fazenda.sp.gov.br/NFCePortal/Paginas/URLWebServices.aspx if (emissao != TipoEmissao.teEPEC) - endServico.Add(new EnderecoServico(ServicoNFe.RecepcaoEvento, VersaoServico.ve310, TipoAmbiente.taProducao, emissao, Estado.SP, ModeloDocumento.NFCe, "https://nfce.fazenda.sp.gov.br/ws/recepcaoevento.asmx")); + endServico.Add(new EnderecoServico(ServicoNFe.RecepcaoEvento, VersaoServico.ve100, TipoAmbiente.taProducao, emissao, Estado.SP, ModeloDocumento.NFCe, "https://nfce.fazenda.sp.gov.br/ws/recepcaoevento.asmx")); else - endServico.Add(new EnderecoServico(ServicoNFe.RecepcaoEvento, VersaoServico.ve310, TipoAmbiente.taProducao, emissao, Estado.SP, ModeloDocumento.NFCe, "https://nfce.epec.fazenda.sp.gov.br/EPECws/RecepcaoEPEC.asmx")); + endServico.Add(new EnderecoServico(ServicoNFe.RecepcaoEvento, VersaoServico.ve100, TipoAmbiente.taProducao, emissao, Estado.SP, ModeloDocumento.NFCe, "https://nfce.epec.fazenda.sp.gov.br/EPECws/RecepcaoEPEC.asmx")); endServico.Add(new EnderecoServico(ServicoNFe.NfeStatusServico, VersaoServico.ve310, TipoAmbiente.taProducao, emissao, Estado.SP, ModeloDocumento.NFCe, "https://nfce.fazenda.sp.gov.br/ws/nfestatusservico2.asmx")); #endregion diff --git a/NFe.Utils/NfeSituacao.cs b/NFe.Utils/NfeSituacao.cs index 321c13f76..18829ecaa 100644 --- a/NFe.Utils/NfeSituacao.cs +++ b/NFe.Utils/NfeSituacao.cs @@ -11,7 +11,9 @@ public static bool Autorizada(int cStat) public static bool Cancelada(int cStat) { return cStat == 101 /*Cancelamento de NF-e homologado*/ - | cStat == 151 /*Cancelamento de NF-e homologado fora de prazo*/; + | cStat == 151 /*Cancelamento de NF-e homologado fora de prazo*/ + | cStat == 218 /*NF-e já está cancelada na base de dados da SEFAZ [nRec:999999999999999]*/ + | cStat == 420 /*Rejeição: Cancelamento para NF-e já cancelada*/; } public static bool Denegada(int cStat) @@ -35,5 +37,6 @@ public static bool Rejeitada(int cStat) //if ((protNfeRetorno.infProt.cStat >= 201) & (protNfeRetorno.infProt.cStat <= 299) | (protNfeRetorno.infProt.cStat >= 401)) //Rejeitada (Antigo tratamento de rejeição) return cStat >= 201 & !Autorizada(cStat) & !Cancelada(cStat) & !Denegada(cStat) & !Inutilizada(cStat); } + } }