Skip to content

Commit

Permalink
Ajustes alterando Constantes EFD Contrib e EFDFiscal para string normal.
Browse files Browse the repository at this point in the history
  • Loading branch information
orochasamuel committed Sep 15, 2023
1 parent d877124 commit a19f6fc
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/FiscalBr.Common/Sped/LerCamposSped.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace FiscalBr.Common.Sped
{
public static class LerCamposSped
{
public static object LerCampos(this string line, string file = Constantes.ArquivoDigital.Sped.EFDFiscal, int codVersao = 0)
public static object LerCampos(this string line, string file = "EFDFiscal", int codVersao = 0)
{
line = line.TrimStart().Substring(1);

Expand Down
2 changes: 1 addition & 1 deletion src/FiscalBr.EFDContribuicoes/ArquivoEFDContribuicoes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public override void Ler(string path, Encoding encoding = null, int codVersaoLay
{
if (leituraConcluida == false)
{
var registro = (RegistroSped)LerCamposSped.LerCampos(linha, Constantes.ArquivoDigital.Sped.EFDContribuicoes, codVersaoLayout);
var registro = (RegistroSped)LerCamposSped.LerCampos(linha, "EFDContribuicoes", codVersaoLayout);

if (registro.Reg == "9999")
leituraConcluida = true;
Expand Down
4 changes: 2 additions & 2 deletions src/FiscalBr.EFDFiscal/ArquivoEFDFiscal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public override void Ler(string[] source)
{
if (leituraConcluida == false)
{
var registro = (RegistroSped)LerCamposSped.LerCampos(linha, Constantes.ArquivoDigital.Sped.EFDFiscal, codVersaoLayout);
var registro = (RegistroSped)LerCamposSped.LerCampos(linha, "EFDFiscal", codVersaoLayout);

if (registro.Reg == "9999")
leituraConcluida = true;
Expand Down Expand Up @@ -88,7 +88,7 @@ public override void Ler(string path, Encoding encoding = null, int codVersaoLay
{
if (leituraConcluida == false)
{
var registro = (RegistroSped)LerCamposSped.LerCampos(linha, Constantes.ArquivoDigital.Sped.EFDFiscal, codVersaoLayout);
var registro = (RegistroSped)LerCamposSped.LerCampos(linha, "EFDFiscal", codVersaoLayout);

if (registro.Reg == "9999")
leituraConcluida = true;
Expand Down
2 changes: 1 addition & 1 deletion tests/FiscalBr.Test/Sped/Bloco1/Bloco1Registro1320Test.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public void Ler_Registro_1320_EFDFiscal()
{
string linha = "|1320|1|1234567890|Motivo 1|Interventor 1|51077662000109|00695196090|100,13|55,20|10|40|";

var registro = (FiscalBr.EFDFiscal.Bloco1.Registro1320)LerCamposSped.LerCampos(linha, Constantes.ArquivoDigital.Sped.EFDFiscal, 0);
var registro = (FiscalBr.EFDFiscal.Bloco1.Registro1320)LerCamposSped.LerCampos(linha, "EFDFiscal", 0);

Assert.Equal("1320", registro.Reg);
Assert.Equal(1, registro.NumBico);
Expand Down
2 changes: 1 addition & 1 deletion tests/FiscalBr.Test/Sped/Bloco1/Bloco1Registro1391Test.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public void Ler_Registro_1391_EFDFiscal()
{
string linha = "|1391|01012023|123,41|123,42|123,43|123,44|123,45|123,46|123,47|123,48|123,49|123,40|123,41|123,42|123,43|123,44|Observações|COD_ITEM|01|123,45|";

var registro = (FiscalBr.EFDFiscal.Bloco1.Registro1391)LerCamposSped.LerCampos(linha, Constantes.ArquivoDigital.Sped.EFDFiscal, 0);
var registro = (FiscalBr.EFDFiscal.Bloco1.Registro1391)LerCamposSped.LerCampos(linha, "EFDFiscal", 0);

Assert.Equal("1391", registro.Reg);
Assert.Equal(new DateTime(2023, 01, 01), registro.DtRegistro);
Expand Down
2 changes: 1 addition & 1 deletion tests/FiscalBr.Test/Sped/SpedLeituraTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public void Teste_Leitura_Quantidade_Propriedades_EFDFiscal_C500_V2()

var bloco = registro.Substring(0, 1);

var toInstantiate = $"FiscalBr.{Constantes.ArquivoDigital.Sped.EFDFiscal}.Bloco{bloco}+Registro{registro}, FiscalBr.{Constantes.ArquivoDigital.Sped.EFDFiscal}";
var toInstantiate = $"FiscalBr.{"EFDFiscal"}.Bloco{bloco}+Registro{registro}, FiscalBr.{"EFDFiscal"}";

var objectType = Type.GetType(toInstantiate);

Expand Down

0 comments on commit a19f6fc

Please sign in to comment.