From a1b78e117e45f0debe9dba43fb440b37e20a2cef Mon Sep 17 00:00:00 2001 From: Methapon2001 <61303214+Methapon2001@users.noreply.github.com> Date: Fri, 24 Jan 2025 10:01:32 +0700 Subject: [PATCH] refactor: store value of product that excluded vat instead --- src/controllers/05-quotation-controller.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/controllers/05-quotation-controller.ts b/src/controllers/05-quotation-controller.ts index c621ac5..4224e45 100644 --- a/src/controllers/05-quotation-controller.ts +++ b/src/controllers/05-quotation-controller.ts @@ -512,9 +512,7 @@ export class QuotationController extends Controller { a.vat = precisionRound(a.vat + c.vat); a.vatExcluded = c.vat === 0 - ? precisionRound( - a.vatExcluded + (c.pricePerUnit * c.amount - (c.discount || 0)) * VAT_DEFAULT, - ) + ? precisionRound(a.vatExcluded + (c.pricePerUnit * c.amount - (c.discount || 0))) : a.vatExcluded; a.finalPrice = precisionRound( Math.max(a.totalPrice - a.totalDiscount + a.vat - (body.discount || 0), 0),