43 lines
1.2 KiB
C#
43 lines
1.2 KiB
C#
namespace FKGees.DocsDefinitions.Decrets;
|
|
|
|
public class KpPaysafe : IDecretsDefinition
|
|
{
|
|
public int DocType => 51;
|
|
public string Type => nameof(KpPaysafe);
|
|
public List<Definition> Definitions { get; } =
|
|
[
|
|
new Definition("139-1-24", "WN", "[sbr]"),
|
|
new Definition("100-1-24", "MA", "[sbr]")
|
|
];
|
|
|
|
public Task<List<DecretsResult>> Process(IReadOnlyList<Dok> documents)
|
|
{
|
|
var result = new List<DecretsResult>();
|
|
|
|
var toProcess = documents
|
|
.Where(x => x.TypDok == DocType
|
|
&& x.NrDok.StartsWith("KP")
|
|
&& x.Tekst1() == Constants.KpTekstyDod[nameof(KpPaysafe)]);
|
|
|
|
foreach (var dok in toProcess)
|
|
{
|
|
Definitions.ForEach(d =>
|
|
{
|
|
var item = new DecretsResult
|
|
{
|
|
Data = dok.DataPom,
|
|
DataWplywu = dok.Data,
|
|
Nr = dok.NrDok,
|
|
Opis = dok.NrDok,
|
|
StronaKonta = d.AccountSide,
|
|
KontoFk = d.Account,
|
|
Kwota = Math.Abs(dok.Zaplacono).AsString()
|
|
};
|
|
|
|
result.Add(item);
|
|
});
|
|
}
|
|
|
|
return Task.FromResult(result);
|
|
}
|
|
} |