fix: scope permission
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 10s

This commit is contained in:
Methapon2001 2025-03-05 08:49:27 +07:00
parent 5c58953820
commit 2502b7c68f

View file

@ -449,7 +449,14 @@ export class StatsController extends Controller {
data: await tx.payment data: await tx.payment
.groupBy({ .groupBy({
_sum: { amount: true }, _sum: { amount: true },
where: { createdAt: { gte: v, lte: date.endOf("month").toDate() } }, where: {
createdAt: { gte: v, lte: date.endOf("month").toDate() },
invoice: {
quotation: {
registeredBranch: { OR: permissionCondCompany(req.user) },
},
},
},
by: "paymentStatus", by: "paymentStatus",
}) })
.then((v) => .then((v) =>