{% extends 'base.html.twig' %} {% block title %}{{ 'dashboard.title'|trans }} - CxP GT{% endblock %} {% block page_title %}{{ 'dashboard.title'|trans }}{% endblock %} {% block body %} {% set currentUser = app.user %} {% set userInitials = currentUser ? currentUser.nombre|slice(0, 2)|upper : 'US' %} {% set roleName = currentUser ? get_user_role_name(currentUser) : 'user.fallback_name'|trans %} {% set userPhoto = currentUser and currentUser.foto ? '/' ~ currentUser.foto|trim('/') : null %} {% set themeMap = { slate: {shell: 'from-slate-950 via-slate-900 to-slate-800', badge: 'bg-white/10 text-slate-100', accent: 'text-slate-100', icon: 'bg-white/10 text-white'}, amber: {shell: 'from-amber-500 via-orange-500 to-amber-600', badge: 'bg-white/20 text-amber-50', accent: 'text-amber-50', icon: 'bg-white/15 text-white'}, emerald: {shell: 'from-emerald-500 via-teal-500 to-emerald-600', badge: 'bg-white/20 text-emerald-50', accent: 'text-emerald-50', icon: 'bg-white/15 text-white'}, rose: {shell: 'from-fuchsia-500 via-rose-500 to-pink-600', badge: 'bg-white/20 text-rose-50', accent: 'text-rose-50', icon: 'bg-white/15 text-white'} } %}
{% if userPhoto %} {% else %} {% endif %}

{{ 'dashboard.main_panel'|trans }}

{{ 'dashboard.welcome'|trans({'%name%': currentUser ? currentUser.nombre : 'user.fallback_name'|trans}) }}

{{ 'dashboard.welcome_copy'|trans }}

{{ roleName }}
{% for metric in metrics %} {% set palette = themeMap[metric.theme] %}
{% if loop.index == 1 %} {% elseif loop.index == 2 %} {% elseif loop.index == 3 %} {% else %} {% endif %}
{{ 'dashboard.open_filter'|trans }}

{{ metric.label }}

{% if loop.index in [2, 3, 4] %}{{ currencySymbol }} {{ metric.value|number_format(2, '.', ',') }}{% else %}{{ metric.value|number_format(0, '.', ',') }}{% endif %}

{{ metric.hint }}

{% endfor %}

{{ 'dashboard.due_radar'|trans }}

{{ 'dashboard.due_projection'|trans }}

{{ 'dashboard.due_projection_copy'|trans }}

{% if projectionStats.total <= 0 and overdueSummary.count > 0 %}

{{ 'dashboard.no_upcoming_due'|trans({'%from%': projectionWindow.from, '%to%': projectionWindow.to}) }}

{{ 'dashboard.overdue_summary'|trans({'%count%': overdueSummary.count, '%symbol%': currencySymbol, '%amount%': overdueSummary.amount|number_format(2, '.', ',')}) }}

{{ 'dashboard.view_overdue'|trans }}
{% endif %}
{{ 'dashboard.projected_total'|trans }}
{{ currencySymbol }} {{ projectionStats.total|number_format(2, '.', ',') }}
{{ 'dashboard.daily_peak'|trans }}
{{ currencySymbol }} {{ projectionStats.peak|number_format(2, '.', ',') }}
{{ 'dashboard.average'|trans }}
{{ currencySymbol }} {{ projectionStats.average|number_format(2, '.', ',') }}
{% if projectionStats.total > 0 %}
{% for row in projectionHighlights %} {% endfor %}
{% else %}
{% include 'components/_empty_state.html.twig' with {title: 'dashboard.no_due_title'|trans, message: 'dashboard.no_due_copy'|trans} only %}
{% endif %}

{{ 'dashboard.document_tracking'|trans }}

{{ 'dashboard.recent_documents'|trans }}

{{ 'dashboard.recent_documents_copy'|trans }}

{{ 'dashboard.view_portfolio'|trans }}
{% if recentDocuments %}
{% for doc in recentDocuments %}

{{ doc.documento }}

{{ doc.proveedor }}

{{ doc.estado }}
{{ 'label.date'|trans }}
{{ doc.fecha }}
{{ 'dashboard.balance'|trans }}
{{ doc.saldo }}
{{ 'button.view'|trans }}
{% endfor %}
{% else %}
{% include 'components/_empty_state.html.twig' with {title: 'dashboard.no_documents_title'|trans, message: 'dashboard.no_documents_copy'|trans} only %}
{% endif %}
{% if projectionStats.total > 0 %} {% endif %} {% endblock %}