{% extends "base.html" %} {% block title %}Libro de IVA{% endblock %} {% block page_title %}Libro de IVA{% endblock %} {% block topbar_actions %} Exportar Excel {% endblock %} {% block extra_head %} {% endblock %} {% block content %}
{% for val, lbl in [('anual','Anual'),('1','T1 (Ene–Mar)'),('2','T2 (Abr–Jun)'),('3','T3 (Jul–Sep)'),('4','T4 (Oct–Dic)')] %} {{ lbl }} {% endfor %}
{% for t in trimestres %}
{{ t.label }} — {{ año }}
IVA repercutido{{ "%.2f"|format(t.iva_repercutido) }} €
IVA soportado{{ "%.2f"|format(t.iva_soportado) }} €
A {% if t.cuota >= 0 %}ingresar{% else %}devolver{% endif %} {{ "%.2f"|format(t.cuota|abs) }} €
{% endfor %}
LIQUIDACIÓN — {{ fecha_ini }} a {{ fecha_fin }}
{% if tot_rect_iva > 0 %} {% endif %}
IVA repercutido {{ "%.2f"|format(tot_rep_iva) }} €
— Rectificativas −{{ "%.2f"|format(tot_rect_iva) }} €
IVA repercutido neto {{ "%.2f"|format(iva_repercutido_neto) }} €
IVA soportado −{{ "%.2f"|format(iva_soportado) }} €
{% if cuota_diferencial >= 0 %}A ingresar{% else %}A devolver{% endif %} {{ "%.2f"|format(cuota_diferencial|abs) }} €
IVA REPERCUTIDO (EMITIDAS)
Facturas{{ emitidas|length }}
Base imponible{{ "%.2f"|format(tot_rep_base) }} €
Cuota IVA{{ "%.2f"|format(tot_rep_iva) }} €
{% if rectificativas %}
Rectificativas ({{ rectificativas|length }})−{{ "%.2f"|format(tot_rect_iva) }} €
{% endif %}
IVA SOPORTADO (RECIBIDAS)
Facturas{{ recibidas|length }}
Base imponible{{ "%.2f"|format(tot_sop_base) }} €
Cuota IVA{{ "%.2f"|format(iva_soportado) }} €
IRPF retenido{{ "%.2f"|format(tot_sop_irpf) }} €
{% if emitidas %} {% for f in emitidas %} {% endfor %}
NúmeroFechaCliente Base imp.IVA % Cuota IVATotal Estado
{{ f.numero }} {{ f.fecha }} {{ f.cliente or '—' }} {{ "%.2f"|format(f.subtotal) }} € {{ f.iva_pct }}% {{ "%.2f"|format(f.iva_importe) }} € {{ "%.2f"|format(f.total) }} € {{ f.estado|capitalize }}
TOTAL {{ "%.2f"|format(tot_rep_base) }} € {{ "%.2f"|format(tot_rep_iva) }} € {{ "%.2f"|format(tot_rep_base + tot_rep_iva - tot_rep_irpf) }} €
{% else %}
No hay facturas emitidas en este período.
{% endif %}
{% if recibidas %} {% for f in recibidas %} {% endfor %}
NúmeroFechaProveedor Base imp.IVA % Cuota IVATotal Estado
{{ f.numero }} {{ f.fecha }} {{ f.proveedor or '—' }} {{ "%.2f"|format(f.subtotal) }} € {{ f.iva_pct }}% {{ "%.2f"|format(f.iva_importe) }} € {{ "%.2f"|format(f.total) }} € {{ f.estado|capitalize }}
TOTAL {{ "%.2f"|format(tot_sop_base) }} € {{ "%.2f"|format(iva_soportado) }} € {{ "%.2f"|format(tot_sop_base + iva_soportado - tot_sop_irpf) }} €
{% else %}
No hay facturas recibidas en este período.
{% endif %}
{% if rectificativas %}
{% for r in rectificativas %} {% endfor %}
NúmeroFechaClienteRectifica Base imp.IVA % Cuota IVATotal
{{ r.numero }} {{ r.fecha }} {{ r.cliente or '—' }} {{ r.origen_numero or '—' }} {{ "%.2f"|format(r.subtotal) }} € {{ r.iva_pct }}% −{{ "%.2f"|format(r.iva_importe) }} € {{ "%.2f"|format(r.total) }} €
TOTAL (reduce IVA repercutido) {{ "%.2f"|format(tot_rect_base) }} € −{{ "%.2f"|format(tot_rect_iva) }} € {{ "%.2f"|format(tot_rect_base + tot_rect_iva) }} €
{% endif %}
{% endblock %}