@php
$filtroPertenenciaReq = $filtroPertenenciaReq ?? '';
$filtroPertenencias = $filtroPertenencias ?? [];
$bHabilitadoCampoSujetoPasivo = $bHabilitadoCampoSujetoPasivo ?? false;
$bOcultarCamposSujetoPasivo = $bOcultarCamposSujetoPasivo ?? false;
$instituciones = $instituciones ?? null;
$nIdHtmlSelectInstitucion = $nIdHtmlSelectInstitucion ?? '';
$sUrlFuenteDatos = $sUrlFuenteDatos ?? '';
$opcionesSelectSujetoPasivoNuevoFormato = $opcionesSelectSujetoPasivoNuevoFormato ?? [];
$opcionesSelectSujetoPasivo = $opcionesSelectSujetoPasivo ?? [];
$nIdInstitucionUsuarioActual = $nIdInstitucionUsuarioActual ?? '';
$sujetoPasivoRutReq = $sujetoPasivoRutReq ?? '';
$sFiltroRutSujetoActivo = $sFiltroRutSujetoActivo ?? '';
$texto_libre = $textoLibreReq ?? '';
$estado = $estado ?? '';
$estados = $estados ?? [];
$fechaDesdeReq = $fechaDesdeReq ?? '';
$fechaHastaReq = $fechaHastaReq ?? '';
$donativos = $donativos ?? null;
@endphp
Registro de donativos oficiales y protocolares recibidos
@if(Auth::user()->hasPermiso('Donativo','c') && !Auth::user()->root)
@endif
{!! html()->form('GET', url('admin/donativos'))
->class('form-horizontal')
->name('form-admin-donativos')
->open() !!}
@php
$nIdHtmlSelectInstitucion = 'filtroInstitucionReq';
$sUrlFuenteDatos = 'cargos-pasivos/lista-sujetos';
@endphp
@if(count($filtroPertenencias) > 0)
@php
$nIdHtmlSelectInstitucion = 'filtroPertenenciaReq';
$sUrlFuenteDatos = 'cargos-pasivos/lista-sujetos-sin-dependencia';
@endphp
{!! html()->select($nIdHtmlSelectInstitucion,
[null => 'Ingrese el nombre o apellido del sujeto pasivo'] + $filtroPertenencias,
isset($filtroPertenencias) ? $filtroPertenencias : '')
->class('form-select')
->id($nIdHtmlSelectInstitucion) !!}
@endif
@php
if(!$bHabilitadoCampoSujetoPasivo ??= true) {
$bHabilitadoCampoSujetoPasivo = true;
}
$bOcultarCamposSujetoPasivo = false;
if(
Auth::user()->selectedPertenencia()->cargo_pasivo ?? false &&
Auth::user()->selectedPertenencia()->cargo_pasivo == 1
) {
$bHabilitadoCampoSujetoPasivo = false;
$bOcultarCamposSujetoPasivo = true;
}
@endphp
@if(\Auth::user()->root && $instituciones !== null)
@php
$nIdHtmlSelectInstitucion = 'filtroInstitucionReq';
$sUrlFuenteDatos = 'cargos-pasivos/lista-sujetos';
@endphp
{!! html()->select($nIdHtmlSelectInstitucion,
[null => 'Ingrese el nombre de la institución'] + $instituciones->all(),
$filtroInstitucionReq ?? '')
->class('form-control')
->id('institucion')
->attribute('onchange', 'filtroInstitucionChange(this, "sujeto_pasivo", "sujeto_pasivo_rut")') !!}
@php
$bHabilitadoCampoSujetoPasivo = false;
if(!empty($filtroInstitucionReq ?? '')) {
$bHabilitadoCampoSujetoPasivo = true;
}
@endphp
@endif
@if(!$bOcultarCamposSujetoPasivo)
@endif
{!! html()->form()->close() !!}
@if(!is_null($donativos))
| {!! Helpers::headColumn('fecha', 'Fecha') !!} |
Sujeto pasivo |
{!! Helpers::headColumn('descripcion', 'Singularización') !!} |
Donante |
{!! Helpers::headColumn('estado', 'Estado') !!} |
Acciones |
@php
$pertenenciaSeleccionada = Auth::user()->selectedPertenencia();
$esAdminInstitucional = $pertenenciaSeleccionada && (Helpers::getHumanRol($pertenenciaSeleccionada->cargo_pasivo, $pertenenciaSeleccionada->jefe, ucwords($pertenenciaSeleccionada->rol)) == 'Administrador Institucional');
@endphp
@foreach($donativos as $item)
| {{ $item->fecha }} |
{{ trim(($item->pertenencia?->usuario?->nombres ?? '').' '.($item->pertenencia?->usuario?->apellidos ?? '')) }} |
{{ $item->descripcion }} |
{{ join(', ', $item->representados()->pluck('nombre')->all()) }} |
{{ ucwords($item->estado) }} |
@if(Auth::user()->hasPermiso('Donativo','u'))
Editar
@endif
@if(Auth::user()->hasPermiso('Donativo','d') && !$esAdminInstitucional)
Eliminar
@endif
|
@endforeach
@if(count($donativos) == 0)
| Sin datos |
@endif
{{ $donativos->appends( \Request::query() )->links() }}
@endif