fix: calc vat

This commit is contained in:
Methapon Metanipat 2024-10-18 14:18:24 +07:00
parent fd3366262f
commit ee113b3820

View file

@ -625,7 +625,7 @@ 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 ? precisionRound(price / (1 + VAT_DEFAULT)) : price;
const vat = p.calcVat
? precisionRound((pricePerUnit * v.amount - (v.discount || 0)) * VAT_DEFAULT)
: 0;