mirror of
https://github.com/koloideal/DutyLog.git
synced 2026-06-10 18:35:29 +03:00
update
This commit is contained in:
@@ -81,9 +81,9 @@ async def get_main_menu_data(
|
||||
|
||||
⏰ <b>Ваши часы дежурств</b>
|
||||
|
||||
<blockquote>🟢 <b>Отработанные часы:</b> <code>{resident.active_hours}</code> ч
|
||||
<blockquote>🟢 <b>Отработанные часы:</b> <code>{resident.inactive_hours}</code> ч
|
||||
━━━━━━━━━━━━━━━━
|
||||
🔴 Неотработанные часы: <code>{resident.inactive_hours}</code> ч</blockquote>
|
||||
🔴 Неотработанные часы: <code>{resident.active_hours}</code> ч</blockquote>
|
||||
"""
|
||||
has_resident = True
|
||||
else:
|
||||
@@ -120,7 +120,8 @@ async def get_history_data(
|
||||
"""
|
||||
else:
|
||||
transactions = await transactions_repository.get_resident_history(resident.id)
|
||||
last_10 = transactions[:10]
|
||||
transactions_sorted = sorted(transactions, key=lambda x: x.created_at)
|
||||
last_10 = transactions_sorted[:10]
|
||||
|
||||
if not last_10:
|
||||
history_text = """
|
||||
@@ -131,7 +132,7 @@ async def get_history_data(
|
||||
else:
|
||||
history_lines = []
|
||||
for tx in last_10:
|
||||
emoji = "➕" if tx.transaction_type == "increase" else "➖"
|
||||
emoji = "+" if tx.transaction_type == "increase" else "-"
|
||||
date_str = tx.created_at.strftime("%d.%m.%Y %H:%M")
|
||||
history_lines.append(
|
||||
f"{emoji} <code>{tx.amount}</code> ч • <i>{date_str}</i>"
|
||||
|
||||
Reference in New Issue
Block a user