From ee113b382035ae4e8da5353b2c417147e0f7731f Mon Sep 17 00:00:00 2001 From: Methapon Metanipat Date: Fri, 18 Oct 2024 14:18:24 +0700 Subject: [PATCH] fix: calc vat --- src/controllers/05-quotation-controller.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/05-quotation-controller.ts b/src/controllers/05-quotation-controller.ts index ef7248d..e08ecd2 100644 --- a/src/controllers/05-quotation-controller.ts +++ b/src/controllers/05-quotation-controller.ts @@ -625,7 +625,7 @@ export class QuotationController extends Controller { const list = body.productServiceList?.map((v, i) => { const p = product.find((p) => p.id === v.productId)!; const price = record.agentPrice ? p.agentPrice : p.price; - const pricePerUnit = p.vatIncluded ? precisionRound(price / 1 + VAT_DEFAULT) : price; + const pricePerUnit = p.vatIncluded ? precisionRound(price / (1 + VAT_DEFAULT)) : price; const vat = p.calcVat ? precisionRound((pricePerUnit * v.amount - (v.discount || 0)) * VAT_DEFAULT) : 0;