Skip to content

Commit cae732a

Browse files
committed
Feat: initial commit
0 parents  commit cae732a

17 files changed

+1357
-0
lines changed

DebitExpress.VatRelief.sln

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DebitExpress.VatRelief", "DebitExpress.VatRelief\DebitExpress.VatRelief.csproj", "{59F297FD-DCE1-4F44-B0B5-22E8DCD8A87B}"
4+
EndProject
5+
Global
6+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
7+
Debug|Any CPU = Debug|Any CPU
8+
Release|Any CPU = Release|Any CPU
9+
EndGlobalSection
10+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
11+
{59F297FD-DCE1-4F44-B0B5-22E8DCD8A87B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
12+
{59F297FD-DCE1-4F44-B0B5-22E8DCD8A87B}.Debug|Any CPU.Build.0 = Debug|Any CPU
13+
{59F297FD-DCE1-4F44-B0B5-22E8DCD8A87B}.Release|Any CPU.ActiveCfg = Release|Any CPU
14+
{59F297FD-DCE1-4F44-B0B5-22E8DCD8A87B}.Release|Any CPU.Build.0 = Release|Any CPU
15+
EndGlobalSection
16+
EndGlobal

DebitExpress.VatRelief/App.xaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Application x:Class="DebitExpress.VatRelief.App"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:local="clr-namespace:DebitExpress.VatRelief"
5+
StartupUri="MainWindow.xaml">
6+
<Application.Resources>
7+
8+
</Application.Resources>
9+
</Application>

DebitExpress.VatRelief/App.xaml.cs

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Configuration;
4+
using System.Data;
5+
using System.Linq;
6+
using System.Threading.Tasks;
7+
using System.Windows;
8+
using DebitExpress.VatRelief.Models;
9+
using DebitExpress.VatRelief.Utils;
10+
11+
namespace DebitExpress.VatRelief;
12+
13+
/// <summary>
14+
/// Interaction logic for App.xaml
15+
/// </summary>
16+
public partial class App : Application
17+
{
18+
protected override async void OnStartup(StartupEventArgs e)
19+
{
20+
const string fileName = @"%USERPROFILE%\Desktop\vat-relief-template.xlsx";
21+
22+
var reader = new VatTemplateReader();
23+
var result = await reader.ReadAsync(Environment.ExpandEnvironmentVariables(fileName));
24+
if (result.IsFaulted)
25+
{
26+
MessageBox.Show(result.ToString());
27+
Environment.Exit(1);
28+
}
29+
30+
const string loc = @"%USERPROFILE%\Desktop";
31+
var path = Environment.ExpandEnvironmentVariables(loc);
32+
ExcelData data = result;
33+
34+
var generator = new DatFileGenerator();
35+
await generator.GenerateAsync(data, path);
36+
37+
var reconWriter = new ExcelReconWriter();
38+
reconWriter.WriteReconciliationReport(data, path);
39+
}
40+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System.Windows;
2+
3+
[assembly: ThemeInfo(
4+
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
5+
//(used if a resource is not found in the page,
6+
// or application resource dictionaries)
7+
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
8+
//(used if a resource is not found in the page,
9+
// app, or any theme specific resource dictionaries)
10+
)]
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>WinExe</OutputType>
5+
<TargetFramework>net6.0-windows</TargetFramework>
6+
<Nullable>enable</Nullable>
7+
<UseWPF>true</UseWPF>
8+
<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
9+
</PropertyGroup>
10+
11+
<ItemGroup>
12+
<PackageReference Include="ClosedXML" Version="0.96.0" />
13+
<PackageReference Include="DebitExpress.Controls" Version="2.1.16" />
14+
<PackageReference Include="DebitExpress.DialogService" Version="2.1.7" />
15+
<PackageReference Include="DebitExpress.Extensions" Version="1.0.10" />
16+
</ItemGroup>
17+
18+
</Project>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<Window x:Class="DebitExpress.VatRelief.MainWindow"
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6+
xmlns:local="clr-namespace:DebitExpress.VatRelief"
7+
mc:Ignorable="d"
8+
Title="MainWindow" Height="450" Width="800">
9+
<Grid>
10+
11+
</Grid>
12+
</Window>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
using System.Windows;
7+
using System.Windows.Controls;
8+
using System.Windows.Data;
9+
using System.Windows.Documents;
10+
using System.Windows.Input;
11+
using System.Windows.Media;
12+
using System.Windows.Media.Imaging;
13+
using System.Windows.Navigation;
14+
using System.Windows.Shapes;
15+
16+
namespace DebitExpress.VatRelief;
17+
18+
/// <summary>
19+
/// Interaction logic for MainWindow.xaml
20+
/// </summary>
21+
public partial class MainWindow : Window
22+
{
23+
public MainWindow()
24+
{
25+
InitializeComponent();
26+
}
27+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using System.Collections.Generic;
2+
3+
namespace DebitExpress.VatRelief.Models;
4+
5+
public sealed class ExcelData
6+
{
7+
public ExcelData(Info info, List<Sales> sales, List<Purchases> purchases)
8+
{
9+
Info = info;
10+
Sales = sales;
11+
Purchases = purchases;
12+
}
13+
14+
public Info Info { get; }
15+
public List<Sales> Sales { get; }
16+
public List<Purchases> Purchases { get; }
17+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
namespace DebitExpress.VatRelief.Models;
2+
3+
public readonly struct Info
4+
{
5+
public Info(string tin,
6+
int quarter,
7+
int month,
8+
int year,
9+
string regName = "",
10+
string lastName = "",
11+
string firstName = "",
12+
string middleName = "",
13+
string tradeName = "",
14+
string street = "",
15+
string city = "",
16+
string rdo = "",
17+
int periodEnd = 12,
18+
bool nonIndividual = false)
19+
{
20+
Tin = tin;
21+
Month = month;
22+
Year = year;
23+
Quarter = quarter;
24+
RegName = regName;
25+
LastName = lastName;
26+
FirstName = firstName;
27+
MiddleName = middleName;
28+
TradeName = tradeName;
29+
Street = street;
30+
City = city;
31+
Rdo = rdo;
32+
PeriodEnd = periodEnd;
33+
NonIndividual = nonIndividual;
34+
}
35+
36+
public string Tin { get; }
37+
public int Quarter { get; }
38+
public int Month { get; }
39+
public int Year { get; }
40+
public string RegName { get; }
41+
public string LastName { get; }
42+
public string FirstName { get; }
43+
public string MiddleName { get; }
44+
public string TradeName { get; }
45+
public string Street { get; }
46+
public string City { get; }
47+
public string Rdo { get; }
48+
public int PeriodEnd { get; }
49+
public bool NonIndividual { get; }
50+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System;
2+
3+
namespace DebitExpress.VatRelief.Models;
4+
5+
public struct Purchases
6+
{
7+
public DateTime EndOfMonth { get; set; }
8+
public string Tin { get; set; }
9+
10+
public string RegName { get; set; }
11+
12+
public string LastName { get; set; }
13+
14+
public string FirstName { get; set; }
15+
16+
public string MiddleName { get; set; }
17+
18+
public string FullName => $"{LastName}, {FirstName} {MiddleName}";
19+
public string Street { get; set; }
20+
21+
public string City { get; set; }
22+
23+
public decimal Exempt { get; set; }
24+
25+
public decimal ZeroRated { get; set; }
26+
27+
public decimal Service { get; set; }
28+
29+
public decimal CapitalGoods { get; set; }
30+
31+
public decimal OtherGoods { get; set; }
32+
33+
public decimal InputTax { get; set; }
34+
35+
public decimal NonCreditable { get; set; }
36+
}

0 commit comments

Comments
 (0)