diff --git a/src/components/05_quotation/ProductItem.vue b/src/components/05_quotation/ProductItem.vue index 4c685312..a705631d 100644 --- a/src/components/05_quotation/ProductItem.vue +++ b/src/components/05_quotation/ProductItem.vue @@ -57,17 +57,13 @@ const currentBtnOpen = ref<{ title: string; opened: boolean[] }[]>([ ]); function calcPrice(c: (typeof rows.value)[number]) { - return precisionRound( - c.pricePerUnit * c.amount - - c.discount + - precisionRound( - c.product.calcVat - ? (c.pricePerUnit * (c.discount ? c.amount : 1) - c.discount) * - (config.value?.vat || 0.07) - : 0, - ) * - (!c.discount ? c.amount : 1), - ); + const price = c.pricePerUnit * c.amount; + const vat = c.product.calcVat + ? (c.pricePerUnit * (c.discount ? c.amount : 1) - c.discount) * + (config.value?.vat || 0.07) * + (!c.discount ? c.amount : 1) + : 0; + return precisionRound(price + vat); } const discount4Show = ref([]); diff --git a/src/pages/05_quotation/QuotationForm.vue b/src/pages/05_quotation/QuotationForm.vue index 44873ee4..0cfe7c8b 100644 --- a/src/pages/05_quotation/QuotationForm.vue +++ b/src/pages/05_quotation/QuotationForm.vue @@ -242,12 +242,11 @@ function getPrice( return a; } - const price = precisionRound(c.pricePerUnit * c.amount); + const price = c.pricePerUnit * c.amount; const vat = - precisionRound( - (c.pricePerUnit * (c.discount ? c.amount : 1) - c.discount) * - (config.value?.vat || 0.07), - ) * (!c.discount ? c.amount : 1); + (c.pricePerUnit * (c.discount ? c.amount : 1) - c.discount) * + (config.value?.vat || 0.07) * + (!c.discount ? c.amount : 1); a.totalPrice = precisionRound(a.totalPrice + price); a.totalDiscount = precisionRound(a.totalDiscount + Number(c.discount));