{% extends "expenses/base.html" %} {% load l10n %} {% block title %}Dashboard{% endblock %} {% block content %}

{% if selected_account_obj %} {{ selected_account_obj.name }} {% else %} Todas las cuentas {% endif %}

{% if selected_month %} {{ selected_month }}/{{ selected_year}} {% else %} Año {{ selected_year }} {% endif %}

Este mes Mes anterior Este año {% if period %} ❌ Quitar filtros temporales {% endif %}

{% if period %} {% endif %} {% if not period %} {% endif %}
Saldo actual {{ kpi_balance|floatformat:2 }}€
Gastos totales {{ kpi_total|floatformat:2 }}€
Nº de gastos {{ kpi_count }}
Categorías {{ kpi_categories }}
Media diaria {{ daily_average|floatformat:2 }}€ / día
{% if selected_month == today.month and selected_year == today.year %}
Proyección fin de mes {{ projected_end_of_month|floatformat:2 }}€ Basado en tu ritmo de gasto actual
{% endif %}
{% if compare_enabled %}

Resumen comparativo

Gastos periodo actual: {{ kpi_total|floatformat:2 }} €
Gastos periodo anterior: {{ kpi_previous_total|floatformat:2 }} €
Diferencia: {% if kpi_trend == "up" %}+{% endif %}{{ kpi_difference|floatformat:2 }}€ ({{ kpi_percentage|floatformat:1 }}%) {% if kpi_trend == "up" %}⚠️ Has gastado más que el periodo pasado. {% else %} ¡Bien! Has reducido tus gastos. {% endif %}

Desglose de cambios por categoría

{% for cat in category_comparison %} {% endfor %}
Categoría Periodo Anterior Periodo Actual Variación
{{ cat.category }} {{ cat.previous|floatformat:2 }}€ {{ cat.current|floatformat:2 }}€ {% if cat.difference > 0 %}+{% endif %}{{ cat.difference|floatformat:2 }}€
{% endif %}

Evolución de Gastos ({% if chart_type == 'day' %}Por día {% else %} Por Meses{% endif %})

Distribución por Categorías

Gastos Recientes

{% for exp in recent_expenses %} {% empty %} {% endfor %}
Fecha cuenta Categoría Concepto Importe
{{ exp.date|date:"d/m/Y" }} {{ exp.account.name }} {{ exp.category.name }} {{ exp.description|default:"-" }} {{ exp.amount|floatformat:2 }}
No hay gastos recientes registrados

Evolución anual por cuenta ({{ selected_year }})

{% for acc in accounts_charts %}

{{ acc.name }}

Saldo actual: {{ acc.current_balance|floatformat:2 }}€

{% endfor %}
{% if compare_enabled %}

Comparativa

Diferencia: {% if kpi_trend == "up" %}+{% endif %} {{ kpi_difference_abs|floatformat:2 }} € {% if kpi_percentage %} ({{ kpi_percentage|floatformat:1 }}%) {% endif %}

{% endif %}

Objetivos

{% if goals %}
{% for goal in goals %}
{{ goal.name }}
{{ goal.progress|floatformat:1 }}€ / {{ goal.target_amount|floatformat:1 }}€ ({{ goal.percentage|floatformat:1 }}%)
{% endfor %}
{% else %}

No hay objetivos.

{% endif %} {% for row in by_category %} {% endfor %}
Categoría Total
{{ row.category__name }} {{ row.total|floatformat:2 }} €
{% endblock %}