fix: tax_rate extraction in totals service (#156)
This commit is contained in:
1 parent
dc210c2cbd
commit
178d12fc71
1 file changed
+4
-1
@@ -73,7 +73,10 @@ class TotalsService extends BaseService {
|
|||||||
const shippingTotal = this.getShippingTotal(object)
|
const shippingTotal = this.getShippingTotal(object)
|
||||||
const discountTotal = this.getDiscountTotal(object)
|
const discountTotal = this.getDiscountTotal(object)
|
||||||
const giftCardTotal = this.getGiftCardTotal(object)
|
const giftCardTotal = this.getGiftCardTotal(object)
|
||||||
const tax_rate = object.tax_rate || object.region.tax_rate
|
const tax_rate =
|
||||||
|
typeof object.tax_rate !== "undefined"
|
||||||
|
? object.tax_rate
|
||||||
|
: object.region.tax_rate
|
||||||
return this.rounded(
|
return this.rounded(
|
||||||
(subtotal - discountTotal - giftCardTotal + shippingTotal) *
|
(subtotal - discountTotal - giftCardTotal + shippingTotal) *
|
||||||
(tax_rate / 100)
|
(tax_rate / 100)
|
||||||
|
|||||||
Reference in new issue
Block a user