fix: only sum from payment success status
This commit is contained in:
parent
1ae40f5114
commit
c8146ae8f1
1 changed files with 6 additions and 1 deletions
|
|
@ -137,7 +137,12 @@ export class QuotationPayment extends Controller {
|
||||||
|
|
||||||
const paymentSum = await prisma.payment.aggregate({
|
const paymentSum = await prisma.payment.aggregate({
|
||||||
_sum: { amount: true },
|
_sum: { amount: true },
|
||||||
where: { invoice: { quotationId: quotation.id } },
|
where: {
|
||||||
|
invoice: {
|
||||||
|
quotationId: quotation.id,
|
||||||
|
payment: { paymentStatus: "PaymentSuccess" },
|
||||||
|
},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
await tx.quotation.update({
|
await tx.quotation.update({
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue