@extends('layouts.app') @section('title', 'Keputusan Final') @section('content')
{{-- Progress card --}} @php $pct = $totalBatches > 0 ? round($selesaiBatches / $totalBatches * 100) : 0; @endphp
Keputusan Selesai {{ $selesaiBatches }} / {{ $totalBatches }} batch
{{-- Filter bar --}}
@if(request()->hasAny(['q', 'status'])) @endif
{{-- Desktop table --}}
@forelse($batches as $i => $batch) @php $pengajuan = $batch->pengajuan->filter(fn($p) => in_array($p->status->value, ['waiting_keputusan', 'disetujui', 'ditolak']) ); $total = $pengajuan->count(); $dicekCount = $pengajuan->filter(fn($p) => $p->keputusanFinal !== null)->count(); $statusKey = app(\App\Http\Controllers\Verifikator\VerifikatorKeputusanController::class)->batchStatusKey($batch); [$statusLabel, $statusBadge] = match($statusKey) { 'menunggu_keputusan' => ['Menunggu Keputusan', 'bg-warning text-dark'], 'sudah_dicek' => ['Sudah Dicek — Belum Submit', 'bg-info text-dark'], default => ['Selesai', 'bg-success'], }; $canAct = in_array($statusKey, ['menunggu_keputusan', 'sudah_dicek']); @endphp @empty @endforelse
# Nama Kelompok Ronde Debitur FA Sudah Dicek Status Batch
{{ $batches->firstItem() + $i }} {{ $batch->kelompok->nama ?? '-' }} {{ $batch->created_at->translatedFormat('M Y') }} {{ $total }}
{{ $dicekCount }}/{{ $total }}
{{ $statusLabel }} {{ $canAct ? 'Buka' : 'Lihat' }}
{{-- Mobile card list --}}
@forelse($batches as $batch) @php $pengajuan = $batch->pengajuan->filter(fn($p) => in_array($p->status->value, ['waiting_keputusan', 'disetujui', 'ditolak']) ); $total = $pengajuan->count(); $dicekCount = $pengajuan->filter(fn($p) => $p->keputusanFinal !== null)->count(); $statusKey = app(\App\Http\Controllers\Verifikator\VerifikatorKeputusanController::class)->batchStatusKey($batch); [$statusLabel, $statusBadge] = match($statusKey) { 'menunggu_keputusan' => ['Menunggu Keputusan', 'bg-warning text-dark'], 'sudah_dicek' => ['Sudah Dicek — Belum Submit', 'bg-info text-dark'], default => ['Selesai', 'bg-success'], }; $canAct = in_array($statusKey, ['menunggu_keputusan', 'sudah_dicek']); @endphp
{{ $batch->kelompok->nama ?? '-' }}
Ronde {{ $batch->created_at->translatedFormat('M Y') }} · {{ $total }} debitur
{{ $statusLabel }}
{{ $dicekCount }}/{{ $total }} dicek
{{ $canAct ? 'Buka' : 'Lihat' }}
@empty
@endforelse
{{-- Pagination --}} @if($batches->hasPages())
{{ $batches->links() }}
@endif
@endsection