@forelse ($notificaciones_usuario as $notificacionUsuario) @php $datosNotificacion = $notificacionUsuario->datos_notificacion; $config = $datosNotificacion ? $datosNotificacion->moduloConfig() : \App\Notificacion::configuracionVisualModulo(); $iconoImagen = $datosNotificacion ? $datosNotificacion->iconoModuloImagen() : null; $modulo = $datosNotificacion ? $datosNotificacion->moduloLabel() : 'General'; $generadoPor = $datosNotificacion ? $datosNotificacion->generadoPorNombre() : \App\Notificacion::normalizarNombreGeneradorVisual('Sistema'); // La campanita conserva el layout y muestra fecha corta sin hora. $fecha = $datosNotificacion ? $datosNotificacion->fechaVisual(false) : 'Sin fecha'; $contenidoHomologado = $datosNotificacion ? $datosNotificacion->contenidoVisualHomologado() : ['homologado' => false, 'titulo' => '', 'filas' => []]; $esInformePdfCobranza = $datosNotificacion && $datosNotificacion->esInformePdfCobranza(); $datosInformePdfCobranza = $esInformePdfCobranza && !$contenidoHomologado['homologado'] ? $datosNotificacion->datosVisualesInformePdfCobranza() : null; $esSolicitudReemplazoInformeCobranza = $datosNotificacion && $datosNotificacion->esSolicitudReemplazoInformeCobranza(); $datosSolicitudReemplazoInformeCobranza = $esSolicitudReemplazoInformeCobranza && !$contenidoHomologado['homologado'] ? $datosNotificacion->datosVisualesSolicitudReemplazoInformeCobranza() : null; $esInformeLiberadoCobranza = $datosNotificacion && $datosNotificacion->esInformeLiberadoCobranza(); $datosInformeLiberadoCobranza = $esInformeLiberadoCobranza && !$contenidoHomologado['homologado'] ? $datosNotificacion->datosVisualesInformeLiberadoCobranza() : null; $esInformePdfFacturacion = $datosNotificacion && $datosNotificacion->esInformePdfFacturacion(); $datosInformePdfFacturacion = $esInformePdfFacturacion && !$contenidoHomologado['homologado'] ? $datosNotificacion->datosVisualesInformePdfFacturacion() : null; $esBloqueNotificacionesGeneralesLineaPruebas = $datosNotificacion && $datosNotificacion->esBloqueNotificacionesGeneralesLineaPruebas(); $datosNotificacionGeneralLineaPruebas = $esBloqueNotificacionesGeneralesLineaPruebas && !$contenidoHomologado['homologado'] ? $datosNotificacion->datosVisualesNotificacionGeneralLineaPruebas() : null; $esNotificacionManualAlmacen = $datosNotificacion && $datosNotificacion->esNotificacionManualAlmacen(); $datosNotificacionManualAlmacen = $esNotificacionManualAlmacen && !$contenidoHomologado['homologado'] ? $datosNotificacion->datosVisualesNotificacionManualAlmacen() : null; $esNotificacionBancos = $datosNotificacion && $datosNotificacion->moduloNamespace() === 'bancos'; $estadoClass = $notificacionUsuario->estaVista() ? 'notification-dropdown-card--viewed' : 'notification-dropdown-card--pending'; $requiereAccion = $datosNotificacion ? (int) $datosNotificacion->requiere_accion === 1 : false; $limpiarTextoDropdown = function ($texto) { $texto = html_entity_decode(strip_tags((string) $texto), ENT_QUOTES, 'UTF-8'); $texto = preg_replace('/\s+/u', ' ', trim($texto)); return trim((string) $texto); }; $candidatosMensaje = []; $detallesDropdown = []; if ($datosNotificacion) { $detallesDropdown = $datosNotificacion->detallesAdicionales(); $candidatosMensaje = [ isset($detallesDropdown['Mensaje']) ? $limpiarTextoDropdown($detallesDropdown['Mensaje']) : '', $limpiarTextoDropdown($datosNotificacion->mensajeVisual()), $limpiarTextoDropdown($datosNotificacion->textoPrincipal()), $limpiarTextoDropdown($datosNotificacion->titulo), $datosNotificacion->datos_tipo_notificacion ? $limpiarTextoDropdown($datosNotificacion->datos_tipo_notificacion->tipo) : '', $limpiarTextoDropdown($datosNotificacion->tipoVisual()), $limpiarTextoDropdown($datosNotificacion->descripcion), ]; } $mensajesGenericos = [ 'alert', 'system', 'create', 'update', 'delete', 'restore', 'notificacion del sistema', 'notificación del sistema', ]; $mensajePrincipal = 'Notificación no disponible.'; foreach ($candidatosMensaje as $candidatoMensaje) { if ($candidatoMensaje === '') { continue; } $candidatoNormalizado = function_exists('mb_strtolower') ? mb_strtolower($candidatoMensaje, 'UTF-8') : strtolower($candidatoMensaje); if (in_array($candidatoNormalizado, $mensajesGenericos, true)) { continue; } $mensajePrincipal = $candidatoMensaje; break; } $mensajePrincipal = \Illuminate\Support\Str::limit($mensajePrincipal, 100); @endphp
  • @if ($iconoImagen) {{ $modulo }} @else @endif
    Módulo: {{ $modulo }}
    @if ($esNotificacionBancos) {{-- La campana oculta el contenido bancario sensible. --}}
    Título: {{ $datosNotificacion->tipoVisual() }}
    Esta notificación contiene información sensible del módulo Bancos.

    Para consultar el detalle y realizar las acciones correspondientes, ingrese al módulo Bancos.
    Fecha: {{ $fecha }}
    Estado: {{ $notificacionUsuario->estaVista() ? 'Visto' : 'Sin ver' }}
    @elseif ($contenidoHomologado['homologado']) {{-- La campana respeta los campos y el orden de la matriz. --}}
    Título: {{ $contenidoHomologado['titulo'] }}
    @foreach ($contenidoHomologado['filas'] as $filaHomologada)
    {{ $filaHomologada['label'] }}: @if (!empty($filaHomologada['href'])) {{ $filaHomologada['value'] }} @else {{ $filaHomologada['value'] }} @endif
    @endforeach @elseif ($esInformePdfCobranza && $datosInformePdfCobranza)
    Título: {{ $datosNotificacion->tipoVisual() }}
    No. de informe: @if ($datosInformePdfCobranza['url_pdf']) {{ $datosInformePdfCobranza['numero_informe'] }} @else {{ $datosInformePdfCobranza['numero_informe'] }} @endif
    Generado por: {{ $generadoPor }}
    Fecha y hora: {{ $datosInformePdfCobranza['fecha_hora'] }}
    @elseif ($esSolicitudReemplazoInformeCobranza && $datosSolicitudReemplazoInformeCobranza)
    Título: {{ $datosNotificacion->tipoVisual() }}
    Mensaje: {{ $datosNotificacion->mensajeVisual() }}
    No. de informe: {{ $datosSolicitudReemplazoInformeCobranza['numero_informe'] }}
    Generado por: {{ $generadoPor }}
    Fecha y hora: {{ $datosSolicitudReemplazoInformeCobranza['fecha_hora'] }}
    @elseif ($esInformeLiberadoCobranza && $datosInformeLiberadoCobranza)
    Título: {{ $datosNotificacion->tipoVisual() }}
    Mensaje: {{ $datosNotificacion->mensajeVisual() }}
    Generado por: {{ $generadoPor }}
    Fecha y hora: {{ $datosInformeLiberadoCobranza['fecha_hora'] }}
    @elseif ($esInformePdfFacturacion && $datosInformePdfFacturacion)
    Título: {{ $datosNotificacion->tipoVisual() }}
    No. de informe: @if ($datosInformePdfFacturacion['url_pdf']) {{ $datosInformePdfFacturacion['numero_informe'] }} @else {{ $datosInformePdfFacturacion['numero_informe'] }} @endif
    Generado por: {{ $generadoPor }}
    Fecha y hora: {{ $datosInformePdfFacturacion['fecha_hora'] }}
    @elseif ($esNotificacionManualAlmacen && $datosNotificacionManualAlmacen)
    Título: {{ $datosNotificacion->tipoVisual() }}
    Mensaje: {{ $datosNotificacionManualAlmacen['mensaje'] }}
    No. de informe: {{ $datosNotificacionManualAlmacen['numero_informe'] }}
    Generado por: {{ $generadoPor }}
    Fecha y hora: {{ $datosNotificacionManualAlmacen['fecha_hora'] }}
    @elseif ($esBloqueNotificacionesGeneralesLineaPruebas && $datosNotificacionGeneralLineaPruebas)
    Título: {{ $datosNotificacion->tipoVisual() }}
    @if ($datosNotificacion->esNotificacionGeneralLineaPruebas() && trim((string) $datosNotificacionGeneralLineaPruebas['mensaje']) !== '')
    Mensaje: {{ $datosNotificacionGeneralLineaPruebas['mensaje'] }}
    @endif
    No. de informe: {{ $datosNotificacionGeneralLineaPruebas['numero_informe'] }}
    Generado por: {{ $generadoPor }}
    Fecha y hora: {{ $datosNotificacionGeneralLineaPruebas['fecha_hora'] }}
    @else
    Mensaje: {{ $mensajePrincipal }}
    @foreach ($detallesDropdown as $labelDetalle => $valorDetalle) @if ($labelDetalle !== 'Mensaje' && trim((string) $valorDetalle) !== '')
    @if (strpos((string) $labelDetalle, '__texto_') === 0) {{ $valorDetalle }} @else {{ $labelDetalle }}: {{ $valorDetalle }} @endif
    @endif @endforeach
    Generado por: {{ $generadoPor }}
    Fecha: {{ $fecha }}
    @endif
  • @empty
  • No hay notificaciones pendientes.
  • @endforelse