fix: wrong vat excluded

This commit is contained in:
Methapon Metanipat 2024-10-18 10:59:35 +07:00
parent 75796c36c8
commit 1d1f5ec90a

View file

@ -403,7 +403,7 @@ export class QuotationController extends Controller {
? precisionRound(
a.vatExcluded + (c.pricePerUnit * c.amount - (c.discount || 0)) * VAT_DEFAULT,
)
: 0;
: a.vatExcluded;
a.finalPrice = precisionRound(
Math.max(a.totalPrice - a.totalDiscount + a.vat - (body.discount || 0), 0),
);
@ -655,7 +655,7 @@ export class QuotationController extends Controller {
? precisionRound(
a.vatExcluded + (c.pricePerUnit * c.amount - (c.discount || 0)) * VAT_DEFAULT,
)
: 0;
: a.vatExcluded;
a.finalPrice = precisionRound(
Math.max(a.totalPrice - a.totalDiscount + a.vat - (body.discount || 0), 0),
);