Show newest treasury ledger and documents first, including same-day create time.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -409,6 +409,8 @@ export class TreasuryService {
|
|||||||
balanceAfter: money(running),
|
balanceAfter: money(running),
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
// مانده بهترتیب زمانی محاسبه شد؛ برای نمایش جدیدترین بالا برعکس میکنیم
|
||||||
|
items.reverse();
|
||||||
return { account: await this.toAccountDto(account, range), items };
|
return { account: await this.toAccountDto(account, range), items };
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -516,7 +518,8 @@ export class TreasuryService {
|
|||||||
movements: true,
|
movements: true,
|
||||||
attachments: { select: { id: true, fileName: true, mimeType: true } },
|
attachments: { select: { id: true, fileName: true, mimeType: true } },
|
||||||
},
|
},
|
||||||
orderBy: { bookedAt: 'desc' },
|
// تاریخ نزولی؛ در یک روز جدیدتر (ساعت ایجاد) بالا
|
||||||
|
orderBy: [{ bookedAt: 'desc' }, { createdAt: 'desc' }],
|
||||||
take: 200,
|
take: 200,
|
||||||
});
|
});
|
||||||
return rows.map((row) => this.toDocumentDto(row));
|
return rows.map((row) => this.toDocumentDto(row));
|
||||||
|
|||||||
Reference in New Issue
Block a user