This commit is contained in:
Piotr Dudek 2024-09-24 15:44:53 +02:00
parent 16db72e6a3
commit 9f6840a87f
4 changed files with 13 additions and 14 deletions

View File

@ -29,7 +29,6 @@ namespace FKGees
public static readonly Dictionary<string, string> KpTekstyDod = new()
{
{nameof(KpKaucjaZaOpakowania), "*KAUCJA ZA OPAKOWANIA*"},
{nameof(KpKasy), "*SPRZEDAŻ Z KAS*"},
{nameof(KpRachunki), "*MOJE RACH.*"},
{nameof(KpInne), "*INNE*"},
{nameof(KpPaysafe), "*PAYSAFE*"},

View File

@ -45,7 +45,7 @@ public class DostawaPrasy : IDecretsDefinition
{
"[znr]" => doc.Netto,
"[snr]-[znr]" => doc.NettoDet - doc.Netto,
"[sbr]-[snr]" => doc.Podatek,
"[sbr]-[snr]" => doc.PodatekDet,
"[sbr]" => doc.NettoDet + doc.PodatekDet,
_ => 0
};

View File

@ -6,7 +6,8 @@ public class KwCashback : IDecretsDefinition
public string Type => nameof(KwCashback);
public List<Definition> Definitions { get; } =
[
new Definition("249-0-19", "WN", "[sbr]")
new Definition("249-0-19", "WN", "[sbr]"),
new Definition("100-1-24", "MA", "[sbr]")
];
public Task<List<DecretsResult>> Process(IReadOnlyList<Dok> documents)

View File

@ -1,9 +1,9 @@
namespace FKGees.DocsDefinitions.Decrets;
public class KpKasy : IDecretsDefinition
public class Utarg : IDecretsDefinition
{
public int DocType => 51;
public string Type => nameof(KpKasy);
public int DocType => 53;
public string Type => nameof(Utarg);
public List<Definition> Definitions { get; } =
[
new Definition("100-1-24", "WN", "[sbr]"),
@ -15,9 +15,8 @@ public class KpKasy : IDecretsDefinition
var result = new List<DecretsResult>();
var toProcess = documents
.Where(x => x.TypDok == DocType
&& x.NrDok.StartsWith("KP")
&& x.Tekst1() == Constants.KpTekstyDod[nameof(KpKasy)]);
.Where(x => x.TypDok == DocType && x.Kwota1 != 0)
.GroupBy(x => x.Data);
foreach (var dok in toProcess)
{
@ -25,13 +24,13 @@ public class KpKasy : IDecretsDefinition
{
var item = new DecretsResult
{
Data = dok.DataPom,
DataWplywu = dok.Data,
Nr = dok.NrDok,
Opis = dok.TekstZaCo(),
Data = dok.Key,
DataWplywu = dok.Key,
Nr = string.Join(", ",dok.Select(z => z.NrDok)),
Opis = "UTARG Z KAS",
StronaKonta = d.AccountSide,
KontoFk = d.Account,
Kwota = Math.Abs(dok.Zaplacono).AsString()
Kwota = dok.Sum(x => x.Netto + x.Podatek).AsString()
};
result.Add(item);