Actualizar index2.html
This commit is contained in:
12
index2.html
12
index2.html
@@ -403,10 +403,13 @@
|
||||
let countPend = 0;
|
||||
|
||||
allServices.forEach(srv => {
|
||||
let isFinalized = srv.is_final === true;
|
||||
let raw = srv.raw_data || {};
|
||||
let descLimpia = summarizeDescription(srv.description);
|
||||
let stNameLower = (srv.status_name || "").toLowerCase();
|
||||
|
||||
// 🛑 FIX: Ampliamos el radar para cazar todos los archivados y anulados
|
||||
let isFinalized = srv.is_final === true || srv.status === 'archived' || stNameLower.includes('finalizado') || stNameLower.includes('anulado');
|
||||
|
||||
let descLimpia = summarizeDescription(srv.description);
|
||||
let hasDate = (srv.scheduled_date && srv.scheduled_time);
|
||||
let hasWorker = (srv.assigned_worker && srv.assigned_worker !== 'Pendiente' && srv.assigned_worker !== 'Sin asignar');
|
||||
let isUrgent = (srv.title && srv.title.includes('URGENTE')) || srv.is_urgent === true || (raw['Urgente'] && (raw['Urgente'].toLowerCase() === 'sí' || raw['Urgente'].toLowerCase() === 'si' || raw['Urgente'].toLowerCase() === 'true'));
|
||||
@@ -541,6 +544,11 @@
|
||||
document.getElementById('countIncidencias').innerText = countInc;
|
||||
document.getElementById('countPendientes').innerText = countPend;
|
||||
|
||||
// 🛑 FIX: Le pasamos el dato real al botón del acordeón
|
||||
if (document.getElementById('labelHistoryCount')) {
|
||||
document.getElementById('labelHistoryCount').innerText = `${countHist} servicios finalizados`;
|
||||
}
|
||||
|
||||
if (countAct === 0) document.getElementById('noActiveServices').classList.remove('hidden');
|
||||
else document.getElementById('noActiveServices').classList.add('hidden');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user