Added displayName to Bank, Account and BankAccount
This commit is contained in:
parent
9b247d2c9e
commit
941746c18b
|
@ -24,6 +24,9 @@ open class Account(
|
|||
var tanMedia: List<TanMedium> = listOf()
|
||||
|
||||
|
||||
val displayName: String
|
||||
get() = bank.name
|
||||
|
||||
val balance: BigDecimal
|
||||
get() = bankAccounts.map { it.balance }.fold(BigDecimal.ZERO) { acc, e -> acc + e }
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@ open class Bank(
|
|||
internal constructor() : this("", "", "", "") // for object deserializers
|
||||
|
||||
|
||||
val displayName: String
|
||||
get() = name
|
||||
|
||||
var iconUrl: String? = null
|
||||
|
||||
|
||||
|
|
|
@ -19,6 +19,16 @@ open class BankAccount @JvmOverloads constructor(
|
|||
internal constructor() : this(Account(), "", "", null, null) // for object deserializers
|
||||
|
||||
|
||||
val displayName: String
|
||||
get() {
|
||||
var displayName = "${account.bank.name} ${identifier}"
|
||||
subAccountNumber?.let {
|
||||
displayName += " ($it)"
|
||||
}
|
||||
|
||||
return displayName
|
||||
}
|
||||
|
||||
var bookedTransactions: List<AccountTransaction> = bookedAccountTransactions
|
||||
protected set
|
||||
|
||||
|
|
|
@ -20,12 +20,7 @@ open class BankAccountsAdapter(bankAccounts: List<BankAccount>) : ListAdapter<Ba
|
|||
val view = convertView ?: inflater?.inflate(R.layout.list_item_bank_account, parent, false)
|
||||
|
||||
view?.let {
|
||||
var displayName = "${item.account.bank.name} ${item.identifier}"
|
||||
item.subAccountNumber?.let {
|
||||
displayName += " ($it)"
|
||||
}
|
||||
|
||||
view.txtBankAccountDisplayName.text = displayName
|
||||
view.txtBankAccountDisplayName.text = item.displayName
|
||||
}
|
||||
|
||||
return view
|
||||
|
|
Loading…
Reference in New Issue