taler-android

Android apps for GNU Taler (wallet, PoS, cashier)
Log | Files | Refs | README | LICENSE

commit b2a8c16817bfdce925be8a581c7cd6a93d07e66d
parent a1c2929055708e456fc43ff38227be25b35827c7
Author: Iván Ávalos <avalos@disroot.org>
Date:   Mon,  1 Apr 2024 12:55:02 -0600

[wallet] Make manual withdrawal use correct transfer amount

Diffstat:
Mwallet/src/main/java/net/taler/wallet/withdraw/manual/TransferIBAN.kt | 22++++++++++++----------
Mwallet/src/main/java/net/taler/wallet/withdraw/manual/TransferTaler.kt | 20++++++++++++--------
2 files changed, 24 insertions(+), 18 deletions(-)

diff --git a/wallet/src/main/java/net/taler/wallet/withdraw/manual/TransferIBAN.kt b/wallet/src/main/java/net/taler/wallet/withdraw/manual/TransferIBAN.kt @@ -42,6 +42,12 @@ fun TransferIBAN( transactionAmountRaw: Amount, transactionAmountEffective: Amount, ) { + val transferAmount = transfer + .withdrawalAccount + .transferAmount + ?.withSpec(transfer.withdrawalAccount.currencySpecification) + ?: transfer.amountRaw + Column( modifier = Modifier.padding(all = 16.dp), horizontalAlignment = Alignment.CenterHorizontally, @@ -49,7 +55,7 @@ fun TransferIBAN( Text( text = stringResource( R.string.withdraw_manual_ready_intro, - transfer.amountRaw.toString()), + transferAmount), style = MaterialTheme.typography.bodyLarge, modifier = Modifier .padding(vertical = 8.dp) @@ -78,14 +84,10 @@ fun TransferIBAN( info = cleanExchange(exchangeBaseUrl), ) - transfer.withdrawalAccount.transferAmount?.let { amount -> - WithdrawalAmountTransfer( - amountRaw = transactionAmountRaw, - amountEffective = transactionAmountEffective, - conversionAmountRaw = amount.withSpec( - transfer.withdrawalAccount.currencySpecification, - ), - ) - } + WithdrawalAmountTransfer( + amountRaw = transactionAmountRaw, + amountEffective = transactionAmountEffective, + conversionAmountRaw = transferAmount, + ) } } \ No newline at end of file diff --git a/wallet/src/main/java/net/taler/wallet/withdraw/manual/TransferTaler.kt b/wallet/src/main/java/net/taler/wallet/withdraw/manual/TransferTaler.kt @@ -42,6 +42,12 @@ fun TransferTaler( transactionAmountRaw: Amount, transactionAmountEffective: Amount, ) { + val transferAmount = transfer + .withdrawalAccount + .transferAmount + ?.withSpec(transfer.withdrawalAccount.currencySpecification) + ?: transfer.amountRaw + Column( modifier = Modifier.padding(all = 16.dp), horizontalAlignment = Alignment.CenterHorizontally, @@ -49,7 +55,7 @@ fun TransferTaler( Text( text = stringResource( R.string.withdraw_manual_ready_intro, - transfer.amountRaw.toString()), + transferAmount), style = MaterialTheme.typography.bodyLarge, modifier = Modifier .padding(vertical = 8.dp) @@ -78,12 +84,10 @@ fun TransferTaler( info = cleanExchange(exchangeBaseUrl), ) - transfer.withdrawalAccount.transferAmount?.let { amount -> - WithdrawalAmountTransfer( - amountRaw = transactionAmountRaw, - amountEffective = transactionAmountEffective, - conversionAmountRaw = amount, - ) - } + WithdrawalAmountTransfer( + amountRaw = transactionAmountRaw, + amountEffective = transactionAmountEffective, + conversionAmountRaw = transferAmount, + ) } } \ No newline at end of file