refactor: store value of product that excluded vat instead

This commit is contained in:
Methapon2001 2025-01-24 10:01:32 +07:00
parent 7ae7f47c94
commit a1b78e117e

View file

@ -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),