fix: double payment data on update

This commit is contained in:
Methapon Metanipat 2024-10-18 09:50:05 +07:00
parent 323f5431a1
commit d639e5d4bf

View file

@ -722,6 +722,7 @@ export class QuotationController extends Controller {
quotationPaymentData: quotationPaymentData:
price && record.quotationStatus === "PaymentPending" price && record.quotationStatus === "PaymentPending"
? { ? {
deleteMany: {},
create: rest.paySplit?.map((v) => ({ create: rest.paySplit?.map((v) => ({
paymentStatus: "PaymentWait", paymentStatus: "PaymentWait",
amount: v.amount, amount: v.amount,