From 673b6ae5a4bfdadb1a8ce4f96e82634ea5aef379 Mon Sep 17 00:00:00 2001 From: Giovane Boeing Date: Wed, 21 Aug 2024 15:55:02 -0300 Subject: [PATCH] NT 2024.01 - adicionado CRT MEI e removido obrigado de origem em alguns CSOSN para contemplar schema --- .../nfe400/classes/NFRegimeTributario.java | 3 +- .../nota/NFNotaInfoItemImpostoICMSSN102.java | 2 +- .../nota/NFNotaInfoItemImpostoICMSSN900.java | 2 +- .../classes/NFRegimeTributarioTest.java | 7 ++- .../NFNotaInfoItemImpostoICMSSN102Test.java | 12 ++--- .../NFNotaInfoItemImpostoICMSSN900Test.java | 44 +++++++++---------- 6 files changed, 38 insertions(+), 32 deletions(-) diff --git a/src/main/java/com/fincatto/documentofiscal/nfe400/classes/NFRegimeTributario.java b/src/main/java/com/fincatto/documentofiscal/nfe400/classes/NFRegimeTributario.java index ed3d344d3..66a92d61c 100755 --- a/src/main/java/com/fincatto/documentofiscal/nfe400/classes/NFRegimeTributario.java +++ b/src/main/java/com/fincatto/documentofiscal/nfe400/classes/NFRegimeTributario.java @@ -4,7 +4,8 @@ public enum NFRegimeTributario { SIMPLES_NACIONAL("1", "Simples nacional"), SIMPLES_NACIONAL_EXCESSO_RECEITA("2", "Simples nacional com excesso de sublimite da receita bruta"), - NORMAL("3", "Regime normal"); + NORMAL("3", "Regime normal"), + MEI("4", "Simples Nacional - Microempreendedor Individual - MEI"); private final String codigo; private final String descricao; diff --git a/src/main/java/com/fincatto/documentofiscal/nfe400/classes/nota/NFNotaInfoItemImpostoICMSSN102.java b/src/main/java/com/fincatto/documentofiscal/nfe400/classes/nota/NFNotaInfoItemImpostoICMSSN102.java index 0defc5137..a29edfa35 100755 --- a/src/main/java/com/fincatto/documentofiscal/nfe400/classes/nota/NFNotaInfoItemImpostoICMSSN102.java +++ b/src/main/java/com/fincatto/documentofiscal/nfe400/classes/nota/NFNotaInfoItemImpostoICMSSN102.java @@ -8,7 +8,7 @@ public class NFNotaInfoItemImpostoICMSSN102 extends DFBase { private static final long serialVersionUID = 8991323254446222797L; - @Element(name = "orig") + @Element(name = "orig", required = false) private NFOrigem origem; @Element(name = "CSOSN") diff --git a/src/main/java/com/fincatto/documentofiscal/nfe400/classes/nota/NFNotaInfoItemImpostoICMSSN900.java b/src/main/java/com/fincatto/documentofiscal/nfe400/classes/nota/NFNotaInfoItemImpostoICMSSN900.java index 1a4579664..c9ed4159a 100755 --- a/src/main/java/com/fincatto/documentofiscal/nfe400/classes/nota/NFNotaInfoItemImpostoICMSSN900.java +++ b/src/main/java/com/fincatto/documentofiscal/nfe400/classes/nota/NFNotaInfoItemImpostoICMSSN900.java @@ -13,7 +13,7 @@ public class NFNotaInfoItemImpostoICMSSN900 extends DFBase { private static final long serialVersionUID = 4771007345613617306L; - @Element(name = "orig") + @Element(name = "orig", required = false) private NFOrigem origem; @Element(name = "CSOSN") diff --git a/src/test/java/com/fincatto/documentofiscal/nfe400/classes/NFRegimeTributarioTest.java b/src/test/java/com/fincatto/documentofiscal/nfe400/classes/NFRegimeTributarioTest.java index ccf2e1ddc..2fea849c8 100755 --- a/src/test/java/com/fincatto/documentofiscal/nfe400/classes/NFRegimeTributarioTest.java +++ b/src/test/java/com/fincatto/documentofiscal/nfe400/classes/NFRegimeTributarioTest.java @@ -10,6 +10,7 @@ public void deveRepresentarOCodigoCorretamente() { Assert.assertEquals("1", NFRegimeTributario.SIMPLES_NACIONAL.getCodigo()); Assert.assertEquals("2", NFRegimeTributario.SIMPLES_NACIONAL_EXCESSO_RECEITA.getCodigo()); Assert.assertEquals("3", NFRegimeTributario.NORMAL.getCodigo()); + Assert.assertEquals("4", NFRegimeTributario.MEI.getCodigo()); } @Test @@ -17,15 +18,19 @@ public void deveObterPeloCodigoCorretamente() { Assert.assertEquals(NFRegimeTributario.SIMPLES_NACIONAL, NFRegimeTributario.valueOfCodigo("1")); Assert.assertEquals(NFRegimeTributario.SIMPLES_NACIONAL_EXCESSO_RECEITA, NFRegimeTributario.valueOfCodigo("2")); Assert.assertEquals(NFRegimeTributario.NORMAL, NFRegimeTributario.valueOfCodigo("3")); + Assert.assertEquals(NFRegimeTributario.MEI, NFRegimeTributario.valueOfCodigo("4")); } @Test public void deveObterNuloCasoNaoExistaCodigo() { - Assert.assertNull(NFRegimeTributario.valueOfCodigo("4")); + Assert.assertNull(NFRegimeTributario.valueOfCodigo("5")); } @Test public void deveRetornarStringficadoCorretamente() { Assert.assertEquals("1 - Simples nacional", NFRegimeTributario.SIMPLES_NACIONAL.toString()); + Assert.assertEquals("2 - Simples nacional com excesso de sublimite da receita bruta", NFRegimeTributario.SIMPLES_NACIONAL_EXCESSO_RECEITA.toString()); + Assert.assertEquals("3 - Regime normal", NFRegimeTributario.NORMAL.toString()); + Assert.assertEquals("4 - Simples Nacional - Microempreendedor Individual - MEI", NFRegimeTributario.MEI.toString()); } } \ No newline at end of file diff --git a/src/test/java/com/fincatto/documentofiscal/nfe400/classes/nota/NFNotaInfoItemImpostoICMSSN102Test.java b/src/test/java/com/fincatto/documentofiscal/nfe400/classes/nota/NFNotaInfoItemImpostoICMSSN102Test.java index c0ba61231..403dd7e9c 100755 --- a/src/test/java/com/fincatto/documentofiscal/nfe400/classes/nota/NFNotaInfoItemImpostoICMSSN102Test.java +++ b/src/test/java/com/fincatto/documentofiscal/nfe400/classes/nota/NFNotaInfoItemImpostoICMSSN102Test.java @@ -8,12 +8,12 @@ public class NFNotaInfoItemImpostoICMSSN102Test { - @Test(expected = IllegalStateException.class) - public void naoDevePermitirOrigemNulo() { - final NFNotaInfoItemImpostoICMSSN102 icmssn102 = new NFNotaInfoItemImpostoICMSSN102(); - icmssn102.setSituacaoOperacaoSN(NFNotaSituacaoOperacionalSimplesNacional.IMUNE); - icmssn102.toString(); - } +// @Test(expected = IllegalStateException.class) +// public void naoDevePermitirOrigemNulo() { +// final NFNotaInfoItemImpostoICMSSN102 icmssn102 = new NFNotaInfoItemImpostoICMSSN102(); +// icmssn102.setSituacaoOperacaoSN(NFNotaSituacaoOperacionalSimplesNacional.IMUNE); +// icmssn102.toString(); +// } @Test(expected = IllegalStateException.class) public void naoDevePermitirSituacaoOperacaoSNNulo() { diff --git a/src/test/java/com/fincatto/documentofiscal/nfe400/classes/nota/NFNotaInfoItemImpostoICMSSN900Test.java b/src/test/java/com/fincatto/documentofiscal/nfe400/classes/nota/NFNotaInfoItemImpostoICMSSN900Test.java index 0ac429643..1afe1eb70 100755 --- a/src/test/java/com/fincatto/documentofiscal/nfe400/classes/nota/NFNotaInfoItemImpostoICMSSN900Test.java +++ b/src/test/java/com/fincatto/documentofiscal/nfe400/classes/nota/NFNotaInfoItemImpostoICMSSN900Test.java @@ -164,28 +164,28 @@ public void devePermitirModalidadeDeterminacaoBCICMSNulo() { icms900.toString(); } - @Test(expected = IllegalStateException.class) - public void naoDevePermitirOrigemNulo() { - final NFNotaInfoItemImpostoICMSSN900 icms900 = new NFNotaInfoItemImpostoICMSSN900(); - icms900.setPercentualAliquotaAplicavelCalculoCreditoSN(new BigDecimal("99.99")); - icms900.setPercentualAliquotaImpostoICMSST(new BigDecimal("99.99")); - icms900.setModalidadeBCICMSST(NFNotaInfoItemModalidadeBCICMSST.LISTA_NEGATIVA); - icms900.setModalidadeBCICMS(NFNotaInfoItemModalidadeBCICMS.MVA); - icms900.setPercentualAliquotaImposto(new BigDecimal("99.99")); - icms900.setPercentualMargemValorAdicionadoICMSST(new BigDecimal("99.99")); - icms900.setPercentualReducaoBC(new BigDecimal("99.99")); - icms900.setPercentualReducaoBCICMSST(new BigDecimal("99.99")); - icms900.setSituacaoOperacaoSN(NFNotaSituacaoOperacionalSimplesNacional.IMUNE); - icms900.setValorBCICMS(new BigDecimal("999999999999.99")); - icms900.setValorBCICMSST(new BigDecimal("999999999999.99")); - icms900.setValorCreditoICMSSN(new BigDecimal("999999999999.99")); - icms900.setValorICMS(new BigDecimal("999999999999.99")); - icms900.setValorICMSST(new BigDecimal("999999999999.99")); - icms900.setValorBCFundoCombatePobrezaST(new BigDecimal("999999999999.99")); - icms900.setPercentualFundoCombatePobrezaST(new BigDecimal("99.99")); - icms900.setValorFundoCombatePobrezaST(new BigDecimal("999999999999.99")); - icms900.toString(); - } +// @Test(expected = IllegalStateException.class) +// public void naoDevePermitirOrigemNulo() { +// final NFNotaInfoItemImpostoICMSSN900 icms900 = new NFNotaInfoItemImpostoICMSSN900(); +// icms900.setPercentualAliquotaAplicavelCalculoCreditoSN(new BigDecimal("99.99")); +// icms900.setPercentualAliquotaImpostoICMSST(new BigDecimal("99.99")); +// icms900.setModalidadeBCICMSST(NFNotaInfoItemModalidadeBCICMSST.LISTA_NEGATIVA); +// icms900.setModalidadeBCICMS(NFNotaInfoItemModalidadeBCICMS.MVA); +// icms900.setPercentualAliquotaImposto(new BigDecimal("99.99")); +// icms900.setPercentualMargemValorAdicionadoICMSST(new BigDecimal("99.99")); +// icms900.setPercentualReducaoBC(new BigDecimal("99.99")); +// icms900.setPercentualReducaoBCICMSST(new BigDecimal("99.99")); +// icms900.setSituacaoOperacaoSN(NFNotaSituacaoOperacionalSimplesNacional.IMUNE); +// icms900.setValorBCICMS(new BigDecimal("999999999999.99")); +// icms900.setValorBCICMSST(new BigDecimal("999999999999.99")); +// icms900.setValorCreditoICMSSN(new BigDecimal("999999999999.99")); +// icms900.setValorICMS(new BigDecimal("999999999999.99")); +// icms900.setValorICMSST(new BigDecimal("999999999999.99")); +// icms900.setValorBCFundoCombatePobrezaST(new BigDecimal("999999999999.99")); +// icms900.setPercentualFundoCombatePobrezaST(new BigDecimal("99.99")); +// icms900.setValorFundoCombatePobrezaST(new BigDecimal("999999999999.99")); +// icms900.toString(); +// } @Test public void devePermitirPercentualAliquotaImpostoNulo() {