diff --git a/src/controllers/05-quotation-controller.ts b/src/controllers/05-quotation-controller.ts index aa953e2..a220f8f 100644 --- a/src/controllers/05-quotation-controller.ts +++ b/src/controllers/05-quotation-controller.ts @@ -691,6 +691,20 @@ export class QuotationController extends Controller { data: { ...rest, ...price, + quotationPaymentData: + price && record.quotationStatus === "PaymentPending" + ? { + create: rest.paySplit?.map((v) => ({ + paymentStatus: "PaymentWait", + amount: v.amount, + date: new Date(), + })) || { + paymentStatus: "PaymentWait", + amount: price.finalPrice, + date: new Date(), + }, + } + : undefined, statusOrder: +(rest.status === "INACTIVE"), worker: sortedEmployeeId.length > 0