Skip to content

Commit 4b591dd

Browse files
committed
feito nova parte de danfe de NFe
1 parent 826b929 commit 4b591dd

File tree

75 files changed

+656
-876
lines changed

Some content is hidden

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

75 files changed

+656
-876
lines changed

DFe.Utils/CertificadoDigitalUtils.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System;
22
using System.Security.Cryptography.X509Certificates;
3-
#if (NETFRAMEWORK || NETCOREAPP)
3+
#if (NETFRAMEWORK)
44
using DFe.Utils.Assinatura;
55
#endif
66
using System.Security;
@@ -10,7 +10,7 @@ namespace DFe.Utils
1010
{
1111
public class CertificadoDigitalUtils
1212
{
13-
#if (NETFRAMEWORK || NETCOREAPP)
13+
#if (NETFRAMEWORK)
1414

1515
/// <summary>
1616
/// Exibe a lista de certificados instalados no PC e devolve o certificado selecionado

DFe.Utils/DFe.Utils.csproj

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
66
</PropertyGroup>
77

8+
<ItemGroup>
9+
<PackageReference Include="System.Security.Cryptography.Xml" Version="6.0.0" />
10+
</ItemGroup>
11+
812
<ItemGroup>
913
<ProjectReference Include="..\DFe.Classes\DFe.Classes.csproj" />
1014
</ItemGroup>

GraphicsPrinter/GraphicsPrinter.csproj

-17
This file was deleted.

GraphicsPrinter/Properties/AssemblyInfo.cs

-35
This file was deleted.

NFe.AppTeste/MainWindow.xaml.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1722,7 +1722,8 @@ private void BtnCupom_Click(object sender, RoutedEventArgs e)
17221722

17231723

17241724
DanfeNativoNfce impr = new DanfeNativoNfce(arquivo,
1725-
_configuracoes.ConfiguracaoDanfeNfce,
1725+
_configuracoes.ConfiguracaoDanfeNfce.VersaoQrCode,
1726+
_configuracoes.ConfiguracaoDanfeNfce.Logomarca,
17261727
_configuracoes.ConfiguracaoCsc.CIdToken,
17271728
_configuracoes.ConfiguracaoCsc.Csc,
17281729
0 /*troco*//*, "Arial Black"*/);
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

NFe.Danfe.AppTeste/NFe.Danfe.AppTeste.csproj NFe.Danfe.AppTeste.Fast/NFe.Danfe.AppTeste.Fast.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
<Name>NFe.Classes</Name>
109109
</ProjectReference>
110110
<ProjectReference Include="..\NFe.Danfe.Base\NFe.Danfe.Base.csproj">
111-
<Project>{7696cc7f-83b7-434a-9759-4fcacc2fd483}</Project>
111+
<Project>{7696CC7F-83B7-434A-9759-4FCACC2FD483}</Project>
112112
<Name>NFe.Danfe.Base</Name>
113113
</ProjectReference>
114114
<ProjectReference Include="..\NFe.Danfe.Fast\NFe.Danfe.Fast.csproj">
File renamed without changes.
File renamed without changes.

NFe.Danfe.AppTeste.NetCore/NFe.Danfe.AppTeste.NetCore.csproj NFe.Danfe.AppTeste.OpenFast/NFe.Danfe.AppTeste.OpenFast.csproj

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
<ProjectReference Include="..\DFe.Classes\DFe.Classes.csproj" />
1010
<ProjectReference Include="..\DFe.Utils\DFe.Utils.csproj" />
1111
<ProjectReference Include="..\NFe.Classes\NFe.Classes.csproj" />
12-
<ProjectReference Include="..\NFe.Danfe.Base\NFe.Danfe.Base.csproj" />
13-
<ProjectReference Include="..\NFe.Danfe.Fast\NFe.Danfe.Fast.csproj" />
12+
<ProjectReference Include="..\NFe.Danfe.OpenFast\NFe.Danfe.OpenFast.csproj" />
1413
<ProjectReference Include="..\NFe.Utils\NFe.Utils.csproj" />
1514
</ItemGroup>
1615

NFe.Danfe.AppTeste.NetCore/Program.cs NFe.Danfe.AppTeste.OpenFast/Program.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
using NFe.Classes.Servicos.Consulta;
55
using NFe.Danfe.Base.NFCe;
66
using NFe.Danfe.Base.NFe;
7-
using NFe.Danfe.Fast.NFCe;
8-
using NFe.Danfe.Fast.NFe;
97
using NFe.Utils.NFe;
108
using System;
119
using System.IO;
1210
using System.Reflection;
1311
using System.Threading.Tasks;
12+
using NFe.Danfe.OpenFast.NFCe;
13+
using NFe.Danfe.OpenFast.NFe;
1414

1515
namespace NFe.Danfe.AppTeste.NetCore
1616
{

NFe.Danfe.AppTeste/NFe.Danfe.AppTeste_gtfi2rxp_wpftmp.csproj

-135
This file was deleted.

NFe.Danfe.Base/ConfiguracaoDanfe.cs

-16
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@
3131
/* Rua Comendador Francisco josé da Cunha, 111 - Itabaiana - SE - 49500-000 */
3232
/********************************************************************************/
3333

34-
using System.Drawing;
35-
using System.IO;
36-
3734
namespace NFe.Danfe.Base
3835
{
3936
public class ConfiguracaoDanfe
@@ -47,18 +44,5 @@ public class ConfiguracaoDanfe
4744
/// Determina se deve ser impresso uma tarja "DOCUMENTO CANCELADO", indicando que o DANFE impresso refere-se ao DANFE de uma NFe cancelada
4845
/// </summary>
4946
public bool DocumentoCancelado { get; set; }
50-
51-
/// <summary>
52-
/// Retorna um objeto do tipo <see cref="Image"/> a partir da logo armazenada na propriedade <see cref="Logomarca"/>
53-
/// </summary>
54-
/// <returns></returns>
55-
public Image ObterLogo()
56-
{
57-
if (Logomarca == null)
58-
return null;
59-
var ms = new MemoryStream(Logomarca);
60-
var image = Image.FromStream(ms);
61-
return image;
62-
}
6347
}
6448
}

NFe.Danfe.Base/FrxFileHelper.cs

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using System;
2+
using System.IO;
3+
using System.Reflection;
4+
5+
namespace NFe.Danfe.Base
6+
{
7+
public static class FrxFileHelper
8+
{
9+
public static byte[] TryGetFrxFile(string caminho)
10+
{
11+
try
12+
{
13+
if (!caminho.EndsWith(".frx"))
14+
{
15+
caminho += ".frx";
16+
}
17+
18+
var path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) ?? throw new InvalidOperationException("Erro no Zeus. Assembly de relatório nao encontrado"), caminho);
19+
var bytes = File.ReadAllBytes(path);
20+
return bytes.Length == 0 ? null : bytes;
21+
}
22+
catch (Exception e)
23+
{
24+
return null;
25+
}
26+
}
27+
}
28+
}

