{% extends "base.html" %} {% block title %}{{ title }}{% endblock %} {% block content %}

{{ title }}

Selecciona los planes que deseas incluir en la propuesta personalizada

Cliente: {{ client_name }}

{{ supply_address }}

{% if existing_proposals %}
Propuestas anteriores
{% for doc in existing_proposals %} {% endfor %}
Fecha Nombre Planes incluidos Acciones
{{ doc.created_at.strftime('%d/%m/%Y %H:%M') }} {{ doc.file_name }} {% if doc.document_metadata and doc.document_metadata.get('planes_incluidos') %} {{ doc.document_metadata.get('planes_incluidos')|join(', ') }} {% else %} No disponible {% endif %}
{% endif %} {% if original_invoice %}
Factura original

{{ original_invoice.file_name }}

Subido el {{ original_invoice.created_at.strftime('%d/%m/%Y %H:%M') }}
{% endif %}
Planes a incluir en la propuesta
{% for plan in plans %}
Coste mensual: {% set monthly_cost = plan.get('new_total_cost') or plan.get('ole_cost') %} {% if monthly_cost is none or monthly_cost is sameas false %} {% if plan.get('current_cost', 0) > 0 and plan.get('savings_percentage', 0) > 0 %} {% set monthly_cost = plan.get('current_cost', 0) * (1 - plan.get('savings_percentage', 0) / 100) %} {% endif %} {% endif %}
{% if monthly_cost and monthly_cost > 0 %} {{ "%.2f"|format(monthly_cost) }} € {% else %} N/A {% endif %}
{% if plan.get('is_savings', True) %} Ahorro anual:
{{ plan.get('yearly_savings', 0)|round|int }} €
{% else %} Coste adicional:
+{{ plan.get('yearly_loss', 0)|round|int }} €
{% endif %}
Permanencia: {{ plan.get('contract_duration', 12) }} meses
{% endfor %}
Comentario personalizado
Este comentario aparecerá en la propuesta junto con los planes seleccionados.
{% endblock %}