fix: wrong price per unit

This commit is contained in:
Methapon Metanipat 2024-10-08 10:02:49 +07:00
parent 1b84f345e7
commit 3885d9d359

View file

@ -357,9 +357,7 @@ export class QuotationController extends Controller {
productId: v.productId,
workId: v.workId,
serviceId: v.serviceId,
pricePerUnit:
product.find((p) => p.id === v.productId)?.[body.agentPrice ? "agentPrice" : "price"] ||
0,
pricePerUnit,
amount: v.amount,
discount: v.discount || 0,
vat,
@ -563,10 +561,7 @@ export class QuotationController extends Controller {
productId: v.productId,
workId: v.workId,
serviceId: v.serviceId,
pricePerUnit:
product.find((p) => p.id === v.productId)?.[
record.agentPrice ? "agentPrice" : "price"
] || 0,
pricePerUnit,
amount: v.amount,
discount: v.discount || 0,
vat,