{% extends 'base.html' %} {% block content %}

Mi facturación SaaS

Consulta de liquidaciones, deuda y pagos de la institución.

{% if current_user.role in ['admin','accounting'] and institutions %}
{% endif %}
{{ institution.name }}
CUIT: {{ institution.cuit or '—' }} · Responsable: {{ institution.responsable or '—' }}
{% if institution.logo_path %}Logo{% endif %}
Facturado
$ {{ '%.2f'|format(total_billed) }}
Pagado
$ {{ '%.2f'|format(total_paid) }}
Deuda pendiente
$ {{ '%.2f'|format(total_debt) }}
Liquidaciones{{ invoices|length }} registros
{% for i in invoices %} {% else %}{% endfor %}
PeríodoEmisiónVencimientoTotalPagadoDeudaEstadoAcciones
{{ i.period }} {{ i.issue_date.strftime('%d/%m/%Y') if i.issue_date else '—' }} {{ i.due_date.strftime('%d/%m/%Y') if i.due_date else '—' }} $ {{ '%.2f'|format(i.total_amount or 0) }} $ {{ '%.2f'|format(i.paid_amount or 0) }} $ {{ '%.2f'|format(i.debt_amount) }} {{ i.status }}
PDF {% if i.status in ['pendiente','parcial'] and i.debt_amount > 0 %} {% if i.mercadopago_init_point or i.mercadopago_sandbox_init_point %} Pagar {% else %} Generar pago {% endif %} {% endif %}
{% if i.mercadopago_status %}
Mercado Pago: {{ i.mercadopago_status }} {{ i.mercadopago_status_detail or '' }}
{% endif %}
Todavía no hay liquidaciones para esta institución.
Pagos registrados
{% for p in payments %}{% else %}{% endfor %}
FechaPeríodoMétodoImporteReferenciaEstado
{{ p.payment_date.strftime('%d/%m/%Y') if p.payment_date else '—' }}{{ p.invoice.period }}{{ p.method }}$ {{ '%.2f'|format(p.amount or 0) }}{{ p.reference or p.mercadopago_payment_id or '—' }}{{ p.status or p.mercadopago_status or 'registrado' }}
Sin pagos registrados.
{% endblock %}