Compare commits
2 Commits
8efd900bb5
...
0fb1a59d44
| Author | SHA1 | Date | |
|---|---|---|---|
| 0fb1a59d44 | |||
| 874eabe87a |
@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0-windows10.0.17763.0</TargetFramework>
|
||||
<TargetFramework>net9.0-windows10.0.17763.0</TargetFramework>
|
||||
<RootNamespace>Download_Faturas</RootNamespace>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
@ -27,21 +27,22 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="itext7" Version="9.0.0" />
|
||||
<PackageReference Include="itext7.bouncy-castle-adapter" Version="9.0.0" />
|
||||
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="System.Data.OleDb" Version="9.0.0" />
|
||||
<PackageReference Include="System.Text.Json" Version="9.0.0" />
|
||||
<PackageReference Include="XUnit" Version="2.9.3" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.1">
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Faturas\Faturas.csproj" />
|
||||
<ProjectReference Include="..\Faturas\Faturas.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="Properties\Resources.Designer.cs">
|
||||
<DesignTime>True</DesignTime>
|
||||
|
||||
@ -4,13 +4,13 @@
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1010:Opening square brackets should be spaced correctly", Justification = "<Pendente>", Scope = "member", Target = "~M:Download_Faturas.Fatura.Processar(System.Data.OleDb.OleDbConnection)")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1011:Closing square brackets should be spaced correctly", Justification = "<Pendente>", Scope = "member", Target = "~M:Download_Faturas.FloatArrayOrSingleConverter.Read(System.Text.Json.Utf8JsonReader@,System.Type,System.Text.Json.JsonSerializerOptions)~System.Single[]")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1009:Closing parenthesis should be spaced correctly", Justification = "<Pendente>", Scope = "type", Target = "~T:Download_Faturas.CustomPdfSplitter")]
|
||||
[assembly: SuppressMessage("Performance", "SYSLIB1045:Converter em 'GeneratedRegexAttribute'.", Justification = "<Pendente>", Scope = "member", Target = "~M:Download_Faturas.Fatura.Processar(System.Data.OleDb.OleDbConnection)")]
|
||||
[assembly: SuppressMessage("Style", "IDE0063:Usar a instrução 'using' simples", Justification = "<Pendente>", Scope = "member", Target = "~M:Download_Faturas.Fatura.Processar(System.Data.OleDb.OleDbConnection)")]
|
||||
[assembly: SuppressMessage("Performance", "SYSLIB1045:Converter em 'GeneratedRegexAttribute'.", Justification = "<Pendente>", Scope = "member", Target = "~M:Download_Faturas.FaturaOld.Processar(System.Data.OleDb.OleDbConnection)")]
|
||||
[assembly: SuppressMessage("Style", "IDE0063:Usar a instrução 'using' simples", Justification = "<Pendente>", Scope = "member", Target = "~M:Download_Faturas.FaturaOld.Processar(System.Data.OleDb.OleDbConnection)")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1010:Opening square brackets should be spaced correctly", Justification = "<Pendente>", Scope = "member", Target = "~M:Download_Faturas.FaturaOld.Processar(System.Data.OleDb.OleDbConnection)")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1010:Opening square brackets should be spaced correctly", Justification = "<Pendente>", Scope = "member", Target = "~M:Download_Faturas.FloatArrayOrSingleConverter.Read(System.Text.Json.Utf8JsonReader@,System.Type,System.Text.Json.JsonSerializerOptions)~System.Single[]")]
|
||||
[assembly: SuppressMessage("Style", "IDE0063:Usar a instrução 'using' simples", Justification = "<Pendente>", Scope = "member", Target = "~M:Download_Faturas.Program.Main")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1010:Opening square brackets should be spaced correctly", Justification = "<Pendente>", Scope = "member", Target = "~M:Faturas.Fatura.Processar(System.Data.OleDb.OleDbConnection)")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1011:Closing square brackets should be spaced correctly", Justification = "<Pendente>", Scope = "member", Target = "~M:Faturas.FloatArrayOrSingleConverter.Read(System.Text.Json.Utf8JsonReader@,System.Type,System.Text.Json.JsonSerializerOptions)~System.Single[]")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1009:Closing parenthesis should be spaced correctly", Justification = "<Pendente>", Scope = "type", Target = "~T:Faturas.CustomPdfSplitter")]
|
||||
[assembly: SuppressMessage("Performance", "SYSLIB1045:Converter em 'GeneratedRegexAttribute'.", Justification = "<Pendente>", Scope = "member", Target = "~M:Faturas.Fatura.Processar(System.Data.OleDb.OleDbConnection)")]
|
||||
[assembly: SuppressMessage("Style", "IDE0063:Usar a instrução 'using' simples", Justification = "<Pendente>", Scope = "member", Target = "~M:Faturas.Fatura.Processar(System.Data.OleDb.OleDbConnection)")]
|
||||
[assembly: SuppressMessage("Performance", "SYSLIB1045:Converter em 'GeneratedRegexAttribute'.", Justification = "<Pendente>", Scope = "member", Target = "~M:Faturas.FaturaOld.Processar(System.Data.OleDb.OleDbConnection)")]
|
||||
[assembly: SuppressMessage("Style", "IDE0063:Usar a instrução 'using' simples", Justification = "<Pendente>", Scope = "member", Target = "~M:Faturas.FaturaOld.Processar(System.Data.OleDb.OleDbConnection)")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1010:Opening square brackets should be spaced correctly", Justification = "<Pendente>", Scope = "member", Target = "~M:Faturas.FaturaOld.Processar(System.Data.OleDb.OleDbConnection)")]
|
||||
[assembly: SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1010:Opening square brackets should be spaced correctly", Justification = "<Pendente>", Scope = "member", Target = "~M:Faturas.FloatArrayOrSingleConverter.Read(System.Text.Json.Utf8JsonReader@,System.Type,System.Text.Json.JsonSerializerOptions)~System.Single[]")]
|
||||
[assembly: SuppressMessage("Style", "IDE0063:Usar a instrução 'using' simples", Justification = "<Pendente>", Scope = "member", Target = "~M:Faturas.Program.Main")]
|
||||
|
||||
@ -5,11 +5,8 @@
|
||||
namespace Download_Faturas
|
||||
{
|
||||
using System.Data.OleDb;
|
||||
using System.Globalization;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Text.RegularExpressions;
|
||||
using Faturas;
|
||||
|
||||
/// <summary>
|
||||
/// Main program class for processing invoices.
|
||||
|
||||
@ -14,7 +14,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
|
||||
.editorconfig = .editorconfig
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Download Faturas.Tests", "Download Faturas.Tests\Download Faturas.Tests.csproj", "{67A025C1-B7A4-48D0-8157-C0BBA550469F}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Faturas.Tests", "Faturas.Tests\Faturas.Tests.csproj", "{67A025C1-B7A4-48D0-8157-C0BBA550469F}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Faturas", "Faturas\Faturas.csproj", "{E0184772-C161-441B-8872-4BCBA20E4B47}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@ -38,6 +40,10 @@ Global
|
||||
{67A025C1-B7A4-48D0-8157-C0BBA550469F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{67A025C1-B7A4-48D0-8157-C0BBA550469F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{67A025C1-B7A4-48D0-8157-C0BBA550469F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{E0184772-C161-441B-8872-4BCBA20E4B47}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E0184772-C161-441B-8872-4BCBA20E4B47}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E0184772-C161-441B-8872-4BCBA20E4B47}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E0184772-C161-441B-8872-4BCBA20E4B47}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
using System.Data.OleDb;
|
||||
using System.Numerics;
|
||||
using Faturas;
|
||||
using System.Text.Json;
|
||||
using Download_Faturas;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0-windows10.0.17763.0</TargetFramework>
|
||||
<TargetFramework>net9.0-windows10.0.17763.0</TargetFramework>
|
||||
<RootNamespace>Download_Faturas.Tests</RootNamespace>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
@ -10,12 +10,12 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="coverlet.collector" Version="6.0.2" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
|
||||
<PackageReference Include="xunit" Version="2.9.3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Download Faturas\Download Faturas.csproj" />
|
||||
<ProjectReference Include="..\Faturas\Faturas.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@ -5,6 +5,6 @@
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
[assembly: SuppressMessage("Style", "IDE0063:Usar a instrução 'using' simples", Justification = "<Pendente>", Scope = "member", Target = "~M:Download_Faturas.Tests.FaturaIntegrationTests.DeleteTusdRecords(System.Data.OleDb.OleDbConnection,System.Double)")]
|
||||
[assembly: SuppressMessage("Style", "IDE0063:Usar a instrução 'using' simples", Justification = "<Pendente>", Scope = "member", Target = "~M:Download_Faturas.Tests.FaturaIntegrationTests.GetDadosTusd(System.Data.OleDb.OleDbConnection,System.Double)~Download_Faturas.RecordSet")]
|
||||
[assembly: SuppressMessage("Style", "IDE0063:Usar a instrução 'using' simples", Justification = "<Pendente>", Scope = "member", Target = "~M:Download_Faturas.Tests.FaturaIntegrationTests.WriteCsv(System.String,System.Collections.Generic.List{System.String})")]
|
||||
[assembly: SuppressMessage("Style", "IDE0063:Usar a instrução 'using' simples", Justification = "<Pendente>", Scope = "member", Target = "~M:Faturas.Tests.FaturaIntegrationTests.DeleteTusdRecords(System.Data.OleDb.OleDbConnection,System.Double)")]
|
||||
[assembly: SuppressMessage("Style", "IDE0063:Usar a instrução 'using' simples", Justification = "<Pendente>", Scope = "member", Target = "~M:Faturas.Tests.FaturaIntegrationTests.GetDadosTusd(System.Data.OleDb.OleDbConnection,System.Double)~Faturas.RecordSet")]
|
||||
[assembly: SuppressMessage("Style", "IDE0063:Usar a instrução 'using' simples", Justification = "<Pendente>", Scope = "member", Target = "~M:Faturas.Tests.FaturaIntegrationTests.WriteCsv(System.String,System.Collections.Generic.List{System.String})")]
|
||||
@ -1,18 +1,9 @@
|
||||
// <copyright file="CustomPdfSplitter.cs" company="Smart Energia">
|
||||
// <copyright file="CustomPdfSplitter.cs" company="Smart Energia">
|
||||
// Copyright (c) Smart Energia. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace Download_Faturas
|
||||
namespace Faturas
|
||||
{
|
||||
using System.Data.OleDb;
|
||||
using System.Globalization;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Reflection;
|
||||
using System.Reflection.Metadata.Ecma335;
|
||||
using System.Runtime.Intrinsics.X86;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Text.RegularExpressions;
|
||||
using iText.Kernel.Pdf;
|
||||
using iText.Kernel.Utils;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
// <copyright file="DefaultDateTimeConverter.cs" company="Smart Energia">
|
||||
// Copyright (c) Smart Energia. All rights reserved.
|
||||
// </copyright>
|
||||
namespace Download_Faturas
|
||||
namespace Faturas
|
||||
{
|
||||
using System;
|
||||
using System.Text.Json;
|
||||
@ -2,19 +2,14 @@
|
||||
// Copyright (c) Smart Energia. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace Download_Faturas
|
||||
namespace Faturas
|
||||
{
|
||||
using System.Data.OleDb;
|
||||
using System.Globalization;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Reflection;
|
||||
using System.Reflection.Metadata.Ecma335;
|
||||
using System.Runtime.Intrinsics.X86;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Text.RegularExpressions;
|
||||
using iText.Kernel.Pdf;
|
||||
using iText.Kernel.Utils;
|
||||
|
||||
/// <summary>
|
||||
/// Representa uma fatura eletrônica e fornece métodos para processá-la e movê-la.
|
||||
@ -46,20 +41,20 @@ namespace Download_Faturas
|
||||
HttpResponseMessage fatura_response = GetStatus(httpClient, Token, id);
|
||||
if (fatura_response.IsSuccessStatusCode)
|
||||
{
|
||||
this.faturaParsed = JsonDocument.Parse(fatura_response.Content.ReadAsStringAsync().Result).RootElement;
|
||||
this.Agrupada = this.faturaParsed.TryGetProperty("multiple", out var _);
|
||||
this.Status = this.faturaParsed.GetProperty("status").GetString();
|
||||
this.Arquivo = new FileInfo(fatura_path);
|
||||
faturaParsed = JsonDocument.Parse(fatura_response.Content.ReadAsStringAsync().Result).RootElement;
|
||||
Agrupada = faturaParsed.TryGetProperty("multiple", out var _);
|
||||
Status = faturaParsed.GetProperty("status").GetString();
|
||||
Arquivo = new FileInfo(fatura_path);
|
||||
this.id = id;
|
||||
|
||||
if (this.faturaParsed.GetProperty("external").GetString() is not null)
|
||||
if (faturaParsed.GetProperty("external").GetString() is not null)
|
||||
{
|
||||
this.pagina = JsonDocument.Parse(this.faturaParsed.GetProperty("external").GetString() !).RootElement.GetProperty("origin")[0].GetProperty("page").GetInt32();
|
||||
pagina = JsonDocument.Parse(faturaParsed.GetProperty("external").GetString() !).RootElement.GetProperty("origin")[0].GetProperty("page").GetInt32();
|
||||
}
|
||||
|
||||
if (this.Agrupada)
|
||||
if (Agrupada)
|
||||
{
|
||||
this.Agrupada_children = this.faturaParsed.GetProperty("children").EnumerateArray();
|
||||
Agrupada_children = faturaParsed.GetProperty("children").EnumerateArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -74,8 +69,8 @@ namespace Download_Faturas
|
||||
{
|
||||
// Utilizado para gerar novo token
|
||||
// this.token = Req_token(HttpClient).ToString();
|
||||
this.faturaParsed = fatura_Parsed;
|
||||
this.Agrupada = false;
|
||||
faturaParsed = fatura_Parsed;
|
||||
Agrupada = false;
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@ -136,18 +131,18 @@ namespace Download_Faturas
|
||||
public void Processar(OleDbConnection conn)
|
||||
{
|
||||
// Resultado da fatura processada
|
||||
if (!this.faturaParsed.TryGetProperty("result", out JsonElement a))
|
||||
if (!faturaParsed.TryGetProperty("result", out JsonElement a))
|
||||
{
|
||||
this.faturaParsed.TryGetProperty("json", out a);
|
||||
faturaParsed.TryGetProperty("json", out a);
|
||||
}
|
||||
|
||||
Rootobject parsedResult = JsonSerializer.Deserialize<Rootobject>(a) !;
|
||||
Rootobject parsedResult = a.Deserialize<Rootobject>() !;
|
||||
if (parsedResult == null || parsedResult.dates == null || parsedResult.dates.reading == null || parsedResult.locationNumber == null || parsedResult.customer == null || parsedResult.items == null || parsedResult.dates.reading.periodUntil == DateTime.MinValue)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
this.dadosTusd.Mes = int.Parse(parsedResult.dates.reading.periodUntil.AddDays(-15).ToString("yMM"));
|
||||
dadosTusd.Mes = int.Parse(parsedResult.dates.reading.periodUntil.AddDays(-15).ToString("yMM"));
|
||||
|
||||
string uc = new Regex("^0+").Replace(parsedResult.locationNumber, string.Empty).Replace("/", string.Empty).Replace("-", string.Empty).Replace(".", string.Empty);
|
||||
|
||||
@ -188,29 +183,29 @@ namespace Download_Faturas
|
||||
while (reader.Read())
|
||||
{
|
||||
// Dados cadastrais
|
||||
this.dadosTusd.Cod_Smart_unidade = long.Parse(reader["Cod_Smart_unidade"].ToString() !);
|
||||
this.dadosTusd.Perfil_CliqCCEE = reader["PerfilCCEE"].ToString();
|
||||
this.dadosTusd.Submercado = reader["Submercado"].ToString();
|
||||
dadosTusd.Cod_Smart_unidade = long.Parse(reader["Cod_Smart_unidade"].ToString() !);
|
||||
dadosTusd.Perfil_CliqCCEE = reader["PerfilCCEE"].ToString();
|
||||
dadosTusd.Submercado = reader["Submercado"].ToString();
|
||||
DateTime dataMigração = DateTime.Parse(reader["Data_de_Migracao"].ToString() !);
|
||||
if (int.Parse(dataMigração.ToString("yMM")) <= this.dadosTusd.Mes)
|
||||
if (int.Parse(dataMigração.ToString("yMM")) <= dadosTusd.Mes)
|
||||
{
|
||||
this.dadosTusd.Ambiente = reader["Status_unidade"].ToString();
|
||||
dadosTusd.Ambiente = reader["Status_unidade"].ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.dadosTusd.Ambiente = "Cativo";
|
||||
dadosTusd.Ambiente = "Cativo";
|
||||
}
|
||||
|
||||
this.dadosTusd.Grupo = reader["Grupo"].ToString();
|
||||
this.dadosTusd.Distribuidora = reader["Distribuidora"].ToString();
|
||||
this.dadosTusd.ICMS = float.Parse(reader["ICMS_TUSD"].ToString() !);
|
||||
this.dadosTusd.Dem_Cont_P = float.Parse(reader["Demanda_P"].ToString() !);
|
||||
this.dadosTusd.Dem_Cont_FP = float.Parse(reader["Demanda_FP"].ToString() !);
|
||||
this.dadosTusd.Perfil = reader["Perfil"].ToString();
|
||||
this.PastaTUSD = new DirectoryInfo(reader["Caminho_NFs"].ToString() !.Replace("\\NFe", string.Empty, StringComparison.OrdinalIgnoreCase) + "\\TUSD");
|
||||
this.Gestao = reader["Gestao"].ToString();
|
||||
this.Empresa = reader["Cliente"].ToString();
|
||||
this.Unidade = reader["Unidade"].ToString();
|
||||
dadosTusd.Grupo = reader["Grupo"].ToString();
|
||||
dadosTusd.Distribuidora = reader["Distribuidora"].ToString();
|
||||
dadosTusd.ICMS = float.Parse(reader["ICMS_TUSD"].ToString() !);
|
||||
dadosTusd.Dem_Cont_P = float.Parse(reader["Demanda_P"].ToString() !);
|
||||
dadosTusd.Dem_Cont_FP = float.Parse(reader["Demanda_FP"].ToString() !);
|
||||
dadosTusd.Perfil = reader["Perfil"].ToString();
|
||||
PastaTUSD = new DirectoryInfo(reader["Caminho_NFs"].ToString() !.Replace("\\NFe", string.Empty, StringComparison.OrdinalIgnoreCase) + "\\TUSD");
|
||||
Gestao = reader["Gestao"].ToString();
|
||||
Empresa = reader["Cliente"].ToString();
|
||||
Unidade = reader["Unidade"].ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -221,8 +216,8 @@ namespace Download_Faturas
|
||||
sqlQuery = $"SELECT Cod_TUSD FROM Dados_TUSD WHERE Cod_TUSD = ?";
|
||||
using (OleDbCommand cmd = new (sqlQuery, conn))
|
||||
{
|
||||
this.CodTusd = double.Parse(this.dadosTusd.Cod_Smart_unidade.ToString() + this.dadosTusd.Mes.ToString());
|
||||
cmd.Parameters.AddWithValue("?", this.CodTusd);
|
||||
CodTusd = double.Parse(dadosTusd.Cod_Smart_unidade.ToString() + dadosTusd.Mes.ToString());
|
||||
cmd.Parameters.AddWithValue("?", CodTusd);
|
||||
|
||||
using (OleDbDataReader reader = cmd.ExecuteReader())
|
||||
{
|
||||
@ -230,18 +225,18 @@ namespace Download_Faturas
|
||||
}
|
||||
}
|
||||
|
||||
if (this.dadosTusd.Cod_Smart_unidade == 0)
|
||||
if (dadosTusd.Cod_Smart_unidade == 0)
|
||||
{
|
||||
this.Status = "UNIDADE CONSUMIDORA NÃO LOCALIZADA NO BD";
|
||||
Status = "UNIDADE CONSUMIDORA NÃO LOCALIZADA NO BD";
|
||||
this.uc = uc;
|
||||
this.Mes = this.dadosTusd.Mes;
|
||||
Mes = dadosTusd.Mes;
|
||||
return;
|
||||
}
|
||||
else if (tusdLanc)
|
||||
{
|
||||
this.Status = "FATURA DUPLICADA NO BD";
|
||||
Status = "FATURA DUPLICADA NO BD";
|
||||
this.uc = uc;
|
||||
this.Mes = this.dadosTusd.Mes;
|
||||
Mes = dadosTusd.Mes;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -250,62 +245,62 @@ namespace Download_Faturas
|
||||
|
||||
using (OleDbCommand cmd = new (sqlQuery, conn))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("?", this.dadosTusd.Mes.ToString());
|
||||
cmd.Parameters.AddWithValue("?", this.dadosTusd.Distribuidora);
|
||||
cmd.Parameters.AddWithValue("?", dadosTusd.Mes.ToString());
|
||||
cmd.Parameters.AddWithValue("?", dadosTusd.Distribuidora);
|
||||
|
||||
using (OleDbDataReader reader = cmd.ExecuteReader())
|
||||
{
|
||||
while (reader.Read())
|
||||
{
|
||||
// PIS e Cofins
|
||||
this.dadosTusd.PIS = float.Parse(reader["PIS"].ToString() !);
|
||||
this.dadosTusd.COFINS = float.Parse(reader["COFINS"].ToString() !);
|
||||
dadosTusd.PIS = float.Parse(reader["PIS"].ToString() !);
|
||||
dadosTusd.COFINS = float.Parse(reader["COFINS"].ToString() !);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Dados da fatura processada
|
||||
this.dadosTusd.Cod_TUSD = long.Parse(this.dadosTusd.Cod_Smart_unidade.ToString() + this.dadosTusd.Mes.ToString());
|
||||
dadosTusd.Cod_TUSD = long.Parse(dadosTusd.Cod_Smart_unidade.ToString() + dadosTusd.Mes.ToString());
|
||||
switch (parsedResult.tariffModality, parsedResult.subgroup)
|
||||
{
|
||||
case ("blue", _):
|
||||
this.dadosTusd.Perfil = "AZUL";
|
||||
dadosTusd.Perfil = "AZUL";
|
||||
break;
|
||||
|
||||
case ("green", _):
|
||||
this.dadosTusd.Perfil = "VERDE";
|
||||
dadosTusd.Perfil = "VERDE";
|
||||
break;
|
||||
|
||||
case ("standart", _):
|
||||
this.dadosTusd.Perfil = "CONVENCIONAL";
|
||||
dadosTusd.Perfil = "CONVENCIONAL";
|
||||
break;
|
||||
|
||||
case (_, "B3"):
|
||||
this.dadosTusd.Perfil = "CONVENCIONAL";
|
||||
dadosTusd.Perfil = "CONVENCIONAL";
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
this.dadosTusd.Valor = parsedResult.totalCharges;
|
||||
this.dadosTusd.Inicio_Leitura = parsedResult.dates.reading.periodFrom;
|
||||
this.dadosTusd.Fim_leitura = parsedResult.dates.reading.periodUntil;
|
||||
dadosTusd.Valor = parsedResult.totalCharges;
|
||||
dadosTusd.Inicio_Leitura = parsedResult.dates.reading.periodFrom;
|
||||
dadosTusd.Fim_leitura = parsedResult.dates.reading.periodUntil;
|
||||
DateTime d = DateTime.Now;
|
||||
this.dadosTusd.Hora_TUSD = new DateTime(d.Year, d.Month, d.Day, d.Hour, d.Minute, d.Second);
|
||||
this.dadosTusd.Dem_Reativa_kvar = 0;
|
||||
this.dadosTusd.Multa = 0;
|
||||
this.dadosTusd.Credito = 0;
|
||||
this.dadosTusd.Bandeira_RS_MWh = 0;
|
||||
this.dadosTusd.FIC_DIC = 0;
|
||||
this.dadosTusd.Enc_conexao = 0;
|
||||
this.dadosTusd.Liminar_ICMS = 0;
|
||||
this.dadosTusd.Outros = 0;
|
||||
this.dadosTusd.Cred_livre = 0;
|
||||
this.dadosTusd.Tempo_TUSD = 0;
|
||||
this.dadosTusd.Lanc_aut = true;
|
||||
this.dadosTusd.Rev_atual = true;
|
||||
this.dadosTusd.Revisao = 0;
|
||||
dadosTusd.Hora_TUSD = new DateTime(d.Year, d.Month, d.Day, d.Hour, d.Minute, d.Second);
|
||||
dadosTusd.Dem_Reativa_kvar = 0;
|
||||
dadosTusd.Multa = 0;
|
||||
dadosTusd.Credito = 0;
|
||||
dadosTusd.Bandeira_RS_MWh = 0;
|
||||
dadosTusd.FIC_DIC = 0;
|
||||
dadosTusd.Enc_conexao = 0;
|
||||
dadosTusd.Liminar_ICMS = 0;
|
||||
dadosTusd.Outros = 0;
|
||||
dadosTusd.Cred_livre = 0;
|
||||
dadosTusd.Tempo_TUSD = 0;
|
||||
dadosTusd.Lanc_aut = true;
|
||||
dadosTusd.Rev_atual = true;
|
||||
dadosTusd.Revisao = 0;
|
||||
|
||||
// Loop entre os dados faturados na fatura
|
||||
int j = 0;
|
||||
@ -329,9 +324,9 @@ namespace Download_Faturas
|
||||
|
||||
if (item.kind == kind_P || item.kind == "TUSD")
|
||||
{
|
||||
if ((item.billed / 1000) != this.dadosTusd.Consumo_P)
|
||||
if (item.billed / 1000 != dadosTusd.Consumo_P)
|
||||
{
|
||||
this.dadosTusd.Consumo_P += item.billed / 1000;
|
||||
dadosTusd.Consumo_P += item.billed / 1000;
|
||||
}
|
||||
}
|
||||
|
||||
@ -348,9 +343,9 @@ namespace Download_Faturas
|
||||
|
||||
if (item.kind == kind_FP)
|
||||
{
|
||||
if ((item.billed / 1000) != this.dadosTusd.Consumo_FP)
|
||||
if (item.billed / 1000 != dadosTusd.Consumo_FP)
|
||||
{
|
||||
this.dadosTusd.Consumo_FP += item.billed / 1000;
|
||||
dadosTusd.Consumo_FP += item.billed / 1000;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -368,16 +363,16 @@ namespace Download_Faturas
|
||||
{
|
||||
if (item.period == "peak")
|
||||
{
|
||||
this.dadosTusd.Dem_Reg_P = item.billed;
|
||||
this.dadosTusd.Dem_Cont_P = item.contract;
|
||||
dadosTusd.Dem_Reg_P = item.billed;
|
||||
dadosTusd.Dem_Cont_P = item.contract;
|
||||
}
|
||||
else if (item.period == "off-peak")
|
||||
{
|
||||
this.dadosTusd.Dem_Reg_FP = item.billed;
|
||||
this.dadosTusd.Dem_Cont_FP = item.contract;
|
||||
dadosTusd.Dem_Reg_FP = item.billed;
|
||||
dadosTusd.Dem_Cont_FP = item.contract;
|
||||
}
|
||||
|
||||
if (this.dadosTusd.Perfil == "AZUL")
|
||||
if (dadosTusd.Perfil == "AZUL")
|
||||
{
|
||||
if (item.period == "peak")
|
||||
{
|
||||
@ -385,7 +380,7 @@ namespace Download_Faturas
|
||||
using (OleDbCommand cmd = new (sqlQuery, conn))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("@demanda", item.contract);
|
||||
cmd.Parameters.AddWithValue("@cod_smart_unidade", this.dadosTusd.Cod_Smart_unidade);
|
||||
cmd.Parameters.AddWithValue("@cod_smart_unidade", dadosTusd.Cod_Smart_unidade);
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
@ -395,18 +390,18 @@ namespace Download_Faturas
|
||||
using (OleDbCommand cmd = new (sqlQuery, conn))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("@demanda", item.contract);
|
||||
cmd.Parameters.AddWithValue("@cod_smart_unidade", this.dadosTusd.Cod_Smart_unidade);
|
||||
cmd.Parameters.AddWithValue("@cod_smart_unidade", dadosTusd.Cod_Smart_unidade);
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (this.dadosTusd.Perfil == "VERDE")
|
||||
else if (dadosTusd.Perfil == "VERDE")
|
||||
{
|
||||
sqlQuery = $"UPDATE Dados_cadastrais SET Demanda_P = @demanda, Demanda_FP = @demanda WHERE Cod_Smart_unidade = @cod_smart_unidade";
|
||||
using (OleDbCommand cmd = new (sqlQuery, conn))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("@demanda", item.contract);
|
||||
cmd.Parameters.AddWithValue("@cod_smart_unidade", this.dadosTusd.Cod_Smart_unidade);
|
||||
cmd.Parameters.AddWithValue("@cod_smart_unidade", dadosTusd.Cod_Smart_unidade);
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
@ -416,22 +411,22 @@ namespace Download_Faturas
|
||||
|
||||
// Ilum. publica
|
||||
case ("publicLighting", _):
|
||||
this.dadosTusd.Ilum_Publica = item.charge;
|
||||
dadosTusd.Ilum_Publica = item.charge;
|
||||
break;
|
||||
|
||||
// Energia Reativa
|
||||
case ("excessReactiveEnergy", _):
|
||||
this.dadosTusd.En_Reativa_Mvarh += item.billed / 1000;
|
||||
dadosTusd.En_Reativa_Mvarh += item.billed / 1000;
|
||||
break;
|
||||
|
||||
// Demanda Reativa
|
||||
case ("excessReactiveDemand", _):
|
||||
this.dadosTusd.Dem_Reativa_kvar += item.billed;
|
||||
dadosTusd.Dem_Reativa_kvar += item.billed;
|
||||
break;
|
||||
|
||||
// Bandeira Tarifaria
|
||||
case ("flagSurcharge", _):
|
||||
this.dadosTusd.Bandeira_RS_MWh = item.charge;
|
||||
dadosTusd.Bandeira_RS_MWh = item.charge;
|
||||
break;
|
||||
|
||||
// Items não classificados
|
||||
@ -444,7 +439,7 @@ namespace Download_Faturas
|
||||
sqlQuery = $"DELETE FROM Dados_TUSD_aux WHERE Cod_TUSD = @cod_tusd";
|
||||
using (OleDbCommand cmd = new (sqlQuery, conn))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("@cod_tusd", this.dadosTusd.Cod_TUSD);
|
||||
cmd.Parameters.AddWithValue("@cod_tusd", dadosTusd.Cod_TUSD);
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
@ -486,22 +481,22 @@ namespace Download_Faturas
|
||||
}
|
||||
}
|
||||
|
||||
if (dem_Reg_P != null && (Math.Round((decimal)this.dadosTusd.Consumo_FP, 2) == Math.Round((decimal)(consumo_Reg_FP * 1.025 / 1000) !, 2)))
|
||||
if (dem_Reg_P != null && Math.Round((decimal)dadosTusd.Consumo_FP, 2) == Math.Round((decimal)(consumo_Reg_FP * 1.025 / 1000) !, 2))
|
||||
{
|
||||
this.dadosTusd.Dem_Reg_P = (float)(dem_Reg_P * 1.025);
|
||||
dadosTusd.Dem_Reg_P = (float)(dem_Reg_P * 1.025);
|
||||
}
|
||||
else if (dem_Reg_P != null)
|
||||
{
|
||||
this.dadosTusd.Dem_Reg_P = (float)dem_Reg_P;
|
||||
dadosTusd.Dem_Reg_P = (float)dem_Reg_P;
|
||||
}
|
||||
|
||||
if (dem_Reg_FP != null && (Math.Round((decimal)this.dadosTusd.Consumo_FP, 2) == Math.Round((decimal)(consumo_Reg_FP * 1.025 / 1000) !, 2)))
|
||||
if (dem_Reg_FP != null && Math.Round((decimal)dadosTusd.Consumo_FP, 2) == Math.Round((decimal)(consumo_Reg_FP * 1.025 / 1000) !, 2))
|
||||
{
|
||||
this.dadosTusd.Dem_Reg_FP = (float)(dem_Reg_FP * 1.025);
|
||||
dadosTusd.Dem_Reg_FP = (float)(dem_Reg_FP * 1.025);
|
||||
}
|
||||
else if (dem_Reg_FP != null)
|
||||
{
|
||||
this.dadosTusd.Dem_Reg_FP = dem_Reg_FP ?? 0;
|
||||
dadosTusd.Dem_Reg_FP = dem_Reg_FP ?? 0;
|
||||
}
|
||||
|
||||
// var dados = this.dadosTusd.GetType().GetProperties();
|
||||
@ -532,12 +527,12 @@ namespace Download_Faturas
|
||||
foreach (PropertyInfo propriedade in propriedades)
|
||||
{
|
||||
string nomeColuna = propriedade.Name;
|
||||
object valorColuna = propriedade.GetValue(this.dadosTusd) ?? string.Empty;
|
||||
object valorColuna = propriedade.GetValue(dadosTusd) ?? string.Empty;
|
||||
cmd.Parameters.AddWithValue($"@{nomeColuna}", valorColuna);
|
||||
}
|
||||
|
||||
// Valor do código TUSD na cláusula WHERE
|
||||
cmd.Parameters.AddWithValue("@cod_tusd", this.dadosTusd.Cod_TUSD);
|
||||
cmd.Parameters.AddWithValue("@cod_tusd", dadosTusd.Cod_TUSD);
|
||||
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
@ -549,7 +544,7 @@ namespace Download_Faturas
|
||||
sqlQuery = "INSERT INTO Dados_TUSD_aux (Cod_TUSD,Id,Nome,Valor,Cod_lanc) VALUES (@cod_tusd, @j, @name, @valor,0)";
|
||||
using (OleDbCommand cmd = new (sqlQuery, conn))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("@cod_tusd", this.dadosTusd.Cod_TUSD);
|
||||
cmd.Parameters.AddWithValue("@cod_tusd", dadosTusd.Cod_TUSD);
|
||||
cmd.Parameters.AddWithValue("@j", j);
|
||||
cmd.Parameters.AddWithValue("@name", name);
|
||||
cmd.Parameters.AddWithValue("@valor", valor);
|
||||
@ -590,7 +585,7 @@ namespace Download_Faturas
|
||||
foreach (PropertyInfo propriedade in propriedades)
|
||||
{
|
||||
string nomeColuna = propriedade.Name;
|
||||
object valorColuna = propriedade.GetValue(this.dadosTusd) ?? string.Empty;
|
||||
object valorColuna = propriedade.GetValue(dadosTusd) ?? string.Empty;
|
||||
cmd.Parameters.AddWithValue($"@{nomeColuna}", valorColuna);
|
||||
}
|
||||
|
||||
@ -605,7 +600,7 @@ namespace Download_Faturas
|
||||
sqlQuery = "INSERT INTO Dados_TUSD_aux (Cod_TUSD,Id,Nome,Valor,Cod_lanc) VALUES (@cod_tusd, @j, @name, @valor, 0)";
|
||||
using (OleDbCommand cmd = new (sqlQuery, conn))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("@cod_tusd", this.dadosTusd.Cod_TUSD);
|
||||
cmd.Parameters.AddWithValue("@cod_tusd", dadosTusd.Cod_TUSD);
|
||||
cmd.Parameters.AddWithValue("@j", j);
|
||||
cmd.Parameters.AddWithValue("@name", name);
|
||||
cmd.Parameters.AddWithValue("@valor", valor);
|
||||
@ -614,9 +609,9 @@ namespace Download_Faturas
|
||||
}
|
||||
}
|
||||
|
||||
this.Status = "FATURA INCLUIDA NO BD";
|
||||
Status = "FATURA INCLUIDA NO BD";
|
||||
this.uc = uc;
|
||||
this.Mes = this.dadosTusd.Mes;
|
||||
Mes = dadosTusd.Mes;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -627,22 +622,22 @@ namespace Download_Faturas
|
||||
{
|
||||
string destino;
|
||||
|
||||
switch (this.Status, separar)
|
||||
switch (Status, separar)
|
||||
{
|
||||
case ("UNIDADE CONSUMIDORA NÃO LOCALIZADA NO BD", _):
|
||||
|
||||
destino = this.Arquivo?.Directory?.Parent?.FullName + $@"\5 - {this.Status}\ID {this.id!} - Mês {this.Mes} - UC {this.uc}.pdf";
|
||||
destino = Arquivo?.Directory?.Parent?.FullName + $@"\5 - {Status}\ID {id!} - Mês {Mes} - UC {uc}.pdf";
|
||||
|
||||
if (separar)
|
||||
{
|
||||
_ = new PDFSplitter(this.pagina, this.Arquivo!.ToString(), destino);
|
||||
this.Arquivo = new FileInfo(destino);
|
||||
_ = new PDFSplitter(pagina, Arquivo!.ToString(), destino);
|
||||
Arquivo = new FileInfo(destino);
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
this.Arquivo!.MoveTo(destino);
|
||||
Arquivo!.MoveTo(destino);
|
||||
}
|
||||
catch
|
||||
{
|
||||
@ -653,18 +648,18 @@ namespace Download_Faturas
|
||||
|
||||
case ("FATURA DUPLICADA NO BD", _):
|
||||
|
||||
destino = this.Arquivo?.Directory?.Parent?.FullName + $@"\4 - {this.Status}\ID {this.id!} - Mês {this.Mes} - Empresa {this.Empresa} - Unidade {this.Unidade}.pdf";
|
||||
destino = Arquivo?.Directory?.Parent?.FullName + $@"\4 - {Status}\ID {id!} - Mês {Mes} - Empresa {Empresa} - Unidade {Unidade}.pdf";
|
||||
|
||||
if (separar)
|
||||
{
|
||||
_ = new PDFSplitter(this.pagina, this.Arquivo!.ToString(), destino);
|
||||
this.Arquivo = new FileInfo(destino);
|
||||
_ = new PDFSplitter(pagina, Arquivo!.ToString(), destino);
|
||||
Arquivo = new FileInfo(destino);
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
this.Arquivo!.MoveTo(destino);
|
||||
Arquivo!.MoveTo(destino);
|
||||
}
|
||||
catch
|
||||
{
|
||||
@ -675,25 +670,25 @@ namespace Download_Faturas
|
||||
|
||||
case ("FATURA INCLUIDA NO BD", _):
|
||||
|
||||
if (this.PastaTUSD!.Exists)
|
||||
if (PastaTUSD!.Exists)
|
||||
{
|
||||
destino = this.PastaTUSD!.FullName + $@"\ID {this.id!} - Mês {this.Mes} - Empresa {this.Empresa} - Unidade {this.Unidade}.pdf";
|
||||
destino = PastaTUSD!.FullName + $@"\ID {id!} - Mês {Mes} - Empresa {Empresa} - Unidade {Unidade}.pdf";
|
||||
}
|
||||
else
|
||||
{
|
||||
destino = this.Arquivo?.Directory?.Parent?.FullName + $@"\6 - {this.Status}\ID {this.id!} - Mês {this.Mes} - Empresa {this.Empresa} - Unidade {this.Unidade}.pdf";
|
||||
destino = Arquivo?.Directory?.Parent?.FullName + $@"\6 - {Status}\ID {id!} - Mês {Mes} - Empresa {Empresa} - Unidade {Unidade}.pdf";
|
||||
}
|
||||
|
||||
if (separar)
|
||||
{
|
||||
_ = new PDFSplitter(this.pagina, this.Arquivo!.ToString(), destino);
|
||||
this.Arquivo = new FileInfo(destino);
|
||||
_ = new PDFSplitter(pagina, Arquivo!.ToString(), destino);
|
||||
Arquivo = new FileInfo(destino);
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
this.Arquivo!.MoveTo(destino);
|
||||
Arquivo!.MoveTo(destino);
|
||||
}
|
||||
catch
|
||||
{
|
||||
@ -704,18 +699,18 @@ namespace Download_Faturas
|
||||
|
||||
case ("INVALID", _):
|
||||
|
||||
destino = this.Arquivo?.Directory?.Parent?.FullName + $@"\7 - ERRO\ID {this.id!} - {this.Arquivo?.Name}";
|
||||
destino = Arquivo?.Directory?.Parent?.FullName + $@"\7 - ERRO\ID {id!} - {Arquivo?.Name}";
|
||||
|
||||
if (separar)
|
||||
{
|
||||
_ = new PDFSplitter(this.pagina, this.Arquivo!.ToString(), destino);
|
||||
this.Arquivo = new FileInfo(destino);
|
||||
_ = new PDFSplitter(pagina, Arquivo!.ToString(), destino);
|
||||
Arquivo = new FileInfo(destino);
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
this.Arquivo!.MoveTo(destino);
|
||||
Arquivo!.MoveTo(destino);
|
||||
}
|
||||
catch
|
||||
{
|
||||
@ -727,10 +722,10 @@ namespace Download_Faturas
|
||||
|
||||
case (_, true):
|
||||
|
||||
destino = this.Arquivo?.Directory?.Parent?.FullName + $@"\3 - PROCESSANDO\ID {this.id!} - {this.Arquivo?.Name}";
|
||||
destino = Arquivo?.Directory?.Parent?.FullName + $@"\3 - PROCESSANDO\ID {id!} - {Arquivo?.Name}";
|
||||
|
||||
_ = new PDFSplitter(this.pagina, this.Arquivo!.ToString(), destino);
|
||||
this.Arquivo = new FileInfo(destino);
|
||||
_ = new PDFSplitter(pagina, Arquivo!.ToString(), destino);
|
||||
Arquivo = new FileInfo(destino);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -2,19 +2,14 @@
|
||||
// Copyright (c) Smart Energia. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace Download_Faturas
|
||||
namespace Faturas
|
||||
{
|
||||
using System.Data.OleDb;
|
||||
using System.Globalization;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Reflection;
|
||||
using System.Reflection.Metadata.Ecma335;
|
||||
using System.Runtime.Intrinsics.X86;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Text.RegularExpressions;
|
||||
using iText.Kernel.Pdf;
|
||||
using iText.Kernel.Utils;
|
||||
|
||||
/// <summary>
|
||||
/// Class representing the old invoice processing logic.
|
||||
14
Faturas/Faturas.csproj
Normal file
14
Faturas/Faturas.csproj
Normal file
@ -0,0 +1,14 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="itext7" Version="9.0.0" />
|
||||
<PackageReference Include="System.Data.OleDb" Version="10.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@ -2,7 +2,7 @@
|
||||
// Copyright (c) Smart Energia. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace Download_Faturas
|
||||
namespace Faturas
|
||||
{
|
||||
using System;
|
||||
using System.Text.Json;
|
||||
9
Faturas/GlobalSuppressions.cs
Normal file
9
Faturas/GlobalSuppressions.cs
Normal file
@ -0,0 +1,9 @@
|
||||
// This file is used by Code Analysis to maintain SuppressMessage
|
||||
// attributes that are applied to this project.
|
||||
// Project-level suppressions either have no target or are given
|
||||
// a specific target and scoped to a namespace, type, member, etc.
|
||||
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
[assembly: SuppressMessage("Interoperability", "CA1416:Validar a compatibilidade da plataforma", Justification = "<Pendente>", Scope = "member", Target = "~M:Faturas.Fatura.Processar(System.Data.OleDb.OleDbConnection)")]
|
||||
[assembly: SuppressMessage("Style", "IDE0063:Usar a instrução 'using' simples", Justification = "<Pendente>", Scope = "member", Target = "~M:Faturas.Fatura.Processar(System.Data.OleDb.OleDbConnection)")]
|
||||
@ -1,18 +1,9 @@
|
||||
// <copyright file="PDFSplitter.cs" company="Smart Energia">
|
||||
// <copyright file="PDFSplitter.cs" company="Smart Energia">
|
||||
// Copyright (c) Smart Energia. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace Download_Faturas
|
||||
namespace Faturas
|
||||
{
|
||||
using System.Data.OleDb;
|
||||
using System.Globalization;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Reflection;
|
||||
using System.Reflection.Metadata.Ecma335;
|
||||
using System.Runtime.Intrinsics.X86;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Text.RegularExpressions;
|
||||
using iText.Kernel.Pdf;
|
||||
using iText.Kernel.Utils;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
// Copyright (c) Smart Energia. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace Download_Faturas
|
||||
namespace Faturas
|
||||
{
|
||||
/// <summary>
|
||||
/// Record set class representing invoice data.
|
||||
@ -2,7 +2,7 @@
|
||||
// Copyright (c) Smart Energia. All rights reserved.
|
||||
// </copyright>
|
||||
|
||||
namespace Download_Faturas
|
||||
namespace Faturas
|
||||
{
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
@ -4,7 +4,6 @@
|
||||
|
||||
namespace Download_Faturas
|
||||
{
|
||||
using System.Net;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<RootNamespace>Download_Faturas</RootNamespace>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
@ -14,8 +14,6 @@
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="System.Data.OleDb" Version="9.0.0" />
|
||||
<PackageReference Include="System.Text.Json" Version="9.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Webhook_4docs
|
||||
{
|
||||
|
||||
@ -1,13 +1,9 @@
|
||||
using System.Data.OleDb;
|
||||
using System.Data.OleDb;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Threading.RateLimiting;
|
||||
using Download_Faturas;
|
||||
using iText.Layout.Splitting;
|
||||
using Microsoft.AspNetCore.Http.Extensions;
|
||||
using Faturas;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Internal;
|
||||
|
||||
namespace Webhook_4docs
|
||||
{
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0-windows10.0.17763.0</TargetFramework>
|
||||
<TargetFramework>net9.0-windows10.0.17763.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>Webhook_4docs</RootNamespace>
|
||||
@ -18,12 +18,11 @@
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="9.0.2" />
|
||||
<PackageReference Include="System.Data.OleDb" Version="9.0.0" />
|
||||
<PackageReference Include="System.Text.Json" Version="9.0.0" />
|
||||
<PackageReference Include="System.Data.OleDb" Version="10.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Download Faturas\Download Faturas.csproj" />
|
||||
<ProjectReference Include="..\Faturas\Faturas.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user