fix: empty payment data on full payment
This commit is contained in:
parent
b4fb53cdcf
commit
2c90c0c143
1 changed files with 24 additions and 18 deletions
|
|
@ -466,15 +466,18 @@ export class QuotationController extends Controller {
|
|||
...rest,
|
||||
...price,
|
||||
quotationPaymentData: {
|
||||
create: rest.paySplit?.map((v) => ({
|
||||
paymentStatus: "PaymentWait",
|
||||
amount: v.amount,
|
||||
date: v.date,
|
||||
})) || {
|
||||
paymentStatus: "PaymentWait",
|
||||
amount: price.finalPrice,
|
||||
date: new Date(),
|
||||
},
|
||||
create:
|
||||
rest.payCondition === "BillSplit" || rest.payCondition === "Split"
|
||||
? rest.paySplit?.map((v) => ({
|
||||
paymentStatus: "PaymentWait",
|
||||
amount: v.amount,
|
||||
date: v.date,
|
||||
}))
|
||||
: {
|
||||
paymentStatus: "PaymentWait",
|
||||
amount: price.finalPrice,
|
||||
date: new Date(),
|
||||
},
|
||||
},
|
||||
statusOrder: +(rest.status === "INACTIVE"),
|
||||
code: `${currentYear.toString().padStart(2, "0")}${currentMonth.toString().padStart(2, "0")}${currentDate.toString().padStart(2, "0")}${lastQuotation.value.toString().padStart(4, "0")}`,
|
||||
|
|
@ -721,15 +724,18 @@ export class QuotationController extends Controller {
|
|||
price && record.quotationStatus === "PaymentPending"
|
||||
? {
|
||||
deleteMany: {},
|
||||
create: rest.paySplit?.map((v) => ({
|
||||
paymentStatus: "PaymentWait",
|
||||
amount: v.amount,
|
||||
date: v.date,
|
||||
})) || {
|
||||
paymentStatus: "PaymentWait",
|
||||
amount: price.finalPrice,
|
||||
date: new Date(),
|
||||
},
|
||||
create:
|
||||
rest.payCondition === "BillSplit" || rest.payCondition === "Split"
|
||||
? rest.paySplit?.map((v) => ({
|
||||
paymentStatus: "PaymentWait",
|
||||
amount: v.amount,
|
||||
date: v.date,
|
||||
}))
|
||||
: {
|
||||
paymentStatus: "PaymentWait",
|
||||
amount: price.finalPrice,
|
||||
date: new Date(),
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
statusOrder: +(rest.status === "INACTIVE"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue