Fixes
This commit is contained in:
parent
16db72e6a3
commit
9f6840a87f
@ -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*"},
|
||||
|
||||
@ -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
|
||||
};
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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);
|
||||
Loading…
x
Reference in New Issue
Block a user