feat: detect if agent price
This commit is contained in:
parent
66f3188f42
commit
3857de8d2b
1 changed files with 8 additions and 2 deletions
|
|
@ -62,6 +62,8 @@ type QuotationCreate = {
|
|||
|
||||
urgent?: boolean;
|
||||
|
||||
agentPrice?: boolean;
|
||||
|
||||
productServiceList: {
|
||||
serviceId?: string;
|
||||
workId?: string;
|
||||
|
|
@ -325,7 +327,9 @@ export class QuotationController extends Controller {
|
|||
productId: v.productId,
|
||||
workId: v.workId,
|
||||
serviceId: v.serviceId,
|
||||
pricePerUnit: v.pricePerUnit || product.find((p) => p.id === v.productId)?.price || 0,
|
||||
pricePerUnit:
|
||||
product.find((p) => p.id === v.productId)?.[body.agentPrice ? "agentPrice" : "price"] ||
|
||||
0,
|
||||
amount: v.amount,
|
||||
discount: v.discount || 0,
|
||||
vat: v.vat || VAT_DEFAULT,
|
||||
|
|
@ -518,7 +522,9 @@ export class QuotationController extends Controller {
|
|||
productId: v.productId,
|
||||
workId: v.workId,
|
||||
serviceId: v.serviceId,
|
||||
pricePerUnit: v.pricePerUnit || product.find((p) => p.id === v.productId)?.price || 0,
|
||||
pricePerUnit:
|
||||
product.find((p) => p.id === v.productId)?.[record.agentPrice ? "agentPrice" : "price"] ||
|
||||
0,
|
||||
amount: v.amount,
|
||||
discount: v.discount || 0,
|
||||
vat: v.vat || VAT_DEFAULT,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue