fix handling of incomplete transactions

This commit is contained in:
Florian Stinglmayr 2022-11-25 17:28:10 +01:00
parent f8559bbe06
commit 0be0896e91

View File

@ -68,11 +68,12 @@ public partial class MainWindow : Window {
TransactionParser parser = new TransactionParser();
List<Transaction> transactions = parser.Parse(entries);
List<IncompleteTransaction> incompletes = transactions.OfType<IncompleteTransaction>().ToList();
// Log incomplete and remove them from the results.
foreach (var incomplete in transactions.OfType<IncompleteTransaction>()) {
foreach (var incomplete in incompletes) {
Log(incomplete.Reason);
transactions.Remove(incomplete);
}
transactions.RemoveAll(x => incompletes.Contains(x));
report = new Report(transactions);
this.entries.ItemsSource = report.Objectives;