feat: update quotation payment data

This commit is contained in:
Methapon Metanipat 2024-10-17 13:25:17 +07:00
parent 199dba850a
commit 4e5825c236

View file

@ -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