Skip to content

Commit e92f74a

Browse files
Calculate tax IDs when refunding shipping and fees
1 parent 6ebddf5 commit e92f74a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

WooCommerce/src/main/kotlin/com/woocommerce/android/ui/payments/refunds/RefundsUiModels.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ data class ShippingRefundListItem(
6363
override val subtotal: BigDecimal
6464
get() = shippingLine.total
6565
override val taxes: List<TaxRefund>
66-
get() = listOf(
66+
get() = shippingLine.taxes.map {
6767
TaxRefund(
68-
rateId = 0L,
69-
tax = shippingLine.totalTax
68+
rateId = it.rateId,
69+
tax = it.taxAmount
7070
)
71-
)
71+
}
7272
}
7373

7474
@Parcelize
@@ -82,10 +82,10 @@ data class FeeRefundListItem(
8282
override val subtotal: BigDecimal
8383
get() = feeLine.total
8484
override val taxes: List<TaxRefund>
85-
get() = listOf(
85+
get() = feeLine.taxes.map {
8686
TaxRefund(
87-
rateId = 0L,
88-
tax = feeLine.totalTax
87+
rateId = it.rateId,
88+
tax = it.taxAmount
8989
)
90-
)
90+
}
9191
}

0 commit comments

Comments
 (0)