Skip to content

Commit

Permalink
Merge pull request woocommerce#10794 from woocommerce/issue-10719/tot…
Browse files Browse the repository at this point in the history
…al-sheet-shipping-tax

[Issue 10719]Added Support For Shipping Tax in Order Editing
  • Loading branch information
jd-alexander authored Feb 23, 2024
2 parents 672695b + 9a47f37 commit fd04576
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
17.5
-----
- [*] [Internal] As side effect of adding tablet support, toolbar on the product list screen is not collapsible anymore [https://github.com/woocommerce/woocommerce-android/pull/10844]

- [*] [Internal] Added the "Shipping Tax" display in the order creation form to enhance tax detail visibility, ensuring comprehensive financial tracking. [https://github.com/woocommerce/woocommerce-android/pull/10794]

17.4
-----
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ data class Order(
val paymentUrl: String,
val isEditable: Boolean,
val selectedGiftCard: String?,
val giftCardDiscountedAmount: BigDecimal?
val giftCardDiscountedAmount: BigDecimal?,
val shippingTax: BigDecimal,
) : Parcelable {
@IgnoredOnParcel
val isOrderPaid = datePaid != null
Expand Down Expand Up @@ -386,7 +387,8 @@ data class Order(
paymentUrl = "",
isEditable = true,
selectedGiftCard = "",
giftCardDiscountedAmount = null
giftCardDiscountedAmount = null,
shippingTax = BigDecimal(0)
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ class OrderMapper @Inject constructor(
isEditable = databaseEntity.isEditable,
selectedGiftCard = databaseEntity.giftCardCode,
giftCardDiscountedAmount = databaseEntity.giftCardAmount
.toBigDecimalOrNull() ?: BigDecimal.ZERO
.toBigDecimalOrNull() ?: BigDecimal.ZERO,
shippingTax = databaseEntity.shippingTax.toBigDecimalOrNull() ?: BigDecimal.ZERO,
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,15 @@ class OrderCreateEditTotalsHelper @Inject constructor(
label = "${it.label} · ${it.ratePercent}%",
value = bigDecimalFormatter(BigDecimal(it.taxTotal))
)
} + if (shippingTax > BigDecimal.ZERO) {
listOf(
TotalsSectionsState.Line.SimpleSmall(
label = resourceProvider.getString(R.string.order_creation_payment_shipping_tax_label),
value = bigDecimalFormatter(shippingTax)
)
)
} else {
emptyList()
} + TotalsSectionsState.Line.LearnMore(
text = taxBasedOnSettingLabel,
buttonText = resourceProvider.getString(R.string.learn_more),
Expand Down
1 change: 1 addition & 0 deletions WooCommerce/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,7 @@
<string name="order_creation_gift_card_text_error">The code should be in XXXX-XXXX-XXXX-XXXX format</string>
<string name="order_creation_collect_payment_button">Collect Payment</string>
<string name="order_creation_expand_collapse_order_totals">Expand collapse order totals</string>
<string name="order_creation_payment_shipping_tax_label">Shipping Tax</string>

<!--
Barcode Scanning
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ tasks.register("installGitHooks", Copy) {
}

ext {
fluxCVersion = '2959-fa5de726746db9abca205b9c433f61bbb4fdb9ae'
fluxCVersion = 'trunk-d4257a89ad5ded8ca5b1d2de9726e2d8787cc8bc'
glideVersion = '4.16.0'
coilVersion = '2.1.0'
constraintLayoutVersion = '1.2.0'
Expand Down

0 comments on commit fd04576

Please sign in to comment.