From 563afba3bc269ac080f12a32d6f1d7fdc72c18c0 Mon Sep 17 00:00:00 2001 From: dankito Date: Wed, 22 Apr 2020 20:17:47 +0200 Subject: [PATCH] Fixed that for single selected bank accounts all account's account transactions have been displayed (instead of only that ones for that single account) --- .../net/dankito/banking/ui/presenter/BankingPresenter.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 {