Ed.BudgetVisualizer.Logic/Parsers/SwedbankParser.cs
/// <summary>
/// Maps data fields to a transaction.
/// </summary>
/// <param name="fields">Data fields to map.</param>
Maps data fields to a transaction.
Maps data fields to a transaction .
public Transaction MapTransaction(string[] fields)
        {
            if (_IgnoredDescriptions.Contains(fields[4]))
            {
                return null;
            }
            var transaction = new Transaction
            {
                Date = DateTime.Parse(fields[2]),
                Origin = fields[3],
                Description = fields[4],
                IsDebit = fields[7] == "D",
                IsCredit = fields[7] == "K",
                Sum = decimal.Parse(fields[5].Replace(',', '.')),
                Currency = fields[6],
            };
            transaction.Category = transaction.IsCredit ? "Other Income" : "Other Expense";
            return transaction;
        }
public Transaction MapTransaction ( string [ ] fields ) { if ( _IgnoredDescriptions . Contains ( fields [ 4 ] ) ) { return null ; } var transaction = new Transaction { Date = DateTime . Parse ( fields [ 2 ] ) , Origin = fields [ 3 ] , Description = fields [ 4 ] , IsDebit = fields [ 7 ] == " " , IsCredit = fields [ 7 ] == " " , Sum = decimal . Parse ( fields [ 5 ] . Replace ( ' ' , ' ' ) ) , Currency = fields [ 6 ] , } ; transaction . Category = transaction . IsCredit ? " " : " " ; return transaction ; }
Maps data fields to a transaction.
Maps data fields to a transaction .
fields
string[]
Data fields to map.
Data fields to map .