From de33d036314a4e260fa8cd029060a5be8811a725 Mon Sep 17 00:00:00 2001 From: Methapon2001 <61303214+Methapon2001@users.noreply.github.com> Date: Tue, 16 Sep 2025 10:08:01 +0700 Subject: [PATCH] fix: calculate price --- src/services/flowaccount.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/services/flowaccount.ts b/src/services/flowaccount.ts index ec934ca..31c2fd6 100644 --- a/src/services/flowaccount.ts +++ b/src/services/flowaccount.ts @@ -334,6 +334,7 @@ const flowAccount = { isVat: true, useReceiptDeduction: false, + useInlineVat: true, discounPercentage: 0, discountAmount: quotation.totalDiscount, @@ -377,7 +378,9 @@ const flowAccount = { pricePerUnit: precisionRound(v.pricePerUnit), quantity: v.amount, discountAmount: v.discount, - total: (v.pricePerUnit - (v.discount || 0)) * v.amount + v.vat, + total: + precisionRound(v.pricePerUnit * (1 + (v.vat === 0 ? VAT_DEFAULT : 0))) * v.amount - + (v.discount ?? 0), vatRate: v.vat === 0 ? 0 : Math.round(VAT_DEFAULT * 100), })), };