fix initial tax per item issue

This commit is contained in:
yashkanakiya
2023-08-25 09:33:30 +05:30
parent 05d5ce26fd
commit 27660c6bce
7 changed files with 81 additions and 8 deletions

View File

@ -233,9 +233,7 @@ const totalDiscount = computed({
},
set: (newValue) => {
if (props.store[props.storeProp].discount_type === 'percentage') {
props.store[props.storeProp].discount_val = Math.round(
(props.store.getSubTotal * newValue) / 100
)
props.store[props.storeProp].discount_val = Math.round((props.store.getSubTotal * newValue.toFixed(2)) / 100)
} else {
props.store[props.storeProp].discount_val = Math.round(newValue * 100)
}
@ -265,7 +263,7 @@ const itemWiseTaxes = computed(() => {
} else if (tax.tax_type_id) {
taxes.push({
tax_type_id: tax.tax_type_id,
amount: tax.amount,
amount: Math.round(tax.amount),
percent: tax.percent,
name: tax.name,
})