{% extends 'base.html' %} {% block title %}{{ order.order_number }}{% endblock %} {% block page_title %}{{ order.order_number }}{% endblock %} {% block topbar_actions %}
{% if order.status != 'completed' %} ✏️ Editar {% else %} {% endif %} 📄 ES 📄 EN ← Volver
{% endblock %} {% block content %}
{% if order.status != 'completed' %} ✏️Editar {% else %} {% endif %} 📄PDF Volver
📋 Detalles
{% if order.assigned_to %} {% endif %}
Embarcación{{ order.vessel_name }}
Sistema{{ order.system_name or '—' }}
Scope{{ order.scope or '—' }}
Tipo{{ order.work_type or '—' }}
Facturación {% if order.billing_type == 'lump_sum' %} 💰 A todo costo {% elif order.billing_type == 'labor_only' %} 🔧 Solo M.O. {% else %} 📋 M.O. + Materiales {% endif %}
Técnico{{ order.technician or '—' }}
Asignado a 📨 {{ order.assigned_to }} {% if order.assigned_by %}
por {{ order.assigned_by }}{% endif %}
Fecha inicio{{ order.start_date or '—' }}
Fecha fin{{ order.end_date or '—' }}
H. Motor inicio{{ order.engine_hours_start or '—' }}
Estado{{ order.status.replace('_',' ') }}
Descripción
{{ order.description }}
💰 Costos
Horas Trabajadas{{ order.labor_hours or 0 }} h
Tarifa M.O.${{ order.labor_rate or 0 }}/h
Costo M.O.${{ "%.2f"|format(order.total_labor_cost or 0) }}
Costo Repuestos${{ "%.2f"|format(order.total_parts_cost or 0) }}
TOTAL${{ "%.2f"|format((order.total_labor_cost or 0) + (order.total_parts_cost or 0)) }}
⚙️ Equipos Trabajados {% if order.status != 'completed' %} {% endif %}
{% if wo_equipment %}
{% if order.status != 'completed' %}{% endif %} {% for e in wo_equipment %} {% if order.status != 'completed' %} {% endif %} {% endfor %} {% if order.status != 'completed' %}{% endif %}
EquipoS/NTrabajo RealizadoNotasHorasCosto M.O.
{{ e.equip_name or '—' }}
{{ e.make or '' }} {{ e.model or '' }}
{{ e.serial_number or '—' }} {{ e.description or '—' }} {{ e.notes or '—' }} {{ e.labor_hours or 0 }} h ${{ "%.2f"|format((e.labor_hours or 0) * (e.labor_rate or 0)) }}
TOTAL MANO DE OBRA {{ wo_equipment|sum(attribute='labor_hours') or 0 }} h ${{ "%.2f"|format(wo_equipment|sum(attribute='labor_cost') or 0) }}
{% else %}

Sin equipos agregados.

{% endif %}
⚠️ Causa Técnica y Reparaciones
📸 Evidencia Fotográfica {% if order.status != 'cancelled' %} {% endif %}
{% set before_photos = photos|selectattr('photo_type','eq','before')|list %} {% set after_photos = photos|selectattr('photo_type','eq','after')|list %} {% if before_photos %}
⬅ Antes
{% for p in before_photos %}
Antes
{% endfor %}
{% endif %} {% if after_photos %}
➡ Después
{% for p in after_photos %}
Después
{% endfor %}
{% endif %} {% if not photos %}

Sin fotos aún. Agrega evidencia fotográfica del trabajo.

{% endif %}
🔩 Repuestos Utilizados {% if order.status != 'cancelled' %} {% endif %}
{% if parts_used %}
{% for p in parts_used %} {% endfor %}
RepuestoDescripciónCantidadPrecio Unit.Total
{{ p.part_name or '—' }}{% if p.part_number %} ({{ p.part_number }}){% endif %} {{ p.description or '' }} {{ p.quantity }} ${{ "%.2f"|format(p.unit_cost) }} ${{ "%.2f"|format(p.total_cost) }}
{% else %}

Sin repuestos registrados.

{% endif %}
{% if email_log %}
📧 Historial de Envíos
{% for e in email_log %} {% endfor %}
FechaDestinatarioIdiomaEstadoEnviado porPDF
{{ e.sent_at[:16] }}
{{ e.to_name or '—' }}
{{ e.to_email }}
{{ e.lang.upper() }} {% if e.status == 'sent' %} ✅ Enviado {% else %} ❌ Fallido {% if e.error_msg %}
{{ e.error_msg[:80] }}{% if e.error_msg|length > 80 %}...{% endif %}
{% endif %} {% endif %}
{{ e.sent_by or '—' }} {% if e.pdf_filename %} 📄 {% else %}—{% endif %}
{% endif %}
✍️ Firmas
Técnico: {{ order.technician or '—' }}
{% if order.signature_tech %} {% else %}
{% endif %}
Capitán / Cliente
{% if order.signature_client %} {% else %}
{% endif %}
{% endblock %} {% block scripts %} {% endblock %}