{% import "macros.html" as macros %}
{% for grupo in data.estado_moneda_grupos %}
[{{ data.cliente_codigo }}]
{{ data.cliente_nombre }}

{% if grupo.estado == 'COBRADA' and data.idioma == 'es' %} Facturas cobradas ({{ grupo.moneda }}) {% elif grupo.estado == 'COBRADA' and data.idioma == 'en' %} Paid invoices ({{ grupo.moneda }}) {% elif grupo.estado == 'POR COBRAR' and data.idioma == 'es' %} Facturas por cobrar ({{ grupo.moneda }}) {% elif grupo.estado == 'POR COBRAR' and data.idioma == 'en' %} Outstanding invoices ({{ grupo.moneda }}) {% else %} {{ grupo.estado }} ({{ grupo.moneda }}) {% endif %}

{% for r in grupo.resumen %}
{% for f in grupo.facturas %} {% endfor %}
# No. {% if data.idioma == 'es' %} Fecha Emisión {% else %} Issue Date {% endif %} {% if data.idioma == 'es' %} Fecha Pago {% else %} Payment Date {% endif %} {% if data.idioma == 'es' %} Días Vencido {% else %} Days Overdue {% endif %} {% if data.idioma == 'es' %} Monto {% else %} Amount {% endif %} {% if data.idioma == 'es' %} Pendiente {% else %} Pending {% endif %}
{{ loop.index }} {{ f.factura_nro }} {{ f.factura_fecha_emision_str }} {{ f.factura_fecha_pago_str or '' }} {{ f.dias_vencido }} {{ f.factura_total_str }} {{ f.factura_pendiente_str }}
{{ r.cantidad_facturas }} {{ r.promedio_dias_vencido }} {{ r.total_str }} {{ r.total_pendiente_str }}
{% endfor %}
{% endfor %}