public bool IsMatch(IImportRow importRow) { switch (Direction) { case EntryType.NotSpecified: return Amount == Math.Abs(importRow.Amount); case EntryType.Debit: return Amount == importRow.Amount; case EntryType.Credit: return Amount == -importRow.Amount; default: throw new ArgumentOutOfRangeException(); } }
private Transaction AsTransaction(IImportRow row, Account account, string description) { var transaction = row.Amount > 0 ? new Transaction(Credit, account, row.Amount) : new Transaction(account, Credit, -row.Amount); transaction.Date = row.Date; transaction.Description = description ?? row.Description; transaction.Reference = row.Id; Result.TransactionCount++; if ( account == UnclassifedDestination ) { Result.UnclassifiedTransactions++; } return transaction; }
public bool IsMatch(IImportRow importRow) { var amount = Math.Abs(importRow.Amount); return amount >= Min && amount <= Max; }
public bool IsMatch(IImportRow importRow) { var value = importRow.Properties.SingleOrDefault(x => x.Key == Name); return value.Value != null && Regex.IsMatch(value.Value.Trim()); }
public bool IsMatch(IImportRow importRow) { return DaysOfMonth.Any(x => importRow.Date.Day == x); }
public bool IsMatch(IImportRow row) { return Pattern.IsMatch(row); }
private IImportRow BuildId(IImportRow row, int rowId) { if ( row.Id == null ) { row.Id = Name == null ? rowId.ToString(CultureInfo.InvariantCulture) : string.Concat(Name, '/', rowId); } return row; }
private Account GetAccount(IImportRow row) { if ( _mappings == null ) { return null; } ImportRowOptions options; return _mappings.TryGetValue(row.Id, out options) ? _context.General[options.Account] : null; }
private string GetDescription(IImportRow row) { if ( _mappings == null ) { return null; } ImportRowOptions options; return _mappings.TryGetValue(row.Id, out options) ? options.Description : null; }