refactor: edit calc vat

This commit is contained in:
Thanaphon Frappet 2025-01-24 11:49:33 +07:00
parent 42575eb5ba
commit ca9264d758
8 changed files with 33 additions and 11 deletions

View file

@ -86,7 +86,9 @@ function calcPrice(
: pricePerUnit;
const priceDiscountNoVat = priceNoVat * amount - discount;
const rawVatTotal = priceDiscountNoVat * (config.value?.vat || 0.07);
const rawVatTotal = product.calcVat
? priceDiscountNoVat * (config.value?.vat || 0.07)
: 0;
return precisionRound(priceNoVat * amount + rawVatTotal);
}