@extends('../layouts/partials/header') @section('content')

@if (session('success')) @endif @if ($errors->any()) @endif
@csrf @method('PUT')
{{-- ===== TAB 1: DATOS DEL TITULAR ===== --}}
{{ $tramite->id }}
@error('nombre')
{{ $message }}
@enderror
{{-- ===== TAB 2: TRÁMITE ===== --}}
{{ $tramite->id }} - {{ $tramite->nombre }}
@error('institucion')
{{ $message }}
@enderror
{{--
--}}
$

{{--
--}}
{{-- ===== TAB 3: ADICIONAL ===== --}}
{{ $tramite->id }} - {{ $tramite->nombre }}
{{-- TAB 4: placeholder vacío — el contenido real de pagos está fuera del form --}}
{{-- TAB 5: placeholder vacío — el contenido real de bóveda está fuera del form --}}
{{-- /tab-content --}}
Ver Cancelar
{{-- ===== PANEL DE PAGOS (fuera del form principal para evitar form anidado) ===== --}}
{{-- Formulario para nuevo pago --}}
{{ $tramite->id }} - {{ $tramite->nombre }}
Registrar pago
@csrf
$
{{-- Tabla de pagos registrados --}} @php $totalPagado = $pagos->sum('monto'); $costo = $tramite->costo ?? 0; $saldo = $costo - $totalPagado; @endphp
Historial de pagos {{ $pagos->count() }}
@if($pagos->isEmpty())

No hay pagos registrados aún.

@else
@foreach($pagos as $pago) @endforeach @if($costo > 0) @endif
# Fecha Monto Método Recibido Por Capturado Por Capturado Acción
{{ $pago->id }} {{ $pago->fecha->format('d/m/Y') }} ${{ number_format($pago->monto, 2) }} {{ $pago->metodo_pago ?? '—' }} {{ $pago->recibido_por ?? '—' }} {{ $pago->capturadoPor?->name ?? '—' }} {{ $pago->created_at->format('d/m/Y H:i') }}
@csrf @method('DELETE')
Total pagado: ${{ number_format($totalPagado, 2) }}
Costo: ${{ number_format($costo, 2) }}
Saldo pendiente: ${{ number_format(max($saldo, 0), 2) }} @if($saldo <= 0) Saldado @endif
@endif
{{-- /panelPagos --}} {{-- ===== PANEL BÓVEDA DE DOCUMENTOS (fuera del form principal) ===== --}}
{{ $tramite->id }} - {{ $tramite->nombre }}
Cargar nuevo documento
@csrf
@error('documento')
{{ $message }}
@enderror
{{-- Listado de documentos --}}
Documentos almacenados {{ $tramite->documentos->count() }}
@if($tramite->documentos->isEmpty())

No hay documentos en la bóveda todavía.

Sube el primer documento usando el panel de arriba.
@else
@foreach($tramite->documentos as $documento) @endforeach
Nombre Tamaño Subido por Fecha Acciones
{{ $documento->nombre_original }} {{ $documento->tamano_legible }} {{ $documento->usuario?->name ?? '—' }} {{ $documento->created_at->format('d/m/Y H:i') }}
@csrf @method('DELETE')
@endif
{{-- /panelBoveda --}}
{{-- /card-body --}}
{{-- /card --}}
@endsection @extends('../layouts/partials/footer')