{% extends "base.html" %} {% block contenido %}
{{ _('Confirmación de Saldo') }} {{ confirmation.document_no }}
{% if confirmation.status == 'draft' %} {{ _('Borrador') }} {% elif confirmation.status == 'sent' %} {{ _('Enviada') }} {% elif confirmation.status == 'viewed' %} {{ _('Visualizada') }} {% elif confirmation.status == 'confirmed' %} {{ _('Confirmada') }} {% elif confirmation.status == 'disputed' %} {{ _('Disputada') }} {% elif confirmation.status == 'cancelled' %} {{ _('Cancelada') }} {% elif confirmation.status == 'expired' %} {{ _('Expirada') }} {% endif %}

{{ party.name }}

{{ company.company_name if company else confirmation.company }}

{{ confirmation.cutoff_date.strftime('%d/%m/%Y') }}

{{ confirmation.created.strftime('%d/%m/%Y %H:%M') }}

{{ confirmation.expires_at.strftime('%d/%m/%Y %H:%M') if confirmation.expires_at else '-' }}

{% if confirmation.status in ('confirmed', 'disputed') %}
{{ _('Evidencia de Respuesta') }}

{{ _('Conciliado') if confirmation.status == 'confirmed' else _('No conciliado') }}

{{ confirmation.respondent_first_name }} {{ confirmation.respondent_last_name }} ({{ confirmation.respondent_email }})

{{ confirmation.responded_at.strftime('%d/%m/%Y %H:%M:%S UTC') }}

{{ confirmation.respondent_ip }}
{{ confirmation.respondent_user_agent }}

{% if confirmation.response_comment %}

"{{ confirmation.response_comment }}"

{% endif %}

{{ confirmation.snapshot_hash }}

{% endif %}
{{ _('Partidas Incluidas en Snapshot') }}
{% if snapshot["items"] %}
{% for item in snapshot["items"] %} {% endfor %}
{{ _('Partidas Incluidas en Snapshot') }}
{{ _('Documento') }} {{ _('Referencia') }} {{ _('Fecha') }} {{ _('Vencimiento') }} {{ _('Moneda') }} {{ _('Importe Original') }} {{ _('Saldo Pendiente') }}
{{ item.document_type }} {{ item.document_no }} {{ item.document_date if item.document_date else '-' }} {{ item.due_date if item.due_date else '-' }} {{ item.currency }} {{ "{:,.2f}".format(item.original_amount|float) }} {{ "{:,.2f}".format(item.outstanding_amount|float) }}
{{ _('Totales por Moneda') }}
{% for currency, total_val in snapshot["totals"].items() %}
{{ _('Total Pendiente') }} ({{ currency }}): {{ currency }} {{ "{:,.2f}".format(total_val|float) }}
{% endfor %}
{% else %}

{{ _('El snapshot no contiene partidas abiertas.') }}

{% endif %}
{{ _('Acciones de Solicitud') }}
{% if confirmation.status == 'draft' %}
{% elif confirmation.status in ('sent', 'viewed') %}
{% endif %} {% if confirmation.status not in ('confirmed', 'disputed', 'cancelled', 'expired') %}
{% endif %} {% if confirmation.party_type == 'customer' %} {{ _('Regresar al Cliente') }} {% else %} {{ _('Regresar al Proveedor') }} {% endif %}
{{ _('Destinatarios Autorizados') }}
{% for inv in invitations %}
{{ inv.email }} {% if inv.status == 'responded' %} {{ _('Respondió') }} {% elif inv.status == 'viewed' %} {{ _('Visualizó') }} {% elif inv.status == 'cancelled' %} {{ _('Cancelada') }} {% elif inv.status == 'expired' %} {{ _('Expirada') }} {% else %} {{ _('Pendiente') }} {% endif %}
{% if inv.sent_at %}

{{ _('Enviado:') }} {{ inv.sent_at.strftime('%d/%m/%Y %H:%M') }}

{% endif %} {% if inv.last_access_at %}

{{ _('Último acceso:') }} {{ inv.last_access_at.strftime('%d/%m/%Y %H:%M') }}

{% endif %} {% if inv.failed_attempts > 0 %}

{{ _('Intentos fallidos:') }} {{ inv.failed_attempts }}

{% endif %}
{% endfor %}
{{ _('Historial de Auditoría') }}
{% for log in audit_timeline %}
{{ log.event.actor_name or 'Sistema' }} {{ log.event.timestamp.strftime('%d/%m %H:%M') }}

{% if log.event.action == 'balance_confirmation_created' %} {{ _('Creación Borrador') }} {% elif log.event.action == 'balance_confirmation_sent' %} {{ _('Enviada por Correo') }} {% elif log.event.action == 'balance_confirmation_resent' %} {{ _('Reenviada') }} {% elif log.event.action == 'balance_confirmation_viewed' %} {{ _('Visualizada') }} {% elif log.event.action == 'balance_confirmation_verified' %} {{ _('Identidad Verificada') }} {% elif log.event.action == 'balance_confirmation_confirmed' %} {{ _('Saldo Confirmado/Conciliado') }} {% elif log.event.action == 'balance_confirmation_disputed' %} {{ _('Saldo Disputado') }} {% elif log.event.action == 'balance_confirmation_cancelled' %} {{ _('Cancelada') }} {% else %} {{ log.event.action }} {% endif %}

{% if log.event.comment %}

{{ log.event.comment }}

{% endif %}
{% endfor %}
{% endblock %}