Enhance Telegram bot UI with YTD comparison, 12-month evolution, and improved navigation
- Add YTD year-over-year comparison table for cash flow evolution - Extend monthly evolution from 6 to 12 months with dynamic year extraction - Simplify monthly view to show only Net values aligned with YTD table - Upgrade client/supplier display from Top 5 to Top 10 with alphabetical sorting - Remove Refresh and Export buttons from dashboard and evolution views - Add get_trends() API method for 12-month historical data from backend - Fix default years to 2025/2024 for accurate YTD calculations Changes: - client.py: New get_trends() method calls /api/dashboard/trends endpoint - helpers.py: Rewrite get_cashflow_evolution_data() to use trends and calculate YTD - formatters.py: Complete redesign with YTD table and simplified 12-month Net view - menus.py: Alphabetical sorting for clients/suppliers, removed refresh buttons - handlers.py: Disabled refresh/export buttons on dashboard and evolution views 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -984,7 +984,7 @@ async def evolutie_command(update: Update, context: ContextTypes.DEFAULT_TYPE):
|
||||
evolution_data['monthly']
|
||||
)
|
||||
response = format_response_with_company(content, company['name'])
|
||||
keyboard = create_action_buttons("evolutie", show_export=False)
|
||||
keyboard = create_action_buttons("evolutie", show_export=False, show_refresh=False)
|
||||
|
||||
await update.message.reply_text(
|
||||
response,
|
||||
@@ -1301,7 +1301,7 @@ async def handle_menu_callback(query, telegram_user_id: int, callback_data: str)
|
||||
evolution_data['monthly']
|
||||
)
|
||||
response = format_response_with_company(content, company['name'])
|
||||
keyboard = create_action_buttons("evolutie", show_export=False)
|
||||
keyboard = create_action_buttons("evolutie", show_export=False, show_refresh=False)
|
||||
|
||||
await query.edit_message_text(
|
||||
response,
|
||||
@@ -2149,7 +2149,7 @@ async def _handle_sold_view(
|
||||
|
||||
content = format_dashboard_response(data)
|
||||
response = format_response_with_company(content, company['name'])
|
||||
keyboard = create_action_buttons("sold", show_export=True)
|
||||
keyboard = create_action_buttons("sold", show_export=False, show_refresh=False)
|
||||
|
||||
if is_callback:
|
||||
await query_or_update.edit_message_text(
|
||||
|
||||
Reference in New Issue
Block a user