{% extends "base.html" %} {% from "_componentes/tarjeta.html" import tarjeta %} {% from "_componentes/badges.html" import badge, badge_estado_alerta, badge_nivel_alerta %} {% from "_componentes/iconos.html" import icono %} {% from "operaciones/_paso5.html" import monto %} {% from "operaciones/_perfil.html" import perfil_observado, perfil_etiquetas %} {% set ancho = "amplio" %} {% block titulo %}Crédito {{ credito.id_externo }}{% endblock %} {% from "avisos/_reportes.html" import reportes_aviso %} {% block contenido %}

Crédito{% if credito.producto %} · {{ credito.producto }}{% endif %}

{{ credito.id_externo }}

{{ badge(credito.status | capitalize, "exito" if credito.status == "activo" else "neutro") }} {%- if credito.tipo_vehiculo or credito.marca %}{{ credito.tipo_vehiculo or "" }} {{ credito.marca or "" }} {{ credito.anio or "" }}{% endif %} ·Cliente {{ cliente.id_externo }} ·sus créditos ·sus operaciones en la cartera {%- if credito.agencia %}·Agencia {{ credito.agencia }}{% endif %} {%- for otro in otros_creditos %}{% if loop.first %}·Otros créditos:{% endif %} {{ otro.id_externo }}{% endfor %}

{{ reportes_aviso(reportes_sat, creditos_sat) }}
Monto del crédito{{ monto(credito.monto) }}{% if credito.plazo_originacion %}{{ credito.plazo_originacion }} meses{% endif %}{% if credito.tasa %} · {{ "{:.1%}".format(credito.tasa) }}{% endif %}
Pagado (total cobrado){{ monto(resumen.pagado_total) }}{{ resumen.transacciones }} transacciones
Capital pagado{{ monto(resumen.capital_pagado) }}Incluye enganche{% if resumen.prepagos %} · {{ resumen.prepagos }} con prepago ({{ monto(resumen.monto_prepagado) }}){% endif %}
Saldo insoluto al corte{{ monto(resumen.saldo_insoluto_corte) }}Según la carga
Vencido{{ monto(resumen.monto_vencido) }}{% if resumen.pagos_vencidos %}{{ resumen.pagos_vencidos }} pagos vencidos{% elif resumen.pagos_vencidos is none %}—{% else %}Sin pagos vencidos{% endif %}
Pagos{{ resumen.pagos }}Último {{ resumen.ultimo_pago.strftime("%d/%m/%Y") if resumen.ultimo_pago else "—" }}
{% set acciones %}{{ perfil_etiquetas(perfil) }}{% endset %} {% call tarjeta("Perfil declarado contra observado", subtitulo="Perfil transaccional vigente del cliente frente a su agregado de ventana", acciones=acciones, plano=True) %} {{ perfil_observado(perfil) }} {% endcall %} {% set acciones %}{{ resumen.transacciones }} en total{{ resumen.terceros }} de terceros{{ resumen.efectivo }} en efectivo{% endset %} {% call tarjeta("Transacciones", subtitulo="Más recientes primero" ~ ((" · " ~ resumen.posteriores_al_corte ~ " posteriores al corte") if resumen.posteriores_al_corte else ""), acciones=acciones, plano=True) %} {%- if resumen.posteriores_al_corte %}

Las transacciones posteriores al corte ({{ fecha_corte.strftime("%d/%m/%Y") }}) ya están cargadas, pero no entran en la ventana de los agregados hasta el cierre de periodo.

{%- endif %}
{%- for fila in transacciones | reverse %} fecha_corte %} class="es-posterior"{% endif %}> {%- else %} {%- endfor %}
FechaTipoDesgloseTotalMétodoTitular origenPrepagoOrigen
{{ fila.fecha_pago.strftime("%d/%m/%Y") }}{% if fila.fecha_pago > fecha_corte %} posterior al corte{% endif %} {{ (fila.tipo or "—") | capitalize }} {% for campo, titulo in desglose if fila[campo] %}{{ titulo }} {{ monto(fila[campo]) }}{% if not loop.last %} · {% endif %}{% else %}—{% endfor %} {{ monto(fila.total) }} {{ (fila.metodo or "—") | capitalize }} {% if fila.titular_origen %}{{ badge(fila.titular_origen, "peligro" if fila.titular_origen == "TERCERO" else ("aviso" if fila.titular_origen == "CUENTA" else "neutro")) }}{% else %}—{% endif %} {{ monto(fila.monto_prepago) if fila.monto_prepago else "—" }}{% if fila.reduccion %}
reduce {{ fila.reduccion }}
{% endif %}
{% if fila.lote_carga_id in lotes_incrementales %}carga {{ fila.lote_carga_id }}{% elif fila.lote_carga_id %}esquema{% else %}—{% endif %}
Sin transacciones.
{% endcall %} {% set acciones %}{{ icono("alertas", "icono--15") }}Todas las alertas del cliente{{ icono("chevron", "icono--14 icono--tenue") }}{% endset %} {% call tarjeta("Alertas del crédito", subtitulo=alertas | length ~ " alertas con este crédito (A-01, A-02, B-06, B-08, C-03, D-04…)", acciones=acciones, plano=True, id="alertas", clase="ancla") %} {%- if alertas %}
{%- for alerta, regla in alertas %} {%- endfor %}
ReglaNivelEstadoVenceResponsable
{{ regla.clave }} {{ regla.nombre }} {{ regla.version }} {{ badge_nivel_alerta(alerta.nivel) }} {{ badge_estado_alerta(alerta.estado) }} {{ alerta.vence_el.strftime("%d/%m/%Y") if alerta.vence_el else "—" }} {{ alerta.responsable or "—" }}
{%- else %}
{{ icono("check") }}Sin alertas para este créditoNinguna regla se ha disparado con sus operaciones al corte vigente.
{%- endif %} {% endcall %} {#- Columnas de la hoja Cartera del esquema: A es el crédito y B el cliente (sintético); el resto sigue el orden de services.creditos.CAMPOS_CARTERA. -#} {%- set letras = ["A", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "AA", "AB", "AC", "AD", "AE"] %} {% call tarjeta("Campos de la hoja Cartera", subtitulo="Columnas A–AE, tal como se importaron", plano=True) %}
{%- for c in campos %}
{% if campos | length == letras | length %}{{ letras[loop.index0] }}{% endif %}{{ c.titulo }}
{%- if c.valor is none or c.valor == "" %}— {%- elif c.formato == "monto" %}{{ monto(c.valor) }} {%- elif c.formato == "tasa" %}{{ "{:.2%}".format(c.valor) }} {%- elif c.formato == "fecha" %}{{ c.valor.strftime("%d/%m/%Y") }} {%- else %}{{ c.valor }}{% endif -%}
{%- if loop.first %}
{% if campos | length == letras | length %}B{% endif %}ID cliente (sintético)
{{ cliente.id_externo }}
{%- endif %} {%- endfor %}
{% endcall %} {% endblock %}