-
Notifications
You must be signed in to change notification settings - Fork 479
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrar ajustes do fork andre_bts para MDFe no repositório original …
…da biblioteca DFe.NET (#1519) * Removido modificador static das propriedades de MDFeConfiguracao e implementado singleton na mesma; * Implementado INotifyPropertyChanged em MDFeConfiguracao; * Adicionado parametro opcional do tipo MDFeConfiguracao a classes do pacote MDFe que utilizam valores de MDFeConfiguracao como EventoCancelar, EventoEncerramento, EventoInclusaoCondutor, EventoInclusaoDFe, EventoPagamentoOperacao, ServicoMDFeEvento, ServicoMDFeRecepcao, ServicoMDFeRetRecepcao, ServicoMDFeStatusServico, etc; * Renomeadas propriedades e classes afim de manter compatibilidade do estilo utilizado no pacote MDFe; * Corrigido typo em namespace "Extencoes" para "Extensoes"; * Adicionado tratamento para obtenção do valor do campo dhIniViagem em MDFeIde a depender da versão do leiaute; * Alterada versão do leiaute específico para o Modal (VersaoModal) no construtor de MDFeInfModal da versão 1.00 para a versão 3.00; * Movida classe infViagens dentro de evPagtoOperMDFe.cs para a classe MDFeInfViagens em arquivo separado * Ajustado campo UF de MDFeVeicTracao para permitir valores nulos conforme Nota Tecnica 2021.001 * Adicionados campos de margem em ConfiguracaoDamdfe; * Adicionado tratamento para set da propriedade ProxyUF quando o valor informado for vazio ou nulo.
- Loading branch information
1 parent
8c0620a
commit f1733fd
Showing
144 changed files
with
2,367 additions
and
1,042 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,13 +31,14 @@ | |
/* http://www.zeusautomacao.com.br/ */ | ||
/* Rua Comendador Francisco josé da Cunha, 111 - Itabaiana - SE - 49500-000 */ | ||
/********************************************************************************/ | ||
|
||
using DFe.Classes.Entidades; | ||
using DFe.Classes.Flags; | ||
using DFe.Utils; | ||
using MDFe.AppTeste.Dao; | ||
using MDFe.AppTeste.Entidades; | ||
using MDFe.AppTeste.ModelBase; | ||
using MDFe.Classes.Extencoes; | ||
using MDFe.Classes.Extensoes; | ||
using MDFe.Classes.Flags; | ||
using MDFe.Classes.Informacoes; | ||
using MDFe.Classes.Informacoes.Evento.CorpoEvento; | ||
|
@@ -612,7 +613,7 @@ public void CriarEnviar() | |
#endregion dados emitente (emit) | ||
|
||
#region modal | ||
if (MDFeConfiguracao.VersaoWebService.VersaoLayout == VersaoServico.Versao100) | ||
if (MDFeConfiguracao.Instancia.VersaoWebService.VersaoLayout == VersaoServico.Versao100) | ||
{ | ||
mdfe.InfMDFe.InfModal.Modal = new MDFeRodo | ||
{ | ||
|
@@ -640,16 +641,16 @@ public void CriarEnviar() | |
} | ||
|
||
|
||
if (MDFeConfiguracao.VersaoWebService.VersaoLayout == VersaoServico.Versao300) | ||
if (MDFeConfiguracao.Instancia.VersaoWebService.VersaoLayout == VersaoServico.Versao300) | ||
{ | ||
mdfe.InfMDFe.InfModal.Modal = new MDFeRodo | ||
{ | ||
infANTT = new MDFeInfANTT | ||
InfANTT = new MDFeInfANTT | ||
{ | ||
RNTRC = config.Empresa.RNTRC, | ||
|
||
// não é obrigatorio | ||
infCIOT = new List<infCIOT> | ||
InfCIOT = new List<infCIOT> | ||
{ | ||
new infCIOT | ||
{ | ||
|
@@ -692,7 +693,7 @@ public void CriarEnviar() | |
TpCar = MDFeTpCar.NaoAplicavel | ||
}, | ||
|
||
lacRodo = new List<MDFeLacre> | ||
LacRodo = new List<MDFeLacre> | ||
{ | ||
new MDFeLacre | ||
{ | ||
|
@@ -722,7 +723,7 @@ public void CriarEnviar() | |
}; | ||
|
||
|
||
if (MDFeConfiguracao.VersaoWebService.VersaoLayout == VersaoServico.Versao300) | ||
if (MDFeConfiguracao.Instancia.VersaoWebService.VersaoLayout == VersaoServico.Versao300) | ||
{ | ||
mdfe.InfMDFe.InfDoc.InfMunDescarga[0].InfCTe[0].Peri = new List<MDFePeri> | ||
{ | ||
|
@@ -738,7 +739,7 @@ public void CriarEnviar() | |
|
||
#region seg | ||
|
||
if (MDFeConfiguracao.VersaoWebService.VersaoLayout == VersaoServico.Versao300) | ||
if (MDFeConfiguracao.Instancia.VersaoWebService.VersaoLayout == VersaoServico.Versao300) | ||
{ | ||
mdfe.InfMDFe.Seg = new List<MDFeSeg>(); | ||
|
||
|
@@ -766,19 +767,19 @@ public void CriarEnviar() | |
|
||
#region Produto Predominante | ||
|
||
if (MDFeConfiguracao.VersaoWebService.VersaoLayout == VersaoServico.Versao300) | ||
if (MDFeConfiguracao.Instancia.VersaoWebService.VersaoLayout == VersaoServico.Versao300) | ||
{ | ||
mdfe.InfMDFe.prodPred = new prodPred | ||
mdfe.InfMDFe.ProdPred = new MDFeProdPred | ||
{ | ||
tpCarga = tpCarga.CargaGeral, | ||
xProd = "aaaaaaaaaaaaaaaaaaaaa", | ||
infLotacao = new infLotacao | ||
TpCarga = MDFeTpCarga.CargaGeral, | ||
XProd = "aaaaaaaaaaaaaaaaaaaaa", | ||
InfLotacao = new MDFeInfLotacao | ||
{ | ||
infLocalCarrega = new infLocalCarrega | ||
InfLocalCarrega = new MDFeInfLocalCarrega | ||
{ | ||
CEP = "75950000" | ||
}, | ||
infLocalDescarrega = new infLocalDescarrega | ||
InfLocalDescarrega = new MDFeInfLocalDescarrega | ||
{ | ||
CEP = "75950000" | ||
} | ||
|
@@ -804,12 +805,12 @@ public void CriarEnviar() | |
|
||
#region dados responsavel tecnico | ||
|
||
mdfe.InfMDFe.infRespTec = new infRespTec | ||
mdfe.InfMDFe.InfRespTec = new MDFeInfRespTec | ||
{ | ||
CNPJ = "21025760000123", | ||
email = "[email protected]", | ||
fone = "64981081602", | ||
xContato = "roberto alves" | ||
Email = "[email protected]", | ||
Fone = "64981081602", | ||
XContato = "roberto alves" | ||
}; | ||
#endregion | ||
|
||
|
@@ -898,7 +899,7 @@ public void GerarESalvar() | |
#endregion dados emitente (emit) | ||
|
||
#region modal | ||
if (MDFeConfiguracao.VersaoWebService.VersaoLayout == VersaoServico.Versao100) | ||
if (MDFeConfiguracao.Instancia.VersaoWebService.VersaoLayout == VersaoServico.Versao100) | ||
{ | ||
mdfe.InfMDFe.InfModal.VersaoModal = MDFeVersaoModal.Versao100; | ||
mdfe.InfMDFe.InfModal.Modal = new MDFeRodo | ||
|
@@ -927,25 +928,25 @@ public void GerarESalvar() | |
} | ||
|
||
|
||
if (MDFeConfiguracao.VersaoWebService.VersaoLayout == VersaoServico.Versao300) | ||
if (MDFeConfiguracao.Instancia.VersaoWebService.VersaoLayout == VersaoServico.Versao300) | ||
{ | ||
mdfe.InfMDFe.InfModal.VersaoModal = MDFeVersaoModal.Versao300; | ||
mdfe.InfMDFe.InfModal.Modal = new MDFeRodo | ||
{ | ||
infANTT = new MDFeInfANTT | ||
InfANTT = new MDFeInfANTT | ||
{ | ||
RNTRC = config.Empresa.RNTRC, | ||
|
||
// não é obrigatorio | ||
infCIOT = new List<infCIOT> | ||
InfCIOT = new List<infCIOT> | ||
{ | ||
new infCIOT | ||
{ | ||
CIOT = "123456789123", | ||
CNPJ = "21025760000123" | ||
} | ||
}, | ||
valePed = new MDFeValePed | ||
ValePed = new MDFeValePed | ||
{ | ||
Disp = new List<MDFeDisp> | ||
{ | ||
|
@@ -954,7 +955,7 @@ public void GerarESalvar() | |
CNPJForn = "21025760000123", | ||
CNPJPg = "21025760000123", | ||
NCompra = "838388383", | ||
vValePed = 100.33m | ||
VValePed = 100.33m | ||
} | ||
} | ||
} | ||
|
@@ -980,7 +981,7 @@ public void GerarESalvar() | |
TpCar = MDFeTpCar.NaoAplicavel | ||
}, | ||
|
||
lacRodo = new List<MDFeLacre> | ||
LacRodo = new List<MDFeLacre> | ||
{ | ||
new MDFeLacre | ||
{ | ||
|
@@ -1011,7 +1012,7 @@ public void GerarESalvar() | |
}; | ||
|
||
|
||
if (MDFeConfiguracao.VersaoWebService.VersaoLayout == VersaoServico.Versao300) | ||
if (MDFeConfiguracao.Instancia.VersaoWebService.VersaoLayout == VersaoServico.Versao300) | ||
{ | ||
mdfe.InfMDFe.InfDoc.InfMunDescarga[0].InfCTe[0].Peri = new List<MDFePeri> | ||
{ | ||
|
@@ -1027,7 +1028,7 @@ public void GerarESalvar() | |
|
||
#region seg | ||
|
||
if (MDFeConfiguracao.VersaoWebService.VersaoLayout == VersaoServico.Versao300) | ||
if (MDFeConfiguracao.Instancia.VersaoWebService.VersaoLayout == VersaoServico.Versao300) | ||
{ | ||
mdfe.InfMDFe.Seg = new List<MDFeSeg>(); | ||
|
||
|
@@ -1379,17 +1380,17 @@ private static void CarregarConfiguracoesMDFe(Configuracao config) | |
ManterDadosEmCache = config.CertificadoDigital.ManterEmCache, | ||
}; | ||
|
||
MDFeConfiguracao.ConfiguracaoCertificado = configuracaoCertificado; | ||
MDFeConfiguracao.CaminhoSchemas = config.ConfigWebService.CaminhoSchemas; | ||
MDFeConfiguracao.CaminhoSalvarXml = config.DiretorioSalvarXml; | ||
MDFeConfiguracao.IsSalvarXml = config.IsSalvarXml; | ||
MDFeConfiguracao.Instancia.ConfiguracaoCertificado = configuracaoCertificado; | ||
MDFeConfiguracao.Instancia.CaminhoSchemas = config.ConfigWebService.CaminhoSchemas; | ||
MDFeConfiguracao.Instancia.CaminhoSalvarXml = config.DiretorioSalvarXml; | ||
MDFeConfiguracao.Instancia.IsSalvarXml = config.IsSalvarXml; | ||
|
||
MDFeConfiguracao.VersaoWebService.VersaoLayout = config.ConfigWebService.VersaoLayout; | ||
MDFeConfiguracao.Instancia.VersaoWebService.VersaoLayout = config.ConfigWebService.VersaoLayout; | ||
|
||
MDFeConfiguracao.VersaoWebService.TipoAmbiente = config.ConfigWebService.Ambiente; | ||
MDFeConfiguracao.VersaoWebService.UfEmitente = config.ConfigWebService.UfEmitente; | ||
MDFeConfiguracao.VersaoWebService.TimeOut = config.ConfigWebService.TimeOut; | ||
MDFeConfiguracao.IsAdicionaQrCode = true; | ||
MDFeConfiguracao.Instancia.VersaoWebService.TipoAmbiente = config.ConfigWebService.Ambiente; | ||
MDFeConfiguracao.Instancia.VersaoWebService.UfEmitente = config.ConfigWebService.UfEmitente; | ||
MDFeConfiguracao.Instancia.VersaoWebService.TimeOut = config.ConfigWebService.TimeOut; | ||
MDFeConfiguracao.Instancia.IsAdicionaQrCode = true; | ||
} | ||
|
||
protected virtual void OnSucessoSync(RetornoEEnvio e) | ||
|
Oops, something went wrong.