{% extends "base.html" %} {% block title %}Facturas emitidas{% endblock %} {% block page_title %}Facturas emitidas{% endblock %} {% block topbar_actions %} Nueva factura {% endblock %} {% block content %} {% set totales_dict = {} %} {% for t in totales %}{% set _ = totales_dict.update({t.estado: t}) %}{% endfor %}
{% for estado, color, label, g1, g2, bc in [ ('pendiente','warning','Pendientes','#fffbeb','#fef3c7','#f59e0b'), ('pagada','success','Pagadas','#f0fdf4','#dcfce7','#10b981'), ('vencida','danger','Vencidas','#fff5f5','#fee2e2','#ef4444'), ('cancelada','secondary','Canceladas','#f8fafc','#f1f5f9','#94a3b8') ] %}
{{ label }}
{% if estado in totales_dict %}{{ "%.2f"|format(totales_dict[estado].suma) }} €{% else %}0.00 €{% endif %}
{% if estado in totales_dict %}{{ totales_dict[estado].cnt }} factura(s){% else %}0{% endif %}
{% endfor %}
{% if estado_filtro %}{{ estado_filtro|capitalize }}s{% else %}Todas{% endif %}
{% if estado_filtro %}{% endif %}
{% if estado_filtro %}Todas{% endif %}
{% for f in facturas %} {% else %} {% endfor %}
NúmeroClienteFechaVencimiento EstadoTotal
{{ f.numero }} {% if f.etiquetas %}
{% for tag in f.etiquetas.split(',') %}{% set t = tag.strip() %}{% if t %} {{ t }} {% endif %}{% endfor %}
{% endif %}
{{ f.cliente_nombre or '—' }} {{ f.fecha }} {{ f.fecha_vencimiento or '—' }} {{ f.estado|capitalize }} {{ "%.2f"|format(f.total) }} €
Sin facturas
{% endblock %}