Some transactions are twice or trice in database; fixed at least that they are not displayed anymore twice or trice in UI
This commit is contained in:
parent
babc74179a
commit
fc243f2a54
|
@ -794,14 +794,14 @@ open class BankingPresenter(
|
||||||
open fun searchAccountTransactions(query: String, transactions: List<IAccountTransaction>): List<IAccountTransaction> {
|
open fun searchAccountTransactions(query: String, transactions: List<IAccountTransaction>): List<IAccountTransaction> {
|
||||||
val queryLowercase = query.trim().toLowerCase()
|
val queryLowercase = query.trim().toLowerCase()
|
||||||
|
|
||||||
// get transactions sorted by date
|
// get unique transactions sorted by date
|
||||||
val transactionsSorted = transactions.toSet().sortedByDate()
|
val uniqueTransactionsSorted = transactions.toSet().sortedByDate()
|
||||||
|
|
||||||
if (queryLowercase.isEmpty()) {
|
if (queryLowercase.isEmpty()) {
|
||||||
return transactionsSorted
|
return uniqueTransactionsSorted
|
||||||
}
|
}
|
||||||
|
|
||||||
return transactionsSorted.filter {
|
return uniqueTransactionsSorted.filter {
|
||||||
it.otherPartyName?.toLowerCase()?.contains(queryLowercase) == true
|
it.otherPartyName?.toLowerCase()?.contains(queryLowercase) == true
|
||||||
|| it.reference.toLowerCase().contains(queryLowercase)
|
|| it.reference.toLowerCase().contains(queryLowercase)
|
||||||
|| it.bookingText?.toLowerCase()?.contains(queryLowercase) == true
|
|| it.bookingText?.toLowerCase()?.contains(queryLowercase) == true
|
||||||
|
|
Loading…
Reference in New Issue