Skip to content

Commit b17b92e

Browse files
authored
Merge pull request #88 from Hercules-NET/ra/feat-reforma-tributaria
fix: inicio reforma tributária
2 parents 6616b85 + 2bdf795 commit b17b92e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+4791
-1571
lines changed

NFe.AppTeste/ConfiguracaoApp.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ public ConfiguracaoServico CfgServico
5252
public ConfiguracaoCsc ConfiguracaoCsc { get; set; }
5353
public ConfiguracaoDanfeNfce ConfiguracaoDanfeNfce { get; set; }
5454

55+
public bool EnviarTributacaoIbsCbs { get; set; }
56+
5557
/// <summary>
5658
/// Salva os dados de CfgServico em um arquivo XML
5759
/// </summary>

NFe.AppTeste/MainWindow.xaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,13 @@
302302
VerticalAlignment="Top" Width="178"
303303
IsChecked="{Binding CfgServico.RemoverAcentos}"/>
304304
</StackPanel>
305+
306+
<StackPanel Margin="10,10,0,0">
307+
<CheckBox Name="CbxEnviarTributacaoIbsCBS" Content="Enviar Tributação IBS CBS"
308+
HorizontalAlignment="Left"
309+
VerticalAlignment="Top" Width="178"
310+
/>
311+
</StackPanel>
305312
</StackPanel>
306313
</Grid>
307314
</TabItem>

NFe.AppTeste/MainWindow.xaml.cs

Lines changed: 79 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ namespace NFe.AppTeste
5151
{
5252
/// <summary>
5353
/// Interação lógica para MainWindow.xam
54+
/// apenas para iniciar um pull da reforma tributária
5455
/// </summary>
5556
public partial class MainWindow
5657
{
@@ -130,6 +131,7 @@ private void SalvarConfiguracao()
130131
{
131132
try
132133
{
134+
_configuracoes.EnviarTributacaoIbsCbs = CbxEnviarTributacaoIbsCBS.IsChecked ?? false;
133135
_configuracoes.SalvarParaAqruivo(_path + ArquivoConfiguracao);
134136
}
135137
catch (Exception ex)
@@ -160,6 +162,9 @@ private void CarregarConfiguracao()
160162
LogoEmitente.Source = BitmapFrame.Create(stream, BitmapCreateOptions.None, BitmapCacheOption.OnLoad);
161163
}
162164

165+
166+
CbxEnviarTributacaoIbsCBS.IsChecked = _configuracoes.EnviarTributacaoIbsCbs;
167+
163168
#endregion
164169
}
165170
catch (Exception ex)
@@ -758,7 +763,7 @@ private void BtnCriareEnviar3_Click(object sender, RoutedEventArgs e)
758763
if (string.IsNullOrEmpty(lote)) throw new Exception("A Id do lote deve ser informada!");
759764

760765
_nfe = ObterNfeValidada(_configuracoes.CfgServico.VersaoNFeAutorizacao, _configuracoes.CfgServico.ModeloDocumento, Convert.ToInt32(numero), _configuracoes.ConfiguracaoCsc);
761-
766+
762767
var servicoNFe = new ServicosNFe(_configuracoes.CfgServico);
763768
var retornoEnvio = servicoNFe.NFeAutorizacao(Convert.ToInt32(lote), IndicadorSincronizacao.Sincrono, new List<Classes.NFe> { _nfe }, false/*Envia a mensagem compactada para a SEFAZ*/);
764769
//Para consumir o serviço de forma síncrona, use a linha abaixo:
@@ -1461,10 +1466,12 @@ protected virtual enderDest GetEnderecoDestinatario()
14611466

14621467
protected virtual det GetDetalhe(int i, CRT crt, ModeloDocumento modelo)
14631468
{
1469+
var produto = GetProduto(i + 1);
1470+
14641471
var det = new det
14651472
{
14661473
nItem = i + 1,
1467-
prod = GetProduto(i + 1),
1474+
prod = produto,
14681475
imposto = new imposto
14691476
{
14701477
vTotTrib = 0.17m,
@@ -1509,7 +1516,42 @@ protected virtual det GetDetalhe(int i, CRT crt, ModeloDocumento modelo)
15091516

15101517
//Caso você resolva utilizar método ObterPisBasico(), comente esta proxima linha
15111518
TipoPIS = new PISOutr { CST = CSTPIS.pis99, pPIS = 0, vBC = 0, vPIS = 0 }
1512-
}
1519+
},
1520+
1521+
IS = CbxEnviarTributacaoIbsCBS.IsChecked == true ? new IS
1522+
{
1523+
cClassTribIS = cClassTribIS.ctis000001,
1524+
uTrib = "UN",
1525+
qTrib = 1,
1526+
CSTIS = CSTIS.Is000,
1527+
pIS = 0,
1528+
vIS = 0
1529+
} : null,
1530+
1531+
IBSCBS = CbxEnviarTributacaoIbsCBS.IsChecked == true ? new IBSCBS
1532+
{
1533+
CST = CSTIBSCBS.cst000,
1534+
cClassTrib = cClassTrib.ct000001,
1535+
gIBSCBS = new gIBSCBS
1536+
{
1537+
vBC = 0,
1538+
gIBSUF = new gIBSUF
1539+
{
1540+
pIBSUF = 0.10m,
1541+
vIBSUF = 0,
1542+
},
1543+
gIBSMun = new gIBSMun
1544+
{
1545+
pIBSMun = 0,
1546+
vIBSMun = 0,
1547+
},
1548+
gCBS = new gCBS
1549+
{
1550+
pCBS = 0.90m,
1551+
vCBS = 0,
1552+
},
1553+
}
1554+
} : null
15131555
}
15141556
};
15151557

