diff --git a/src/controllers/05-quotation-controller.ts b/src/controllers/05-quotation-controller.ts index cc6fe6b..096864e 100644 --- a/src/controllers/05-quotation-controller.ts +++ b/src/controllers/05-quotation-controller.ts @@ -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,