diff --git a/src/controllers/05-quotation-controller.ts b/src/controllers/05-quotation-controller.ts index bdaba92..65c5da1 100644 --- a/src/controllers/05-quotation-controller.ts +++ b/src/controllers/05-quotation-controller.ts @@ -419,11 +419,11 @@ export class QuotationController extends Controller { const list = body.productServiceList.map((v, i) => { const p = product.find((p) => p.id === v.productId)!; const price = body.agentPrice ? p.agentPrice : p.price; - const pricePerUnit = p.vatIncluded ? precisionRound(price / (1 + VAT_DEFAULT)) : price; + const pricePerUnit = p.vatIncluded ? price / (1 + VAT_DEFAULT) : price; const vat = p.calcVat - ? precisionRound( - (pricePerUnit * (v.discount ? v.amount : 1) - (v.discount || 0)) * VAT_DEFAULT, - ) * (!v.discount ? v.amount : 1) + ? (pricePerUnit * (v.discount ? v.amount : 1) - (v.discount || 0)) * + VAT_DEFAULT * + (!v.discount ? v.amount : 1) : 0; return { @@ -684,11 +684,11 @@ export class QuotationController extends Controller { const list = body.productServiceList?.map((v, i) => { const p = product.find((p) => p.id === v.productId)!; const price = record.agentPrice ? p.agentPrice : p.price; - const pricePerUnit = p.vatIncluded ? precisionRound(price / (1 + VAT_DEFAULT)) : price; + const pricePerUnit = p.vatIncluded ? price / (1 + VAT_DEFAULT) : price; const vat = p.calcVat - ? precisionRound( - (pricePerUnit * (v.discount ? v.amount : 1) - (v.discount || 0)) * VAT_DEFAULT, - ) * (!v.discount ? v.amount : 1) + ? (pricePerUnit * (v.discount ? v.amount : 1) - (v.discount || 0)) * + VAT_DEFAULT * + (!v.discount ? v.amount : 1) : 0; return { order: i + 1,