From 0e57a3daf65f39842ff7b819265fa30518ce676f Mon Sep 17 00:00:00 2001 From: Methapon2001 <61303214+Methapon2001@users.noreply.github.com> Date: Wed, 17 Sep 2025 09:27:39 +0700 Subject: [PATCH] fix: .01 error --- src/pages/05_quotation/preview/ViewForm.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/05_quotation/preview/ViewForm.vue b/src/pages/05_quotation/preview/ViewForm.vue index d65d3c37..68e00871 100644 --- a/src/pages/05_quotation/preview/ViewForm.vue +++ b/src/pages/05_quotation/preview/ViewForm.vue @@ -284,8 +284,10 @@ onMounted(async () => { (a, c) => { const calcVat = c.vat > 0; const vatFactor = calcVat ? (config.value?.vat ?? 0.07) : 0; + const pricePerUnit = + precisionRound(c.pricePerUnit * (1 + vatFactor)) / (1 + vatFactor); const price = - (c.pricePerUnit * c.amount * (1 + vatFactor) - c.discount) / + (pricePerUnit * c.amount * (1 + vatFactor) - c.discount) / (1 + vatFactor); a.totalPrice = precisionRound(a.totalPrice + price + c.discount);