Implemented choosing account

This commit is contained in:
dankito 2020-05-13 12:06:13 +02:00
parent bea45cb661
commit f8bb4fd933
3 changed files with 22 additions and 1 deletions

View File

@ -55,6 +55,7 @@ enter.tan.dialog.tan.error.changing.tan.medium=Could not change TAN medium to \'
transfer.money.dialog.title=Transfer money
transfer.money.dialog.account.label=Account:
transfer.money.dialog.remittee.name.label=Remittee:
transfer.money.dialog.remittee.iban.label=IBAN:
transfer.money.dialog.remittee.bank.label=Bank:

View File

@ -55,6 +55,7 @@ enter.tan.dialog.tan.error.changing.tan.medium=TAN Medium konnte nicht geändert
transfer.money.dialog.title=Neue Überweisung
transfer.money.dialog.account.label=Konto:
transfer.money.dialog.remittee.name.label=Begünstigter (Name oder Firma):
transfer.money.dialog.remittee.iban.label=IBAN:
transfer.money.dialog.remittee.bank.label=Bank:

View File

@ -4,6 +4,7 @@ import javafx.beans.property.SimpleBooleanProperty
import javafx.beans.property.SimpleDoubleProperty
import javafx.beans.property.SimpleObjectProperty
import javafx.beans.property.SimpleStringProperty
import javafx.collections.FXCollections
import javafx.geometry.Insets
import javafx.geometry.Pos
import javafx.scene.layout.Priority
@ -17,6 +18,7 @@ import net.dankito.fints.messages.segmente.implementierte.sepa.SepaMessageCreato
import net.dankito.fints.model.BankInfo
import net.dankito.utils.javafx.ui.controls.doubleTextfield
import net.dankito.utils.javafx.ui.dialogs.Window
import net.dankito.utils.javafx.ui.extensions.ensureOnlyUsesSpaceIfVisible
import net.dankito.utils.javafx.ui.extensions.fixedHeight
import net.dankito.utils.javafx.ui.extensions.fixedWidth
import tornadofx.*
@ -36,7 +38,11 @@ open class TransferMoneyDialog @JvmOverloads constructor(
}
protected val selectedBankAccount = SimpleObjectProperty<BankAccount>(preselectedBankAccount ?: presenter.bankAccounts.firstOrNull { it.supportsTransferringMoney })
protected val bankAccountsSupportingTransferringMoney = FXCollections.observableArrayList(presenter.bankAccounts.filter { it.supportsTransferringMoney })
protected val selectedBankAccount = SimpleObjectProperty<BankAccount>(preselectedBankAccount ?: bankAccountsSupportingTransferringMoney.firstOrNull())
protected val showBankAccounts = SimpleBooleanProperty(bankAccountsSupportingTransferringMoney.size > 1)
protected val remitteeName = SimpleStringProperty(preselectedValues?.creditorName ?: "")
@ -84,6 +90,19 @@ open class TransferMoneyDialog @JvmOverloads constructor(
}
fieldset {
field(messages["transfer.money.dialog.account.label"]) {
visibleWhen(showBankAccounts)
ensureOnlyUsesSpaceIfVisible()
combobox(selectedBankAccount, bankAccountsSupportingTransferringMoney) {
fixedHeight = TextFieldHeight
}
vboxConstraints {
marginBottom = 12.0
}
}
field(messages["transfer.money.dialog.remittee.name.label"]) {
textfield(this@TransferMoneyDialog.remitteeName) {
fixedHeight = TextFieldHeight