From 3885d9d35928854262fd0dc7eabaea8c8c5f3d2e Mon Sep 17 00:00:00 2001 From: Methapon Metanipat Date: Tue, 8 Oct 2024 10:02:49 +0700 Subject: [PATCH] fix: wrong price per unit --- src/controllers/05-quotation-controller.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/controllers/05-quotation-controller.ts b/src/controllers/05-quotation-controller.ts index 45afdc1..eb299b9 100644 --- a/src/controllers/05-quotation-controller.ts +++ b/src/controllers/05-quotation-controller.ts @@ -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,