NFe.Danfe.Base/NFCe/ConfiguracaoDanfeNfce.cs

+3-22
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,7 @@
3131
/* Rua Comendador Francisco josé da Cunha, 111 - Itabaiana - SE - 49500-000 */
3232
/********************************************************************************/
3333

34-
using System.Drawing;
35-
using System.Drawing.Text;
36-
using NFe.Danfe.Base.Fontes;
3734
using NFe.Utils;
38-
using NFe.Danfe.Base.Properties;
3935

4036
namespace NFe.Danfe.Base.NFCe
4137
{
@@ -56,7 +52,6 @@ public ConfiguracaoDanfeNfce(NfceDetalheVendaNormal detalheVendaNormal,
5652
MargemDireita = margemDireita;
5753
ModoImpressao = modoImpressao;
5854
NfceLayoutQrCode = nfceLayoutQrCode;
59-
CarregarFontePadraoNfceNativa();
6055
VersaoQrCode = versaoQrCode;
6156
SegundaViaContingencia = true;
6257
}
@@ -116,23 +111,9 @@ public ConfiguracaoDanfeNfce()
116111
/// </summary>
117112
public VersaoQrCode VersaoQrCode { get; set; }
118113

119-
public string FontPadraoNfceNativa { get; set; }
120-
114+
/// <summary>
115+
/// Envia segunda via de contingencia para a impressora (apenas suportado no fastreport clássico)
116+
/// </summary>
121117
public bool SegundaViaContingencia { get; set; }
122-
123-
public FontFamily CarregarFontePadraoNfceNativa(string font = null)
124-
{
125-
if (font != null)
126-
{
127-
FontPadraoNfceNativa = font;
128-
return new FontFamily(font);
129-
}
130-
131-
132-
PrivateFontCollection colecaoDeFontes; //todo dispose na coleção
133-
var openSans = Fonte.CarregarDeByteArray(Resources.OpenSans_CondBold, out colecaoDeFontes);
134-
135-
return openSans;
136-
}
137118
}
138119
}
File renamed without changes.

NFe.Danfe.Base/NFe.Danfe.Base.csproj

+22
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,28 @@
2323
</PackageReference>
2424
</ItemGroup>
2525

26+
<ItemGroup>
27+
<None Remove="NFCe\NFCe.frx" />
28+
<None Remove="NFe\NFeEvento.frx" />
29+
<None Remove="NFe\NFeRetrato.frx" />
30+
<None Remove="NFe\NFeSimplificado.frx" />
31+
</ItemGroup>
32+
33+
<ItemGroup>
34+
<Content Include="NFCe\NFCe.frx">
35+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
36+
</Content>
37+
<Content Include="NFe\NFeEvento.frx">
38+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
39+
</Content>
40+
<Content Include="NFe\NFeRetrato.frx">
41+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
42+
</Content>
43+
<Content Include="NFe\NFeSimplificado.frx">
44+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
45+
</Content>
46+
</ItemGroup>
47+
2648
<ItemGroup>
2749
<ProjectReference Include="..\NFe.Utils\NFe.Utils.csproj" />
2850
</ItemGroup>
File renamed without changes.

0 commit comments

Comments
 (0)