@@ -1736,7 +1778,40 @@ protected virtual total GetTotal(VersaoServico versao, List<det> produtos)
17361778
+ icmsTot.vIPI
17371779
+ icmsTot.vIPIDevol.GetValueOrDefault();
17381780

1739-
var t = new total { ICMSTot = icmsTot };
1781+
var t = new total
1782+
{
1783+
ICMSTot = icmsTot,
1784+
IBSCBSTot = CbxEnviarTributacaoIbsCBS.IsChecked == true ? new IBSCBSTot
1785+
{
1786+
vBCIBSCBS = 0,
1787+
gIBS = new gIBS
1788+
{
1789+
gIBSUF = new gIBSUFTotal
1790+
{
1791+
vDif = 0,
1792+
vDevTrib = 0,
1793+
vIBSUF = 0
1794+
},
1795+
gIBSMun = new gIBSMunTotal
1796+
{
1797+
vDif = 0,
1798+
vDevTrib = 0,
1799+
vIBSMun = 0
1800+
},
1801+
vIBS = 0,
1802+
vCredPres = 0,
1803+
vCredPresCondSus = 0
1804+
},
1805+
gCBS = new gCBSTotal
1806+
{
1807+
vDif = 0,
1808+
vDevTrib = 0,
1809+
vCBS = 0,
1810+
vCredPres = 0,
1811+
vCredPresCondSus = 0
1812+
}
1813+
} : null,
1814+
};
17401815
return t;
17411816
}
17421817

NFe.AppTeste/NFe.AppTeste.csproj

Lines changed: 39 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,9 @@
215215
<SubType>Designer</SubType>
216216
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
217217
</None>
218+
<None Include="Schemas\DFeTiposBasicos_v1.00.xsd">
219+
<SubType>Designer</SubType>
220+
</None>
218221
<None Include="Schemas\distDFeInt_v1.00.xsd">
219222
<SubType>Designer</SubType>
220223
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
@@ -1043,18 +1046,42 @@
10431046
</ProjectReference>
10441047
</ItemGroup>
10451048
<ItemGroup>
1046-
<Content Include="Schemas\e110192_v1.00.xsd" />
1047-
<Content Include="Schemas\e110193_v1.00.xsd" />
1048-
<Content Include="Schemas\envEventoCancInsucessoNFe_v1.00.xsd" />
1049-
<Content Include="Schemas\envEventoInsucessoNFe_v1.00.xsd" />
1050-
<Content Include="Schemas\EventoCancInsucessoNFe_v1.00.xsd" />
1051-
<Content Include="Schemas\EventoInsucessoNFe_v1.00.xsd" />
1052-
<Content Include="Schemas\leiauteEventoCancInsucessoNFe_v1.00.xsd" />
1053-
<Content Include="Schemas\leiauteEventoInsucessoNFe_v1.00.xsd" />
1054-
<Content Include="Schemas\procEventoCancInsucessoNFe_v1.00.xsd" />
1055-
<Content Include="Schemas\procEventoInsucessoNFe_v1.00.xsd" />
1056-
<Content Include="Schemas\retEventoCancInsucessoNFe_v1.00.xsd" />
1057-
<Content Include="Schemas\retEventoInsucessoNFe_v1.00.xsd" />
1049+
<Content Include="Schemas\e110192_v1.00.xsd">
1050+
<SubType>Designer</SubType>
1051+
</Content>
1052+
<Content Include="Schemas\e110193_v1.00.xsd">
1053+
<SubType>Designer</SubType>
1054+
</Content>
1055+
<Content Include="Schemas\envEventoCancInsucessoNFe_v1.00.xsd">
1056+
<SubType>Designer</SubType>
1057+
</Content>
1058+
<Content Include="Schemas\envEventoInsucessoNFe_v1.00.xsd">
1059+
<SubType>Designer</SubType>
1060+
</Content>
1061+
<Content Include="Schemas\EventoCancInsucessoNFe_v1.00.xsd">
1062+
<SubType>Designer</SubType>
1063+
</Content>
1064+
<Content Include="Schemas\EventoInsucessoNFe_v1.00.xsd">
1065+
<SubType>Designer</SubType>
1066+
</Content>
1067+
<Content Include="Schemas\leiauteEventoCancInsucessoNFe_v1.00.xsd">
1068+
<SubType>Designer</SubType>
1069+
</Content>
1070+
<Content Include="Schemas\leiauteEventoInsucessoNFe_v1.00.xsd">
1071+
<SubType>Designer</SubType>
1072+
</Content>
1073+
<Content Include="Schemas\procEventoCancInsucessoNFe_v1.00.xsd">
1074+
<SubType>Designer</SubType>
1075+
</Content>
1076+
<Content Include="Schemas\procEventoInsucessoNFe_v1.00.xsd">
1077+
<SubType>Designer</SubType>
1078+
</Content>
1079+
<Content Include="Schemas\retEventoCancInsucessoNFe_v1.00.xsd">
1080+
<SubType>Designer</SubType>
1081+
</Content>
1082+
<Content Include="Schemas\retEventoInsucessoNFe_v1.00.xsd">
1083+
<SubType>Designer</SubType>
1084+
</Content>
10581085
</ItemGroup>
10591086
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
10601087
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

0 commit comments

Comments
 (0)