Skip to content

Commit

Permalink
* Correção na versão do serviço RecepcaoEvento, conforme issue https:…
Browse files Browse the repository at this point in the history
…//github.com/adeniltonbs/Zeus.Net.NFe.NFCe/issues/187;

* Inclusão dos cStats 218 (NF-e já está cancelada na base de dados da SEFAZ) e 420 (Rejeição: Cancelamento para NF-e já cancelada) para o método NfeSituacao.Cancelada(int cStat).
  • Loading branch information
adeniltonbs committed Sep 5, 2016
1 parent 6965549 commit 8261115
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
8 changes: 4 additions & 4 deletions NFe.Servicos/Enderecador.cs
Original file line number Diff line number Diff line change
Expand Up @@ -876,9 +876,9 @@ private static List<EnderecoServico> 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
Expand Down Expand Up @@ -911,9 +911,9 @@ private static List<EnderecoServico> 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
Expand Down
5 changes: 4 additions & 1 deletion NFe.Utils/NfeSituacao.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);
}

}
}

0 comments on commit 8261115

Please sign in to comment.