diff --git a/src/controllers/05-payment-controller.ts b/src/controllers/05-payment-controller.ts index 5a811e9..cb23c17 100644 --- a/src/controllers/05-payment-controller.ts +++ b/src/controllers/05-payment-controller.ts @@ -137,7 +137,12 @@ export class QuotationPayment extends Controller { const paymentSum = await prisma.payment.aggregate({ _sum: { amount: true }, - where: { invoice: { quotationId: quotation.id } }, + where: { + invoice: { + quotationId: quotation.id, + payment: { paymentStatus: "PaymentSuccess" }, + }, + }, }); await tx.quotation.update({