fix: vat not calculated

This commit is contained in:
Methapon2001 2025-01-23 11:08:28 +07:00
parent 35fbedd74f
commit c34feaa421
3 changed files with 5 additions and 16 deletions

View file

@ -57,12 +57,10 @@ const currentBtnOpen = ref<{ title: string; opened: boolean[] }[]>([
]);
function calcPrice(c: (typeof rows.value)[number]) {
console.log(c);
const originalPrice = c.pricePerUnit;
const finalPriceWithVat = precisionRound(
originalPrice +
(c.product.vatIncluded || c.vat !== 0
? 0
: originalPrice * (config.value?.vat || 0.07)),
originalPrice + originalPrice * (config.value?.vat || 0.07),
);
const finalPriceNoVat = finalPriceWithVat / (1 + (config.value?.vat || 0.07));