diff --git a/BankingUiCommon/src/main/java/net/dankito/banking/ui/presenter/BankingPresenter.kt b/BankingUiCommon/src/main/java/net/dankito/banking/ui/presenter/BankingPresenter.kt index 2390a0d1..7db25e4f 100644 --- a/BankingUiCommon/src/main/java/net/dankito/banking/ui/presenter/BankingPresenter.kt +++ b/BankingUiCommon/src/main/java/net/dankito/banking/ui/presenter/BankingPresenter.kt @@ -310,7 +310,7 @@ open class BankingPresenter( get() = ArrayList(selectedBankAccountsField) open val selectedBankAccountsAccountTransactions: List - get() = getAccountTransactionsForAccounts(selectedBankAccounts.map { it.account }.toSet()) + get() = getAccountTransactionsForBankAccounts(selectedBankAccounts) open val balanceOfSelectedBankAccounts: BigDecimal get() = sumBalance(selectedBankAccounts.map { it.balance }) @@ -341,7 +341,7 @@ open class BankingPresenter( get() = accounts.flatMap { it.bankAccounts } open val allTransactions: List - get() = getAccountTransactionsForAccounts(accounts) + get() = getAccountTransactionsForBankAccounts(bankAccounts) open val balanceOfAllAccounts: BigDecimal get() = getBalanceForAccounts(accounts) @@ -389,8 +389,8 @@ open class BankingPresenter( } - protected open fun getAccountTransactionsForAccounts(accounts: Collection): List { - return accounts.flatMap { it.transactions }.sortedByDescending { it.bookingDate } // TODO: someday add unbooked transactions + protected open fun getAccountTransactionsForBankAccounts(bankAccounts: Collection): List { + return bankAccounts.flatMap { it.bookedTransactions }.sortedByDescending { it.bookingDate } // TODO: someday add unbooked transactions } protected open fun getBalanceForAccounts(accounts: Collection): BigDecimal {