Autosave: 20260708-194007
This commit is contained in:
parent
6c3b83d672
commit
31e763bfe7
@ -306,6 +306,15 @@ h1, .h1 {
|
|||||||
font-size: 0.85rem; /* Fuente más pequeña como en Pedidos Rotulados */
|
font-size: 0.85rem; /* Fuente más pequeña como en Pedidos Rotulados */
|
||||||
line-height: 1.2;
|
line-height: 1.2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Ruta Contraentrega: aumentar un poco el tamaño de letra para que sea más legible */
|
||||||
|
.cc-ruta-contraentrega-container th {
|
||||||
|
font-size: 0.9rem;
|
||||||
|
}
|
||||||
|
.cc-ruta-contraentrega-container td {
|
||||||
|
font-size: 0.95rem;
|
||||||
|
}
|
||||||
|
|
||||||
.excel-container tr:nth-of-type(odd) td {
|
.excel-container tr:nth-of-type(odd) td {
|
||||||
background-color: #f9f9f9;
|
background-color: #f9f9f9;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -57,6 +57,8 @@ $sql .= " ORDER BY p.created_at DESC";
|
|||||||
$stmt = $pdo->prepare($sql);
|
$stmt = $pdo->prepare($sql);
|
||||||
$stmt->execute($params);
|
$stmt->execute($params);
|
||||||
$pedidos = $stmt->fetchAll();
|
$pedidos = $stmt->fetchAll();
|
||||||
|
|
||||||
|
$label_generated_date = date('d/m');
|
||||||
?>
|
?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="es">
|
<html lang="es">
|
||||||
@ -136,6 +138,27 @@ $pedidos = $stmt->fetchAll();
|
|||||||
margin-bottom: 1mm;
|
margin-bottom: 1mm;
|
||||||
gap: 2mm;
|
gap: 2mm;
|
||||||
}
|
}
|
||||||
|
.variant-row {
|
||||||
|
align-items: flex-start;
|
||||||
|
}
|
||||||
|
.variant-text {
|
||||||
|
flex: 1;
|
||||||
|
min-width: 0;
|
||||||
|
word-break: break-word;
|
||||||
|
}
|
||||||
|
.variant-date {
|
||||||
|
white-space: nowrap;
|
||||||
|
font-size: 14pt;
|
||||||
|
font-weight: 900;
|
||||||
|
}
|
||||||
|
.nota-adicional {
|
||||||
|
font-size: 9pt;
|
||||||
|
line-height: 1.1;
|
||||||
|
margin-top: 0.5mm;
|
||||||
|
text-align: center;
|
||||||
|
word-break: break-word;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
.footer-msg {
|
.footer-msg {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 14pt;
|
font-size: 14pt;
|
||||||
@ -214,6 +237,23 @@ $pedidos = $stmt->fetchAll();
|
|||||||
}
|
}
|
||||||
|
|
||||||
$variante_text = !empty($display_variants) ? implode(' + ', $display_variants) : 'S/V';
|
$variante_text = !empty($display_variants) ? implode(' + ', $display_variants) : 'S/V';
|
||||||
|
|
||||||
|
// Nota adicional (dedicatorias/observaciones): mostrar en tamaño pequeño solo la primera palabra
|
||||||
|
$nota_adicional_raw = trim((string)($pedido['nota_adicional'] ?? ''));
|
||||||
|
if ($nota_adicional_raw === '') {
|
||||||
|
$nota_adicional_raw = trim((string)($pedido['descargo'] ?? ''));
|
||||||
|
}
|
||||||
|
$nota_adicional_raw = preg_replace('/\s+/u', ' ', $nota_adicional_raw);
|
||||||
|
if (strcasecmp($nota_adicional_raw, 'N/A') === 0) {
|
||||||
|
$nota_adicional_raw = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
// Mostrar únicamente la primera palabra para que no quede largo
|
||||||
|
$nota_adicional_display = '';
|
||||||
|
if (!empty($nota_adicional_raw)) {
|
||||||
|
$nota_adicional_parts = preg_split('/\s+/u', trim($nota_adicional_raw), -1, PREG_SPLIT_NO_EMPTY);
|
||||||
|
$nota_adicional_display = $nota_adicional_parts[0] ?? '';
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
<div class="label-page">
|
<div class="label-page">
|
||||||
<div class="header">
|
<div class="header">
|
||||||
@ -226,8 +266,9 @@ $pedidos = $stmt->fetchAll();
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="details">
|
<div class="details">
|
||||||
<div class="details-row">
|
<div class="details-row variant-row">
|
||||||
<span>VARIANTE: <?php echo htmlspecialchars($variante_text); ?></span>
|
<span class="variant-text">VARIANTE: <?php echo htmlspecialchars($variante_text); ?></span>
|
||||||
|
<span class="variant-date">F: <?php echo htmlspecialchars($label_generated_date); ?></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="details-row">
|
<div class="details-row">
|
||||||
<span><?php
|
<span><?php
|
||||||
@ -261,6 +302,12 @@ $pedidos = $stmt->fetchAll();
|
|||||||
echo 'SEDE: ' . htmlspecialchars($sede_val);
|
echo 'SEDE: ' . htmlspecialchars($sede_val);
|
||||||
?></span>
|
?></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<?php if (!empty($nota_adicional_display)): ?>
|
||||||
|
<div class="nota-adicional">
|
||||||
|
<?php echo htmlspecialchars($nota_adicional_display); ?>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="footer-msg">
|
<div class="footer-msg">
|
||||||
|
|||||||
@ -174,9 +174,9 @@ include 'layout_header.php';
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body">
|
<div class="card-body p-0">
|
||||||
|
|
||||||
<div class="table-responsive">
|
<div class="excel-container cc-pedidos-rotulados-container">
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@ -176,8 +176,8 @@ include 'layout_header.php';
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body">
|
<div class="card-body p-0">
|
||||||
<div class="table-responsive">
|
<div class="excel-container cc-pedidos-rotulados-container">
|
||||||
<table id="pedidos-table" class="table table-striped">
|
<table id="pedidos-table" class="table table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@ -172,8 +172,8 @@ include 'layout_header.php';
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body">
|
<div class="card-body p-0">
|
||||||
<div class="table-responsive">
|
<div class="excel-container cc-pedidos-rotulados-container">
|
||||||
<table id="pedidos-table" class="table table-striped">
|
<table id="pedidos-table" class="table table-striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@ -270,7 +270,7 @@ include 'layout_header.php';
|
|||||||
<?php echo $canSeeClave ? htmlspecialchars($pedido['clave'] ?? 'N/A') : '<i class="fas fa-eye-slash text-muted" title="Suba el número de operación y seleccione el banco para ver la clave"></i> <span class="text-muted" style="font-size: 0.8rem;">Oculto</span>'; ?>
|
<?php echo $canSeeClave ? htmlspecialchars($pedido['clave'] ?? 'N/A') : '<i class="fas fa-eye-slash text-muted" title="Suba el número de operación y seleccione el banco para ver la clave"></i> <span class="text-muted" style="font-size: 0.8rem;">Oculto</span>'; ?>
|
||||||
</td>
|
</td>
|
||||||
<td><span class="badge" style="<?php echo getStatusStyle($pedido['estado']); ?>"><?php echo ($pedido['estado'] == 'Gestion') ? 'GESTIONES ⚙️' : htmlspecialchars($pedido['estado']); ?></span></td>
|
<td><span class="badge" style="<?php echo getStatusStyle($pedido['estado']); ?>"><?php echo ($pedido['estado'] == 'Gestion') ? 'GESTIONES ⚙️' : htmlspecialchars($pedido['estado']); ?></span></td>
|
||||||
<td id="live-status-<?php echo $pedido['id']; ?>"><span class="badge bg-light text-dark">Pendiente</span></td>
|
<td id="live-status-<?php echo $pedido['id']; ?>"><span class="badge bg-warning text-dark">VERIFICAR</span></td>
|
||||||
<?php if ($user_role !== 'Asesor'): ?><td><?php echo htmlspecialchars($pedido['asesor_nombre'] ?? 'N/A'); ?></td><?php endif; ?>
|
<?php if ($user_role !== 'Asesor'): ?><td><?php echo htmlspecialchars($pedido['asesor_nombre'] ?? 'N/A'); ?></td><?php endif; ?>
|
||||||
<td><?php echo htmlspecialchars($pedido['created_at']); ?></td>
|
<td><?php echo htmlspecialchars($pedido['created_at']); ?></td>
|
||||||
<td>
|
<td>
|
||||||
@ -324,6 +324,9 @@ $(document).ready(function() {
|
|||||||
document.addEventListener('DOMContentLoaded', function() {
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
const table = document.querySelector('.table');
|
const table = document.querySelector('.table');
|
||||||
|
|
||||||
|
// Shalom API temporalmente desactivada: por ahora solo mostramos “VERIFICAR”
|
||||||
|
const SHALOM_API_ENABLED = false;
|
||||||
|
|
||||||
// Logic for editable cells (existing logic)
|
// Logic for editable cells (existing logic)
|
||||||
table.addEventListener('click', function(e) {
|
table.addEventListener('click', function(e) {
|
||||||
if (e.target && e.target.classList.contains('editable')) {
|
if (e.target && e.target.classList.contains('editable')) {
|
||||||
@ -347,6 +350,11 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||||||
modalOrderCodeSpan.textContent = orderCode;
|
modalOrderCodeSpan.textContent = orderCode;
|
||||||
modalStatusDiv.innerHTML = '<p class="text-center">Consultando estado en Shalom...</p>';
|
modalStatusDiv.innerHTML = '<p class="text-center">Consultando estado en Shalom...</p>';
|
||||||
|
|
||||||
|
if (!SHALOM_API_ENABLED) {
|
||||||
|
modalStatusDiv.innerHTML = '<p class="text-warning text-center"><strong>VERIFICAR</strong>: Estado Shalom requiere confirmación manual por el momento.</p>';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (orderNumber === 'N/A' || orderCode === 'N/A' || !orderNumber || !orderCode) {
|
if (orderNumber === 'N/A' || orderCode === 'N/A' || !orderNumber || !orderCode) {
|
||||||
modalStatusDiv.innerHTML = '<p class="text-danger text-center">No hay suficientes datos (Nº de Orden o Código de Orden) para consultar.</p>';
|
modalStatusDiv.innerHTML = '<p class="text-danger text-center">No hay suficientes datos (Nº de Orden o Código de Orden) para consultar.</p>';
|
||||||
return;
|
return;
|
||||||
@ -524,6 +532,22 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||||||
function verificarEstados() {
|
function verificarEstados() {
|
||||||
const rows = document.querySelectorAll('tr[data-order-number][data-order-code]');
|
const rows = document.querySelectorAll('tr[data-order-number][data-order-code]');
|
||||||
const verifyButton = document.getElementById('verify-statuses-btn');
|
const verifyButton = document.getElementById('verify-statuses-btn');
|
||||||
|
|
||||||
|
if (!SHALOM_API_ENABLED) {
|
||||||
|
rows.forEach((row) => {
|
||||||
|
const pedidoId = row.id.split('-')[1];
|
||||||
|
const statusCell = document.getElementById(`live-status-${pedidoId}`);
|
||||||
|
if (!statusCell) return;
|
||||||
|
statusCell.innerHTML = '<span class="badge bg-warning text-dark">VERIFICAR</span>';
|
||||||
|
});
|
||||||
|
|
||||||
|
if (verifyButton) {
|
||||||
|
verifyButton.disabled = false;
|
||||||
|
verifyButton.innerHTML = 'Verificar Estados Ahora';
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if(verifyButton) {
|
if(verifyButton) {
|
||||||
verifyButton.disabled = true;
|
verifyButton.disabled = true;
|
||||||
verifyButton.innerHTML = '<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span> Verificando...';
|
verifyButton.innerHTML = '<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span> Verificando...';
|
||||||
|
|||||||
@ -355,7 +355,7 @@ include 'layout_header.php';
|
|||||||
|
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body p-0">
|
<div class="card-body p-0">
|
||||||
<div class="excel-container">
|
<div class="excel-container cc-ruta-contraentrega-container">
|
||||||
<table id="pedidos-table" class="table table-striped table-hover">
|
<table id="pedidos-table" class="table table-striped table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@ -405,6 +405,7 @@ include 'layout_header.php';
|
|||||||
data-bs-toggle="modal" data-bs-target="#contraentregaVerificacionModal"
|
data-bs-toggle="modal" data-bs-target="#contraentregaVerificacionModal"
|
||||||
data-pedido-id="<?php echo htmlspecialchars((string)$pedido['id'], ENT_QUOTES, 'UTF-8'); ?>"
|
data-pedido-id="<?php echo htmlspecialchars((string)$pedido['id'], ENT_QUOTES, 'UTF-8'); ?>"
|
||||||
data-nombre-completo="<?php echo htmlspecialchars((string)($pedido['nombre_completo'] ?? ''), ENT_QUOTES, 'UTF-8'); ?>"
|
data-nombre-completo="<?php echo htmlspecialchars((string)($pedido['nombre_completo'] ?? ''), ENT_QUOTES, 'UTF-8'); ?>"
|
||||||
|
data-celular="<?php echo htmlspecialchars((string)($pedido['celular'] ?? ''), ENT_QUOTES, 'UTF-8'); ?>"
|
||||||
data-verificacion-tracking="<?php echo htmlspecialchars($ccVerifTracking, ENT_QUOTES, 'UTF-8'); ?>"
|
data-verificacion-tracking="<?php echo htmlspecialchars($ccVerifTracking, ENT_QUOTES, 'UTF-8'); ?>"
|
||||||
data-verificacion-imagen="<?php echo htmlspecialchars($ccVerifImg, ENT_QUOTES, 'UTF-8'); ?>"
|
data-verificacion-imagen="<?php echo htmlspecialchars($ccVerifImg, ENT_QUOTES, 'UTF-8'); ?>"
|
||||||
data-seguimiento="<?php echo htmlspecialchars($ccSeguimiento, ENT_QUOTES, 'UTF-8'); ?>"
|
data-seguimiento="<?php echo htmlspecialchars($ccSeguimiento, ENT_QUOTES, 'UTF-8'); ?>"
|
||||||
@ -537,12 +538,16 @@ include 'layout_header.php';
|
|||||||
<div class="col-md-7">
|
<div class="col-md-7">
|
||||||
<div class="mb-2">
|
<div class="mb-2">
|
||||||
<div class="text-muted small">Pedido #<span id="ccVerifPedidoIdText"></span></div>
|
<div class="text-muted small">Pedido #<span id="ccVerifPedidoIdText"></span></div>
|
||||||
<div class="fw-semibold" id="ccVerifNombreDestinatario"></div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<img id="ccVerifPreviewImg" class="cc-verificacion-img-preview" src="" alt="Imagen de verificación" style="display:none;">
|
<img id="ccVerifPreviewImg" class="cc-verificacion-img-preview" src="" alt="Imagen de verificación" style="display:none;">
|
||||||
<div id="ccVerifNoImg" class="text-muted" style="display:none;">Sin imagen cargada todavía.</div>
|
<div id="ccVerifNoImg" class="text-muted" style="display:none;">Sin imagen cargada todavía.</div>
|
||||||
|
|
||||||
|
<div class="mt-2">
|
||||||
|
<div class="fw-semibold fs-3" id="ccVerifNombreDestinatario"></div>
|
||||||
|
<div class="text-muted fs-3" id="ccVerifNumeroDestinatario"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="alert alert-info mb-0" role="alert" style="padding: 0.6rem 0.85rem;">
|
<div class="alert alert-info mb-0" role="alert" style="padding: 0.6rem 0.85rem;">
|
||||||
@ -610,6 +615,7 @@ include 'layout_header.php';
|
|||||||
const pedidoIdText = document.getElementById('ccVerifPedidoIdText');
|
const pedidoIdText = document.getElementById('ccVerifPedidoIdText');
|
||||||
const pedidoIdHidden = document.getElementById('ccVerifPedidoIdHidden');
|
const pedidoIdHidden = document.getElementById('ccVerifPedidoIdHidden');
|
||||||
const nombreEl = document.getElementById('ccVerifNombreDestinatario');
|
const nombreEl = document.getElementById('ccVerifNombreDestinatario');
|
||||||
|
const numeroEl = document.getElementById('ccVerifNumeroDestinatario');
|
||||||
|
|
||||||
const previewImg = document.getElementById('ccVerifPreviewImg');
|
const previewImg = document.getElementById('ccVerifPreviewImg');
|
||||||
const noImgEl = document.getElementById('ccVerifNoImg');
|
const noImgEl = document.getElementById('ccVerifNoImg');
|
||||||
@ -658,6 +664,7 @@ include 'layout_header.php';
|
|||||||
|
|
||||||
const pedidoId = btn.getAttribute('data-pedido-id') || '';
|
const pedidoId = btn.getAttribute('data-pedido-id') || '';
|
||||||
const nombre = btn.getAttribute('data-nombre-completo') || '';
|
const nombre = btn.getAttribute('data-nombre-completo') || '';
|
||||||
|
const celular = btn.getAttribute('data-celular') || '';
|
||||||
const verifTracking = btn.getAttribute('data-verificacion-tracking') || '';
|
const verifTracking = btn.getAttribute('data-verificacion-tracking') || '';
|
||||||
const verifImg = btn.getAttribute('data-verificacion-imagen') || '';
|
const verifImg = btn.getAttribute('data-verificacion-imagen') || '';
|
||||||
const seguimiento = btn.getAttribute('data-seguimiento') || '';
|
const seguimiento = btn.getAttribute('data-seguimiento') || '';
|
||||||
@ -665,6 +672,7 @@ include 'layout_header.php';
|
|||||||
pedidoIdHidden.value = pedidoId;
|
pedidoIdHidden.value = pedidoId;
|
||||||
if (pedidoIdText) pedidoIdText.textContent = pedidoId;
|
if (pedidoIdText) pedidoIdText.textContent = pedidoId;
|
||||||
if (nombreEl) nombreEl.textContent = nombre;
|
if (nombreEl) nombreEl.textContent = nombre;
|
||||||
|
if (numeroEl) numeroEl.textContent = celular || 'N/A';
|
||||||
|
|
||||||
trackingSavedEl.textContent = verifTracking || 'N/A';
|
trackingSavedEl.textContent = verifTracking || 'N/A';
|
||||||
seguimientoActualEl.textContent = seguimiento || 'N/A';
|
seguimientoActualEl.textContent = seguimiento || 'N/A';
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user