2020-09-26 11:30:15 +00:00
|
|
|
using System;
|
2020-09-26 12:45:07 +00:00
|
|
|
using System.Text;
|
2020-09-26 11:30:15 +00:00
|
|
|
|
|
|
|
namespace BunyMuny {
|
|
|
|
public class Statement {
|
|
|
|
public DateTime Date;
|
2020-09-26 11:59:06 +00:00
|
|
|
private string _description;
|
|
|
|
public string Description {
|
|
|
|
get => string.IsNullOrWhiteSpace(_description) ? OriginalDescription : _description;
|
2020-09-26 13:15:54 +00:00
|
|
|
set => _description = value;
|
2020-09-26 11:59:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public string OriginalDescription;
|
2020-09-26 11:30:15 +00:00
|
|
|
public double Value;
|
|
|
|
public string Category;
|
|
|
|
|
|
|
|
public override string ToString() {
|
2020-09-26 12:45:07 +00:00
|
|
|
// e.g.: Debit: $5.00 --> Lynnear Software (Personal) on Apr 2 2020
|
|
|
|
return String.Format(
|
2020-09-26 13:09:30 +00:00
|
|
|
"{0} ${1:F2} {2} {3} ({4}) on {5:MMM d yyyy}",
|
2020-09-26 12:45:07 +00:00
|
|
|
Value < 0 ? "Credit:" : "Debit: ",
|
|
|
|
Math.Abs(Value),
|
|
|
|
Value < 0 ? "-->" : "<--",
|
|
|
|
Description,
|
|
|
|
Category ?? "Unknown",
|
|
|
|
Date
|
|
|
|
);
|
2020-09-26 11:30:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|