-
-
${time}
+
`;
}).join('');
@@ -374,10 +413,37 @@
const fullAddress = `${raw["Dirección"] || ""}, ${raw["Código Postal"] || ""} ${raw["Población"] || ""}`;
document.getElementById('detAddress').innerText = fullAddress;
+ // VOLCAR TODOS LOS DATOS EXTRA
+ const detailsContainer = document.getElementById('detExtraInfo');
+ let detailsHtml = '';
+
+ // Ignoramos los campos que ya están enseñados arriba por defecto
+ const skipKeys = ["Nombre Cliente", "CLIENTE", "Dirección", "DOMICILIO", "Población", "POBLACION-PROVINCIA", "scheduled_date", "scheduled_time", "status_operativo", "assigned_to", "guild_id", "Código Postal"];
+
+ for(let key in raw) {
+ if(skipKeys.includes(key)) continue;
+
+ let val = raw[key];
+ if(typeof val === 'object') val = JSON.stringify(val); // Por si es un JSON anidado
+ if(!val || val.trim() === "") continue;
+
+ detailsHtml += `
+
+ `;
+ }
+
+ if(detailsHtml === '') detailsHtml = '
No hay más datos proporcionados.
';
+ detailsContainer.innerHTML = detailsHtml;
+
+ // Mostrar modal
const modal = document.getElementById('serviceModal');
modal.classList.remove('hidden');
setTimeout(() => modal.classList.remove('translate-y-full'), 10);
+ // Iniciar GPS automático
calculateDistance(fullAddress);
}