diff --git a/backend/src/plantilla_autorizacion_brigadas_ambulancias_hospitalarios.js b/backend/src/plantilla_autorizacion_brigadas_ambulancias_hospitalarios.js index 31ed0e4..f95d596 100644 --- a/backend/src/plantilla_autorizacion_brigadas_ambulancias_hospitalarios.js +++ b/backend/src/plantilla_autorizacion_brigadas_ambulancias_hospitalarios.js @@ -1865,47 +1865,52 @@ async function crearLibroAutorizacionBrigadasAmbulanciasHospitalarios(a) { sheet.getCell('G30').fill = {"type":"pattern","pattern":"none"}; sheet.getCell('G30').border = {"right":{"style":"medium","color":{"argb":"FF000000"}},"bottom":{"style":"medium","color":{"argb":"FF000000"}}}; sheet.getCell('G30').alignment = {"horizontal":"center","vertical":"middle"}; - sheet.getCell('H30').value = "AUTORIZACIÓN VALIDA 90 DÍAS"; + const tipoServicio = String(a.tipo_servicio || '').toLowerCase(); + const esHospitalario = tipoServicio === 'hospitalarios'; + const leyendaAutorizacion = esHospitalario + ? 'AUTORIZACION' + : 'AUTORIZACION VALIDA 90 DIAS'; + sheet.getCell('H30').value = leyendaAutorizacion; sheet.getCell('H30').fill = {"type":"pattern","pattern":"none"}; sheet.getCell('H30').border = {"left":{"style":"medium","color":{"argb":"FF000000"}},"bottom":{"style":"medium","color":{"argb":"FF000000"}}}; sheet.getCell('H30').alignment = {"horizontal":"center","vertical":"middle"}; - sheet.getCell('I30').value = "AUTORIZACIÓN VALIDA 90 DÍAS"; + sheet.getCell('I30').value = leyendaAutorizacion; sheet.getCell('I30').fill = {"type":"pattern","pattern":"none"}; sheet.getCell('I30').border = {"bottom":{"style":"medium","color":{"argb":"FF000000"}}}; sheet.getCell('I30').alignment = {"horizontal":"center","vertical":"middle"}; - sheet.getCell('J30').value = "AUTORIZACIÓN VALIDA 90 DÍAS"; + sheet.getCell('J30').value = leyendaAutorizacion; sheet.getCell('J30').fill = {"type":"pattern","pattern":"none"}; sheet.getCell('J30').border = {"bottom":{"style":"medium","color":{"argb":"FF000000"}}}; sheet.getCell('J30').alignment = {"horizontal":"center","vertical":"middle"}; - sheet.getCell('K30').value = "AUTORIZACIÓN VALIDA 90 DÍAS"; + sheet.getCell('K30').value = leyendaAutorizacion; sheet.getCell('K30').fill = {"type":"pattern","pattern":"none"}; sheet.getCell('K30').border = {"bottom":{"style":"medium","color":{"argb":"FF000000"}}}; sheet.getCell('K30').alignment = {"horizontal":"center","vertical":"middle"}; - sheet.getCell('L30').value = "AUTORIZACIÓN VALIDA 90 DÍAS"; + sheet.getCell('L30').value = leyendaAutorizacion; sheet.getCell('L30').fill = {"type":"pattern","pattern":"none"}; sheet.getCell('L30').border = {"bottom":{"style":"medium","color":{"argb":"FF000000"}}}; sheet.getCell('L30').alignment = {"horizontal":"center","vertical":"middle"}; - sheet.getCell('M30').value = "AUTORIZACIÓN VALIDA 90 DÍAS"; + sheet.getCell('M30').value = leyendaAutorizacion; sheet.getCell('M30').fill = {"type":"pattern","pattern":"none"}; sheet.getCell('M30').border = {"bottom":{"style":"medium","color":{"argb":"FF000000"}}}; sheet.getCell('M30').alignment = {"horizontal":"center","vertical":"middle"}; - sheet.getCell('N30').value = "AUTORIZACIÓN VALIDA 90 DÍAS"; + sheet.getCell('N30').value = leyendaAutorizacion; sheet.getCell('N30').fill = {"type":"pattern","pattern":"none"}; sheet.getCell('N30').border = {"bottom":{"style":"medium","color":{"argb":"FF000000"}}}; sheet.getCell('N30').alignment = {"horizontal":"center","vertical":"middle"}; - sheet.getCell('O30').value = "AUTORIZACIÓN VALIDA 90 DÍAS"; + sheet.getCell('O30').value = leyendaAutorizacion; sheet.getCell('O30').fill = {"type":"pattern","pattern":"none"}; sheet.getCell('O30').border = {"bottom":{"style":"medium","color":{"argb":"FF000000"}}}; sheet.getCell('O30').alignment = {"horizontal":"center","vertical":"middle"}; - sheet.getCell('P30').value = "AUTORIZACIÓN VALIDA 90 DÍAS"; + sheet.getCell('P30').value = leyendaAutorizacion; sheet.getCell('P30').fill = {"type":"pattern","pattern":"none"}; sheet.getCell('P30').border = {"bottom":{"style":"medium","color":{"argb":"FF000000"}}}; sheet.getCell('P30').alignment = {"horizontal":"center","vertical":"middle"}; - sheet.getCell('Q30').value = "AUTORIZACIÓN VALIDA 90 DÍAS"; + sheet.getCell('Q30').value = leyendaAutorizacion; sheet.getCell('Q30').fill = {"type":"pattern","pattern":"none"}; sheet.getCell('Q30').border = {"bottom":{"style":"medium","color":{"argb":"FF000000"}}}; sheet.getCell('Q30').alignment = {"horizontal":"center","vertical":"middle"}; - sheet.getCell('R30').value = "AUTORIZACIÓN VALIDA 90 DÍAS"; + sheet.getCell('R30').value = leyendaAutorizacion; sheet.getCell('R30').fill = {"type":"pattern","pattern":"none"}; sheet.getCell('R30').border = {"right":{"style":"double"},"bottom":{"style":"medium","color":{"argb":"FF000000"}}}; sheet.getCell('R30').alignment = {"horizontal":"center","vertical":"middle"}; @@ -2496,8 +2501,6 @@ async function crearLibroAutorizacionBrigadasAmbulanciasHospitalarios(a) { if (cupDescripcion) cupInfoParts.push(cupDescripcion); if (nivelTexto) cupInfoParts.push(nivelTexto); const cupInfo = cupInfoParts.join(' - '); - const tipoServicio = String(a.tipo_servicio || '').toLowerCase(); - const esHospitalario = tipoServicio === 'hospitalarios'; const limpiarObservacion = (value) => { const partes = String(value || '') .split('|')