fix: wrong vat

This commit is contained in:
Methapon2001 2025-01-30 14:51:48 +07:00
parent 717966796e
commit 891d9a86d2

View file

@ -487,7 +487,9 @@ export class QuotationController extends Controller {
const price = finalPriceWithVat;
const pricePerUnit = price / (1 + VAT_DEFAULT);
const vat = p.calcVat ? (pricePerUnit * v.amount - (v.discount || 0)) * VAT_DEFAULT : 0;
const vat = (body.agentPrice ? p.agentPriceCalcVat : p.calcVat)
? (pricePerUnit * v.amount - (v.discount || 0)) * VAT_DEFAULT
: 0;
return {
order: i + 1,
@ -754,7 +756,9 @@ export class QuotationController extends Controller {
const price = finalPriceWithVat;
const pricePerUnit = price / (1 + VAT_DEFAULT);
const vat = p.calcVat ? (pricePerUnit * v.amount - (v.discount || 0)) * VAT_DEFAULT : 0;
const vat = (record.agentPrice ? p.agentPriceCalcVat : p.calcVat)
? (pricePerUnit * v.amount - (v.discount || 0)) * VAT_DEFAULT
: 0;
return {
order: i + 1,