fix tax rounding errors and styling issues

This commit is contained in:
Mohit Panjwani
2021-01-22 13:44:59 +05:30
parent 678ace744a
commit 83de1c47ee
6 changed files with 67 additions and 44 deletions

View File

@ -322,8 +322,8 @@
<sw-button
slot="activator"
type="button"
class="flex items-center justify-center w-12 border border-gray-300 border-solid rounded-tl-none rounded-bl-none font-base"
data-toggle="dropdown"
size="discount"
aria-haspopup="true"
aria-expanded="false"
style="height: 43px"

View File

@ -85,9 +85,10 @@
slot="activator"
type="button"
data-toggle="dropdown"
size="discount"
aria-haspopup="true"
aria-expanded="false"
style="height: 43px; padding: 6px"
style="height: 43px"
variant="white"
>
<span class="flex">
@ -266,22 +267,26 @@ export default {
return this.subtotal - this.item.discount_val
},
totalSimpleTax() {
return window._.sumBy(this.item.taxes, function (tax) {
if (!tax.compound_tax) {
return tax.amount
}
return Math.round(
window._.sumBy(this.item.taxes, function (tax) {
if (!tax.compound_tax) {
return tax.amount
}
return 0
})
return 0
})
)
},
totalCompoundTax() {
return window._.sumBy(this.item.taxes, function (tax) {
if (tax.compound_tax) {
return tax.amount
}
return Math.round(
window._.sumBy(this.item.taxes, function (tax) {
if (tax.compound_tax) {
return tax.amount
}
return 0
})
return 0
})
)
},
totalTax() {
return this.totalSimpleTax + this.totalCompoundTax