@extends('layouts.app') @section('title', 'Desk Analysis') @section('content')
{{-- Progress card --}} @php $pct = $totalDaBatches > 0 ? round($selesaiDaBatches / $totalDaBatches * 100) : 0; @endphp
DA Selesai Direview {{ $selesaiDaBatches }} / {{ $totalDaBatches }} batch
{{-- Filter bar --}}
@if(request()->hasAny(['q', 'status'])) @endif
{{-- Desktop table --}}
@forelse($batches as $i => $batch) @php $pengajuan = $batch->pengajuan; $total = $pengajuan->count(); $doneCount = $pengajuan->filter(fn($p) => in_array($p->status->value, ['waiting_approval_da','fa','waiting_review_fa','waiting_keputusan','disetujui','ditolak']) )->count(); $statusKey = app(\App\Http\Controllers\Penelaah\PenelaahDaController::class)->batchStatusKey($batch); [$statusLabel, $statusBadge] = match($statusKey) { 'menunggu_review' => ['Menunggu Review', 'bg-warning text-dark'], 'menunggu_approval' => ['Menunggu Approval', 'bg-info text-dark'], 'sebagian_selesai' => ['Sebagian Selesai', 'bg-secondary'], default => ['Selesai', 'bg-success'], }; $canAct = in_array($statusKey, ['menunggu_review', 'menunggu_approval', 'sebagian_selesai']); @endphp @empty @endforelse
# Nama Kelompok Tanggal Pengajuan Jumlah Debitur Review DA Status
{{ $batches->firstItem() + $i }} {{ $batch->kelompok->nama ?? '-' }} {{ $batch->created_at->translatedFormat('M Y') }} {{ $total }}
{{ $doneCount }}/{{ $total }}
{{ $statusLabel }} {{ $canAct ? 'Buka' : 'Lihat' }}
{{-- Mobile card list --}}
@forelse($batches as $batch) @php $pengajuan = $batch->pengajuan; $total = $pengajuan->count(); $doneCount = $pengajuan->filter(fn($p) => in_array($p->status->value, ['waiting_approval_da','fa','waiting_review_fa','waiting_keputusan','disetujui','ditolak']) )->count(); $statusKey = app(\App\Http\Controllers\Penelaah\PenelaahDaController::class)->batchStatusKey($batch); [$statusLabel, $statusBadge] = match($statusKey) { 'menunggu_review' => ['Menunggu Review', 'bg-warning text-dark'], 'menunggu_approval' => ['Menunggu Approval', 'bg-info text-dark'], 'sebagian_selesai' => ['Sebagian Selesai', 'bg-secondary'], default => ['Selesai', 'bg-success'], }; $canAct = in_array($statusKey, ['menunggu_review', 'menunggu_approval', 'sebagian_selesai']); @endphp
{{ $batch->kelompok->nama ?? '-' }}
Ronde {{ $batch->created_at->translatedFormat('M Y') }} · {{ $total }} debitur
{{ $statusLabel }}
{{ $doneCount }}/{{ $total }} review DA
{{ $canAct ? 'Buka' : 'Lihat' }}
@empty @endforelse
{{-- Pagination --}} @if($batches->hasPages())
{{ $batches->links() }}
@endif
@endsection