<%- include('../partials/header') %> <% title = 'Mis Herramientas'; %> <% if (success_msg && success_msg.length > 0) { %> <% success_msg.forEach(msg => { %> <% }) %> <% } %> <% if (error_msg && error_msg.length > 0) { %> <% error_msg.forEach(msg => { %> <% }) %> <% } %>
Equipamiento Activo en Custodia (<%= activas.length %>)
<% if (activas.length === 0) { %>
No tienes herramientas asignadas en este momento

Tu supervisor o administrador te asignará los kits de dotación fija o los kits específicos al programar visitas de terreno.

<% } %> <% activas.forEach(a => { %>
<% if (a.set_foto_url || a.herramienta_foto_url) { %> <% } %>
<%= a.tipo_asignacion === 'dotacion_fija' ? 'Dotación Fija' : 'Visita FSM' %> En Custodia
<%= a.set_nombre || a.herramienta_nombre || 'Equipamiento Técnico' %>
<% if (a.set_codigo || a.herramienta_codigo) { %> <%= a.set_codigo || a.herramienta_codigo %> <% } %>
Asignado el: <%= new Date(a.fecha_asignacion).toLocaleDateString('es-EC') %>
<% if (a.asignado_por_nombre) { %>
Asignado por: <%= a.asignado_por_nombre %>
<% } %> <% if (a.ticket_id) { %>
Para Ticket: #<%= a.ticket_id %>
<% } %>
<% if (a.qr_token) { %> Manifiesto Digital QR <% } %> <% if (a.foto_entrega_url) { %> Foto Entrega <% } %>
<% if (a.observaciones_entrega) { %>
<%= a.observaciones_entrega %>
<% } %>
Reportar novedad a bodega ID #<%= a.id %>
<% }) %>
Historial de Devoluciones (<%= historial.length %>)
<% if (historial.length > 0) { %>
<% historial.forEach(h => { %> <% }) %>
Kit / Herramienta Tipo Fecha Entrega Fecha Devolución Observaciones Evidencias Estado
<%= h.set_nombre || h.herramienta_nombre %> <%= h.tipo_asignacion === 'dotacion_fija' ? 'Dotación Fija' : 'Visita FSM' %> <%= new Date(h.fecha_asignacion).toLocaleDateString('es-EC') %> <%= h.fecha_devolucion ? new Date(h.fecha_devolucion).toLocaleDateString('es-EC') : '-' %> <%= h.observaciones_devolucion || h.observaciones_entrega || '-' %>
<% if (h.foto_entrega_url) { %> Entrega <% } %> <% if (h.foto_devolucion_url) { %> Devolución <% } %>
<%= h.estado %>
<% } %>
<%- include('../partials/footer') %>