fix: product vat calculation logic in PriceDataComponent

This commit is contained in:
puriphatt 2024-12-26 16:13:38 +07:00
parent 6156ebdba8
commit ec7d76b6fa

View file

@ -304,12 +304,21 @@ withDefaults(
calculatePrice({
output: 'vat',
calcVat: calcVat,
price:
(props.rowIndex === 0
? price
: props.rowIndex === 1
? agentPrice
: serviceCharge) || 0,
price: Number(
formatNumberDecimal(
calculatePrice({
output: 'beforeVat',
vatIncluded: vatIncluded,
price:
(props.rowIndex === 0
? price
: props.rowIndex === 1
? agentPrice
: serviceCharge) || 0,
}),
2,
).replaceAll(',', ''),
),
}),
2,
)