From c0a2d3769d90c9dbd8fbd7f3637c3a23a18b7267 Mon Sep 17 00:00:00 2001 From: Methapon2001 <61303214+Methapon2001@users.noreply.github.com> Date: Fri, 12 Sep 2025 10:24:18 +0700 Subject: [PATCH] fix: margin error .01 --- src/pages/05_quotation/QuotationForm.vue | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/pages/05_quotation/QuotationForm.vue b/src/pages/05_quotation/QuotationForm.vue index f65b3724..c373c964 100644 --- a/src/pages/05_quotation/QuotationForm.vue +++ b/src/pages/05_quotation/QuotationForm.vue @@ -252,10 +252,11 @@ function getPrice( c.product[agentPrice.value ? 'agentPriceCalcVat' : 'calcVat']; const vatFactor = calcVat ? (config.value?.vat ?? 0.07) : 0; - const price = precisionRound( - (c.pricePerUnit * c.amount * (1 + vatFactor) - c.discount) / - (1 + vatFactor), - ); + const pricePerUnit = + precisionRound(c.pricePerUnit * (1 + vatFactor)) / (1 + vatFactor); + const price = + (pricePerUnit * c.amount * (1 + vatFactor) - c.discount) / + (1 + vatFactor); const vat = price * vatFactor; a.totalPrice = precisionRound(a.totalPrice + price + c.discount);