Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integração com Hércules-ZeusFiscal/Master - Merge commit #1562

Merged
merged 50 commits into from
Oct 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
92c5480
fix: Garantindo que instancia do serviço sempre seja usada corretamen…
JoaoDiasDev Jul 17, 2024
219ba85
incluido campos de desoneracao faltantes no ICMSGeral
danilobreda Jul 17, 2024
2b40e02
Merge pull request #27 from Hercules-NET/feature/deson
danilobreda Jul 17, 2024
3f22273
melhoria do README.md
danilobreda Jul 20, 2024
32304df
Update README.md
danilobreda Jul 20, 2024
ce57c3b
Importação de CTeOS
Camparinni Jul 26, 2024
8eb5031
bugfix/FastReportUtilsCompilerException316.13ErrorCS1717: FastReport.…
eneiasramos Aug 2, 2024
ece6988
bugfix/FastReportUtilsCompilerExceptionText34ErrorCS0105: FastReport.…
eneiasramos Aug 2, 2024
1c3b9b7
Merge pull request #28 from Camparinni/master
danilobreda Aug 6, 2024
122fbec
Merge pull request #30 from eneiasramos/bugfix/FastReportUtilsCompile…
danilobreda Aug 6, 2024
c73f200
Merge pull request #31 from eneiasramos/bugfix/FastReportUtilsCompile…
danilobreda Aug 6, 2024
84e3116
feature/NFeDanfeHtmlLogo: adicionado parametro logo para exibir uma …
danilobreda Aug 7, 2024
3ebb76d
fix(cte): erro ao imprimir xml com colchetes
evaldoavelar Aug 8, 2024
4f5ab1b
Merge pull request #33 from evaldoavelar/master
danilobreda Aug 8, 2024
3cd5753
Microajuste no sumário.
mgpx Aug 15, 2024
b6a7d80
Merge pull request #35 from mgpx/master
danilobreda Aug 15, 2024
e64594a
feat:Incluido mapeamento de propriedades faltantes do serviço de cons…
neicecilio Sep 5, 2024
0b3f449
fix:Ajuste nos niveis de serialização do grupo de cana;
neicecilio Sep 5, 2024
f89a893
fix:Ajuste no grupo de campos gCred conforme NT 2019.001;
neicecilio Sep 5, 2024
14f54d5
fix:Ajuste nos endereços dos webservice para o evento de insucesso na…
neicecilio Sep 6, 2024
6a07023
Merge pull request #39 from neicecilio/feature/insucessoEntrega
danilobreda Sep 7, 2024
5953100
Merge pull request #38 from neicecilio/feature/gCred
danilobreda Sep 7, 2024
694e523
Merge pull request #36 from neicecilio/feature/consStatServ
danilobreda Sep 7, 2024
ce3261a
Merge pull request #37 from neicecilio/feature/cana
danilobreda Sep 7, 2024
fe10948
fix tipo referencia anulaveis c# 8.0 suporte apenas .net 5+
danilobreda Sep 7, 2024
f6c1845
add:Mapeamento de tags e serviços para o evento de comprovante de ent…
neicecilio Sep 12, 2024
4f98245
add:Implementado serviços para envio de evento de comprovante de entr…
neicecilio Sep 12, 2024
82059a6
add:Interface para testes do evento de comprovante de entrega;
neicecilio Sep 12, 2024
b8b9f1e
Merge pull request #40 from neicecilio/feature/comprovante-entrega
adrbarros Sep 13, 2024
4887431
adicionado suporte ao CRT MEI para DANFE e exemplos appteste
danilobreda Sep 16, 2024
4b7070c
fix typo
danilobreda Sep 16, 2024
3939cbe
Merge pull request #41 from bredassistemas/master
danilobreda Sep 16, 2024
7ea5d0d
fix: ajuste mdf-e método sinc para ficar igual o assincrono, para não…
robertorp Sep 19, 2024
f875904
fix: ajuste de quebra de código
robertorp Sep 19, 2024
66c3560
feat: nuget-impressao-nfce
robertorp Sep 21, 2024
74ea17f
fix: .net 6 apenas
robertorp Sep 21, 2024
78d67d3
chore: versão .net 6
robertorp Sep 21, 2024
93e9199
fix: pasta .net6.0
robertorp Sep 21, 2024
99841f4
chore: ajuste de arquivo nuspec file
robertorp Sep 21, 2024
a306e80
chore: ajuste
robertorp Sep 21, 2024
d978f57
fix: ajuste
robertorp Sep 21, 2024
6dce693
chore: add libs
robertorp Sep 21, 2024
a9e1303
chore: extenção arquivo
robertorp Sep 21, 2024
9376e70
Merge pull request #43 from Hercules-NET/ra/feat-nuget-impressao-nfce
robertorp Sep 21, 2024
37c3530
add:Incluido botões na tela de testes e estrutura para recepção de ev…
claudinei-cecilio-skill Sep 30, 2024
1f4d6dd
add:Serviços para envio de evento de conciliação financeira;
claudinei-cecilio-skill Sep 30, 2024
05b5621
fix:Revisão no endereçador para os modelos 55 e 65;
claudinei-cecilio-skill Sep 30, 2024
53b9945
Merge pull request #44 from neicecilio/feature/conciliacao-financeira
danilobreda Oct 2, 2024
96ea4dc
Merge branch 'master' of https://github.com/Hercules-NET/ZeusFiscal i…
Valmir-Cunha Oct 29, 2024
d033888
Ajuste testes de estado que utilizavam UF da autorizadora
Valmir-Cunha Oct 31, 2024
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
32 changes: 32 additions & 0 deletions CTe.Classes/cteOSProc.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using System;
using System.Xml.Serialization;
using CTe.Classes.Protocolo;
using CTe.Classes.Servicos.Tipos;
using DFe.Utils;

