diff options
author | Iván Ávalos <avalos@disroot.org> | 2024-02-12 18:47:53 -0600 |
---|---|---|
committer | Iván Ávalos <avalos@disroot.org> | 2024-03-26 08:07:55 -0600 |
commit | 021e4443bae33abbdc9de21f2708e633e99ca055 (patch) | |
tree | 03a33886e08d8211b061c76b85fbcd954d967d08 /wallet/src/main/java/net/taler/wallet/peer/TransactionPeerPushDebit.kt | |
parent | 4789103406f44ba797c7bfee3112cc6aaa228683 (diff) | |
download | taler-android-021e4443bae33abbdc9de21f2708e633e99ca055.tar.gz taler-android-021e4443bae33abbdc9de21f2708e633e99ca055.tar.bz2 taler-android-021e4443bae33abbdc9de21f2708e633e99ca055.zip |
[wallet] DD51: enrich some tx amounts with currencySpecification
bug 0008329
Diffstat (limited to 'wallet/src/main/java/net/taler/wallet/peer/TransactionPeerPushDebit.kt')
-rw-r--r-- | wallet/src/main/java/net/taler/wallet/peer/TransactionPeerPushDebit.kt | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/wallet/src/main/java/net/taler/wallet/peer/TransactionPeerPushDebit.kt b/wallet/src/main/java/net/taler/wallet/peer/TransactionPeerPushDebit.kt index 909fd47..e592c3e 100644 --- a/wallet/src/main/java/net/taler/wallet/peer/TransactionPeerPushDebit.kt +++ b/wallet/src/main/java/net/taler/wallet/peer/TransactionPeerPushDebit.kt @@ -30,6 +30,7 @@ import androidx.compose.ui.text.style.TextAlign 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.wallet.R import net.taler.wallet.backend.TalerErrorCode.EXCHANGE_GENERIC_KYC_REQUIRED @@ -52,7 +53,7 @@ import net.taler.wallet.transactions.TransactionPeerPushDebit import net.taler.wallet.transactions.TransactionState @Composable -fun ColumnScope.TransactionPeerPushDebitComposable(t: TransactionPeerPushDebit) { +fun ColumnScope.TransactionPeerPushDebitComposable(t: TransactionPeerPushDebit, spec: CurrencySpecification?) { if (t.error == null) PeerQrCode( state = t.txState, talerUri = t.talerUri, @@ -60,7 +61,7 @@ fun ColumnScope.TransactionPeerPushDebitComposable(t: TransactionPeerPushDebit) TransactionAmountComposable( label = stringResource(id = R.string.transaction_order_total), - amount = t.amountRaw, + amount = t.amountRaw.withSpec(spec), amountType = AmountType.Neutral, ) @@ -68,14 +69,14 @@ fun ColumnScope.TransactionPeerPushDebitComposable(t: TransactionPeerPushDebit) if (!fee.isZero()) { TransactionAmountComposable( label = stringResource(id = R.string.withdraw_fees), - amount = fee, + amount = fee.withSpec(spec), amountType = AmountType.Negative, ) } TransactionAmountComposable( label = stringResource(id = R.string.transaction_paid), - amount = t.amountEffective, + amount = t.amountEffective.withSpec(spec), amountType = AmountType.Negative, ) @@ -140,7 +141,7 @@ fun TransactionPeerPushDebitPreview(loading: Boolean = false) { ) TalerSurface { - TransactionPeerComposable(t, true) {} + TransactionPeerComposable(t, true, null) {} } } |