diff --git a/modules/turnero/api/get_historial.php b/modules/turnero/api/get_historial.php index 8e08e90..c122447 100644 --- a/modules/turnero/api/get_historial.php +++ b/modules/turnero/api/get_historial.php @@ -183,13 +183,15 @@ if ($turnoIds) { "SELECT tc.turno_id, tc.usuario_nombre, tc.comentario, tc.tipo, tc.creado_at FROM turnero_comentarios tc WHERE tc.turno_id IN ($ph) - ORDER BY tc.turno_id, tc.creado_at DESC" + ORDER BY tc.turno_id, tc.creado_at ASC" ); $stmtCom->execute($turnoIds); foreach ($stmtCom->fetchAll(PDO::FETCH_ASSOC) as $row) { $tid = (int)$row['turno_id']; if (!isset($comentarios[$tid])) $comentarios[$tid] = []; - if (count($comentarios[$tid]) < 3) { + // Se traen todos: cortar en 3 escondía notas —entre ellas el motivo de + // una ausencia— sin que nada indicara que faltaban. + if (count($comentarios[$tid]) < 20) { unset($row['turno_id']); $comentarios[$tid][] = $row; } diff --git a/modules/turnero/views/dashboard.php b/modules/turnero/views/dashboard.php index fe0785e..2e15bb5 100644 --- a/modules/turnero/views/dashboard.php +++ b/modules/turnero/views/dashboard.php @@ -83,6 +83,13 @@ Layout::open('Dashboard Turnero', 'fas fa-chart-bar'); .det-row td { padding:0 !important; border-top:none !important; } .det-inner { padding:12px 16px 14px; border-top:2px solid color-mix(in srgb, var(--brand,#1565c0) 20%, #e2e8f0); background:#f8fafc; } + /* ── Origen de cada nota ── */ + .com-tipo { font-size:.62rem; font-weight:700; letter-spacing:.04em; padding:1px 7px; + border-radius:10px; text-transform:uppercase; margin-right:6px; } + .com-tipo.recepcion { background:#dbeafe; color:#1d4ed8; } + .com-tipo.muestras { background:#dcfce7; color:#15803d; } + .com-tipo.general { background:#fef3c7; color:#92400e; } + /* ── Sesión badge ── */ .sesion-open { background:#dcfce7; color:#15803d; } .sesion-closed { background:#f1f5f9; color:#64748b; } @@ -657,8 +664,9 @@ function renderDashDetalle(t) { // Comentarios if (t.comentarios && t.comentarios.length) { grid += `