namespace CTe.Classes
{
[Serializable]
[XmlRoot(Namespace = "http://www.portalfiscal.inf.br/cte",
ElementName = "cteOSProc")]
public class cteOSProc
{
[XmlAttribute]
public versao versao { get; set; }

public CTe CTeOS { get; set; }

public protCTe protCTe { get; set; }


public static cteOSProc LoadXmlString(string xml)
{
return FuncoesXml.XmlStringParaClasse<cteOSProc>(xml);
}

public static cteOSProc LoadXmlArquivo(string caminhoArquivoXml)
{
return FuncoesXml.ArquivoXmlParaClasse<cteOSProc>(caminhoArquivoXml);
}
}
}
6 changes: 3 additions & 3 deletions CTe.Dacte.Base/CTe/CTeRetrato.frx
Original file line number Diff line number Diff line change
Expand Up @@ -1491,7 +1491,7 @@ namespace FastReport
</DataBand>
<DataBand Name="dataBandObservacao" Top="953.9" Width="737.1" Height="82.05" CanGrow="true" CanShrink="true" CanBreak="true">
<ShapeObject Name="Shape9" Width="737.1" Height="82.05" CanGrow="true" CanShrink="true" GrowToBottom="true"/>
<TextObject Name="Text168" Left="4" Top="15.45" Width="727.65" Height="65.15" CanGrow="true" CanShrink="true" GrowToBottom="true" Text="[cteProc.CTe.infCte.compl.xObs]" Font="Times New Roman, 8.25pt"/>
<TextObject Name="Text168" Left="4" Top="15.45" Width="727.65" Height="65.15" CanGrow="true" CanShrink="true" AllowExpressions="False" GrowToBottom="true" Text="[cteProc.CTe.infCte.compl.xObs]" Font="Times New Roman, 8.25pt"/>
<TextObject Name="Text186" Left="-9.45" Top="26.9" Width="765.45" Height="18.9" CanGrow="true" CanShrink="true" GrowToBottom="true" Text="DOCUMENTO EMITIDO EM AMBIENTE DE HOMOLOGAÇÃO, SEM VALOR FISCAL" HorzAlign="Center" Font="Times New Roman, 12pt, style=Bold"/>
<TextObject Name="Text163" Left="1" Top="1.55" Width="734.1" Height="11.45" CanGrow="true" CanShrink="true" GrowToBottom="true" Text="OBSERVAÇÕES" HorzAlign="Center" Font="Times New Roman, 6.75pt"/>
<LineObject Name="Line45" Left="1" Top="13" Width="734.55" CanGrow="true" CanShrink="true" GrowToBottom="true"/>
Expand Down Expand Up @@ -1584,8 +1584,8 @@ namespace FastReport
<LineObject Name="Line46" Left="1" Top="14.45" Width="734.55"/>
<TextObject Name="Text173" Left="1" Top="14.9" Width="94.5" Height="39.8" Font="Arial Narrow, 6.75pt"/>
<TextObject Name="Text207" Left="94.5" Top="14.74" Width="348.65" Height="39.8" Font="Arial Narrow, 6.75pt"/>
<TextObject Name="Text208" Left="445.15" Top="14.9" Width="94.5" Height="39.8" Font="Arial Narrow, 6.75pt"/>
<TextObject Name="Text209" Left="538.1" Top="14.9" Width="198.45" Height="39.8" Text="123456789012345678901234567890123456789012345" Font="Arial Narrow, 6.75pt"/>
<TextObject Name="Text208" Left="445.15" Top="14.9" Width="94.5" Height="39.8" Font="Arial Narrow, 6.75pt" AllowExpressions="False"/>
<TextObject Name="Text209" Left="538.1" Top="14.9" Width="198.45" Height="39.8" Text="123456789012345678901234567890123456789012345" Font="Arial Narrow, 6.75pt" AllowExpressions="False"/>
<TextObject Name="Text165" Left="1" Top="2" Width="442.15" Height="11.45" Text="USO EXCLUSIVO DO EMISSOR DO CTE" HorzAlign="Center" Font="Times New Roman, 6.75pt"/>
<LineObject Name="Line47" Left="444.15" Top="1" Height="54.7"/>
<TextObject Name="Text166" Left="444.15" Top="2" Width="290.95" Height="11.45" Text="RESERVADO AO FISCO" HorzAlign="Center" Font="Times New Roman, 6.75pt"/>
Expand Down
48 changes: 27 additions & 21 deletions CTe.Servicos/ConsultaProtocolo/ConsultaProtcoloServico.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,54 +43,60 @@ public class ConsultaProtcoloServico
{
public retConsSitCTe ConsultaProtocolo(string chave, ConfiguracaoServico configuracaoServico = null)
{
var consSitCTe = ClassesFactory.CriarconsSitCTe(chave, configuracaoServico);
var configServico = configuracaoServico ?? ConfiguracaoServico.Instancia;

if (configuracaoServico.IsValidaSchemas)
consSitCTe.ValidarSchema(configuracaoServico);
var consSitCTe = ClassesFactory.CriarconsSitCTe(chave, configServico);

consSitCTe.SalvarXmlEmDisco(configuracaoServico);
if (configServico.IsValidaSchemas)
consSitCTe.ValidarSchema(configServico);

var webService = WsdlFactory.CriaWsdlConsultaProtocolo(configuracaoServico);
consSitCTe.SalvarXmlEmDisco(configServico);

var webService = WsdlFactory.CriaWsdlConsultaProtocolo(configServico);
var retornoXml = webService.cteConsultaCT(consSitCTe.CriaRequestWs());

var retorno = retConsSitCTe.LoadXml(retornoXml.OuterXml, consSitCTe);
retorno.SalvarXmlEmDisco(chave, configuracaoServico);
retorno.SalvarXmlEmDisco(chave, configServico);

return retorno;
}

public retConsSitCTe ConsultaProtocoloV4(string chave, ConfiguracaoServico configuracaoServico = null)
{
var consSitCTe = ClassesFactory.CriarconsSitCTe(chave, configuracaoServico);
var configServico = configuracaoServico ?? ConfiguracaoServico.Instancia;

var consSitCTe = ClassesFactory.CriarconsSitCTe(chave, configServico);

if (configuracaoServico.IsValidaSchemas)
consSitCTe.ValidarSchema(configuracaoServico);
if (configServico.IsValidaSchemas)
consSitCTe.ValidarSchema(configServico);

consSitCTe.SalvarXmlEmDisco(configuracaoServico);
consSitCTe.SalvarXmlEmDisco(configServico);

var webService = WsdlFactory.CriaWsdlConsultaProtocoloV4(configuracaoServico);
var webService = WsdlFactory.CriaWsdlConsultaProtocoloV4(configServico);
var retornoXml = webService.cteConsultaCT(consSitCTe.CriaRequestWs());

var retorno = retConsSitCTe.LoadXml(retornoXml.OuterXml, consSitCTe);
retorno.SalvarXmlEmDisco(chave, configuracaoServico);
retorno.SalvarXmlEmDisco(chave, configServico);

return retorno;
}

public async Task<retConsSitCTe> ConsultaProtocoloAsync(string chave, ConfiguracaoServico configuracaoServico = null)
{
var consSitCTe = ClassesFactory.CriarconsSitCTe(chave, configuracaoServico);

if (configuracaoServico.IsValidaSchemas)
consSitCTe.ValidarSchema(configuracaoServico);

consSitCTe.SalvarXmlEmDisco(configuracaoServico);

var webService = WsdlFactory.CriaWsdlConsultaProtocolo(configuracaoServico);
var configServico = configuracaoServico ?? ConfiguracaoServico.Instancia;

var consSitCTe = ClassesFactory.CriarconsSitCTe(chave, configServico);

if (configServico.IsValidaSchemas)
consSitCTe.ValidarSchema(configServico);

consSitCTe.SalvarXmlEmDisco(configServico);

var webService = WsdlFactory.CriaWsdlConsultaProtocolo(configServico);
var retornoXml = await webService.cteConsultaCTAsync(consSitCTe.CriaRequestWs());

var retorno = retConsSitCTe.LoadXml(retornoXml.OuterXml, consSitCTe);
retorno.SalvarXmlEmDisco(chave, configuracaoServico);
retorno.SalvarXmlEmDisco(chave, configServico);

return retorno;
}
Expand Down
40 changes: 22 additions & 18 deletions CTe.Servicos/ConsultaRecibo/ConsultaReciboServico.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,36 +50,40 @@ public ConsultaReciboServico(string recibo)

public retConsReciCTe Consultar(ConfiguracaoServico configuracaoServico = null)
{
var consReciCTe = ClassesFactory.CriaConsReciCTe(_recibo, configuracaoServico);

if (configuracaoServico.IsValidaSchemas)
consReciCTe.ValidarSchema(configuracaoServico);

consReciCTe.SalvarXmlEmDisco(configuracaoServico);

var webService = WsdlFactory.CriaWsdlCteRetRecepcao(configuracaoServico);
var configServico = configuracaoServico ?? ConfiguracaoServico.Instancia;

var consReciCTe = ClassesFactory.CriaConsReciCTe(_recibo, configServico);

if (configServico.IsValidaSchemas)
consReciCTe.ValidarSchema(configServico);

consReciCTe.SalvarXmlEmDisco(configServico);

var webService = WsdlFactory.CriaWsdlCteRetRecepcao(configServico);
var retornoXml = webService.cteRetRecepcao(consReciCTe.CriaRequestWs());

var retorno = retConsReciCTe.LoadXml(retornoXml.OuterXml, consReciCTe);
retorno.SalvarXmlEmDisco(configuracaoServico);
retorno.SalvarXmlEmDisco(configServico);

return retorno;
}

public async Task<retConsReciCTe> ConsultarAsync(ConfiguracaoServico configuracaoServico = null)
{
var consReciCTe = ClassesFactory.CriaConsReciCTe(_recibo, configuracaoServico);

if (configuracaoServico.IsValidaSchemas)
consReciCTe.ValidarSchema(configuracaoServico);

consReciCTe.SalvarXmlEmDisco(configuracaoServico);

var webService = WsdlFactory.CriaWsdlCteRetRecepcao(configuracaoServico);
var configServico = configuracaoServico ?? ConfiguracaoServico.Instancia;

var consReciCTe = ClassesFactory.CriaConsReciCTe(_recibo, configServico);

if (configServico.IsValidaSchemas)
consReciCTe.ValidarSchema(configServico);

consReciCTe.SalvarXmlEmDisco(configServico);

var webService = WsdlFactory.CriaWsdlCteRetRecepcao(configServico);
var retornoXml = await webService.cteRetRecepcaoAsync(consReciCTe.CriaRequestWs());

var retorno = retConsReciCTe.LoadXml(retornoXml.OuterXml, consReciCTe);
retorno.SalvarXmlEmDisco(configuracaoServico);
retorno.SalvarXmlEmDisco(configServico);

return retorno;
}
Expand Down
1 change: 1 addition & 0 deletions CTe.Servicos/DistribuicaoDFe/ServicoCTeDistribuicaoDFe.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public ServicoCTeDistribuicaoDFe(ConfiguracaoServico configuracaoServico, X509Ce
public RetornoCteDistDFeInt CTeDistDFeInteresse(string ufAutor, string documento, string ultNSU = "0", string nSU = "0", ConfiguracaoServico configuracaoServico = null)
{
var configServico = configuracaoServico ?? _configuracaoServico ?? ConfiguracaoServico.Instancia;

distDFeInt pedDistDFeInt;
XmlDocument dadosConsulta;
var ws = InicializaCTeDistDFeInteresse(documento, ultNSU, nSU, out pedDistDFeInt, out dadosConsulta, configServico);
Expand Down
6 changes: 3 additions & 3 deletions CTe.Servicos/EnviarCte/ServicoEnviarCte.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ public class ServicoEnviarCte
public RetornoEnviarCte Enviar(int lote, Classes.CTe cte, ConfiguracaoServico configuracaoServico = null)
{
var configServico = configuracaoServico ?? ConfiguracaoServico.Instancia;

ServicoCTeRecepcao servicoRecepcao = new ServicoCTeRecepcao();

retEnviCte retEnviCte = servicoRecepcao.CTeRecepcao(lote, new List<Classes.CTe> {cte}, configServico);
retEnviCte retEnviCte = servicoRecepcao.CTeRecepcao(lote, new List<Classes.CTe> { cte }, configServico);

if (retEnviCte.cStat != 103)
{
Expand All @@ -28,7 +28,6 @@ public RetornoEnviarCte Enviar(int lote, Classes.CTe cte, ConfiguracaoServico co

retConsReciCTe retConsReciCTe = servicoConsultaRecibo.Consultar(configServico);


cteProc cteProc = null;
if (retConsReciCTe.cStat == 104)
{
Expand All @@ -54,6 +53,7 @@ public RetornoEnviarCte Enviar(int lote, Classes.CTe cte, ConfiguracaoServico co
public async Task<RetornoEnviarCte> EnviarAsync(int lote, Classes.CTe cte, ConfiguracaoServico configuracaoServico = null)
{
var configServico = configuracaoServico ?? ConfiguracaoServico.Instancia;

ServicoCTeRecepcao servicoRecepcao = new ServicoCTeRecepcao();

retEnviCte retEnviCte = await servicoRecepcao.CTeRecepcaoAsync(lote, new List<Classes.CTe> { cte }, configServico);
Expand Down
15 changes: 9 additions & 6 deletions CTe.Servicos/Eventos/EventoCancelamento.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,30 +72,33 @@ public EventoCancelamento(CteEletronicoOS cte, int sequenciaEvento, string numer

public retEventoCTe Cancelar(ConfiguracaoServico configuracaoServico = null)
{
var configServico = configuracaoServico ?? ConfiguracaoServico.Instancia;
var evento = ClassesFactory.CriaEvCancCTe(_justificativa, _numeroProtocolo);

EventoEnviado = FactoryEvento.CriaEvento(CTeTipoEvento.Cancelamento, _sequenciaEvento, _cte.Chave(), _cte.infCte.emit.CNPJ, evento, configuracaoServico);
RetornoSefaz = new ServicoController().Executar(_cte, _sequenciaEvento, evento, CTeTipoEvento.Cancelamento, configuracaoServico);
EventoEnviado = FactoryEvento.CriaEvento(CTeTipoEvento.Cancelamento, _sequenciaEvento, _cte.Chave(), _cte.infCte.emit.CNPJ, evento, configServico);
RetornoSefaz = new ServicoController().Executar(_cte, _sequenciaEvento, evento, CTeTipoEvento.Cancelamento, configServico);

return RetornoSefaz;
}

public retEventoCTe CancelarOs(ConfiguracaoServico configuracaoServico = null)
{
var configServico = configuracaoServico ?? ConfiguracaoServico.Instancia;
var evento = ClassesFactory.CriaEvCancCTe(_justificativa, _numeroProtocolo);

EventoEnviado = FactoryEvento.CriaEvento(CTeTipoEvento.Cancelamento, _sequenciaEvento, _cteOs.Chave(), _cteOs.InfCte.emit.CNPJ, evento, configuracaoServico);
RetornoSefaz = new ServicoController().Executar(_cteOs, _sequenciaEvento, evento, CTeTipoEvento.Cancelamento, configuracaoServico);
EventoEnviado = FactoryEvento.CriaEvento(CTeTipoEvento.Cancelamento, _sequenciaEvento, _cteOs.Chave(), _cteOs.InfCte.emit.CNPJ, evento, configServico);
RetornoSefaz = new ServicoController().Executar(_cteOs, _sequenciaEvento, evento, CTeTipoEvento.Cancelamento, configServico);

return RetornoSefaz;
}

public async Task<retEventoCTe> CancelarAsync(ConfiguracaoServico configuracaoServico = null)
{
var configServico = configuracaoServico ?? ConfiguracaoServico.Instancia;
var evento = ClassesFactory.CriaEvCancCTe(_justificativa, _numeroProtocolo);

EventoEnviado = FactoryEvento.CriaEvento(CTeTipoEvento.Cancelamento, _sequenciaEvento, _cte.Chave(), _cte.infCte.emit.CNPJ, evento, configuracaoServico);
RetornoSefaz = await new ServicoController().ExecutarAsync(_cte, _sequenciaEvento, evento, CTeTipoEvento.Cancelamento, configuracaoServico);
EventoEnviado = FactoryEvento.CriaEvento(CTeTipoEvento.Cancelamento, _sequenciaEvento, _cte.Chave(), _cte.infCte.emit.CNPJ, evento, configServico);
RetornoSefaz = await new ServicoController().ExecutarAsync(_cte, _sequenciaEvento, evento, CTeTipoEvento.Cancelamento, configServico);

return RetornoSefaz;
}
Expand Down
3 changes: 2 additions & 1 deletion CTe.Servicos/Eventos/FactoryEvento.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ public class FactoryEvento
//Vou manter para evitar quebra de código pois a classe e o metodo são publicos
public static eventoCTe CriaEvento(CTeEletronico cte, CTeTipoEvento cTeTipoEvento, int sequenciaEvento, EventoContainer container, ConfiguracaoServico configuracaoServico = null)
{
return CriaEvento(cTeTipoEvento, sequenciaEvento, cte.Chave(), cte.infCte.emit.CNPJ, container, configuracaoServico);
var configServico = configuracaoServico ?? ConfiguracaoServico.Instancia;
return CriaEvento(cTeTipoEvento, sequenciaEvento, cte.Chave(), cte.infCte.emit.CNPJ, container, configServico);
}

public static eventoCTe CriaEvento(CTeTipoEvento cTeTipoEvento, int sequenciaEvento, string chave, string cnpj, EventoContainer container, ConfiguracaoServico configuracaoServico = null)
Expand Down
Loading