diff options
author | Iván Ávalos <avalos@disroot.org> | 2024-02-12 18:47:53 -0600 |
---|---|---|
committer | Torsten Grote <t@grobox.de> | 2024-03-27 14:26:41 -0300 |
commit | c86ae12e55c227e285252271c90b56f35f38858e (patch) | |
tree | 03a33886e08d8211b061c76b85fbcd954d967d08 /wallet/src/main/java/net/taler/wallet/refund | |
parent | 1e9ee99cb07c595132fa96935e3f2b7c88dd586a (diff) | |
download | taler-android-c86ae12e55c227e285252271c90b56f35f38858e.tar.gz taler-android-c86ae12e55c227e285252271c90b56f35f38858e.tar.bz2 taler-android-c86ae12e55c227e285252271c90b56f35f38858e.zip |
[wallet] DD51: enrich some tx amounts with currencySpecification
bug 0008329
(cherry picked from commit 021e4443bae33abbdc9de21f2708e633e99ca055)
Diffstat (limited to 'wallet/src/main/java/net/taler/wallet/refund')
-rw-r--r-- | wallet/src/main/java/net/taler/wallet/refund/TransactionRefundComposable.kt | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/wallet/src/main/java/net/taler/wallet/refund/TransactionRefundComposable.kt b/wallet/src/main/java/net/taler/wallet/refund/TransactionRefundComposable.kt index 82dceb5..637b41a 100644 --- a/wallet/src/main/java/net/taler/wallet/refund/TransactionRefundComposable.kt +++ b/wallet/src/main/java/net/taler/wallet/refund/TransactionRefundComposable.kt @@ -31,6 +31,7 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import net.taler.common.Amount +import net.taler.common.CurrencySpecification import net.taler.common.Timestamp import net.taler.common.toAbsoluteTime import net.taler.wallet.R @@ -54,6 +55,7 @@ import net.taler.wallet.transactions.TransitionsComposable fun TransactionRefundComposable( t: TransactionRefund, devMode: Boolean, + spec: CurrencySpecification?, onTransition: (t: TransactionAction) -> Unit, ) { val scrollState = rememberScrollState() @@ -71,19 +73,19 @@ fun TransactionRefundComposable( ) TransactionAmountComposable( label = stringResource(id = R.string.transaction_refund), - amount = t.amountEffective, + amount = t.amountEffective.withSpec(spec), amountType = AmountType.Positive, ) TransactionAmountComposable( label = stringResource(id = R.string.transaction_order_total), - amount = t.amountRaw, + amount = t.amountRaw.withSpec(spec), amountType = AmountType.Neutral, ) val fee = t.amountRaw - t.amountEffective if (!fee.isZero()) { TransactionAmountComposable( label = stringResource(id = R.string.withdraw_fees), - amount = fee, + amount = fee.withSpec(spec), amountType = AmountType.Negative, ) } @@ -116,6 +118,6 @@ fun TransactionRefundComposablePreview() { error = TalerErrorInfo(code = TalerErrorCode.WALLET_WITHDRAWAL_KYC_REQUIRED), ) TalerSurface { - TransactionRefundComposable(t = t, devMode = true) {} + TransactionRefundComposable(t = t, devMode = true, spec = null) {} } } |