Show newest treasury ledger and documents first, including same-day create time.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-11-25 12:38:00 +03:30
co-authored by Cursor
parent 9acb73c197
commit db47fa4c0c
+4 -1
View File
@@ -409,6 +409,8 @@ export class TreasuryService {
balanceAfter: money(running),
};
});
// مانده به‌ترتیب زمانی محاسبه شد؛ برای نمایش جدیدترین بالا برعکس می‌کنیم
items.reverse();
return { account: await this.toAccountDto(account, range), items };
}
@@ -516,7 +518,8 @@ export class TreasuryService {
movements: true,
attachments: { select: { id: true, fileName: true, mimeType: true } },
},
orderBy: { bookedAt: 'desc' },
// تاریخ نزولی؛ در یک روز جدیدتر (ساعت ایجاد) بالا
orderBy: [{ bookedAt: 'desc' }, { createdAt: 'desc' }],
take: 200,
});
return rows.map((row) => this.toDocumentDto(row));