@extends('layouts.app') @section('title', 'Paket Distribusi Perwakilan - Sistem Distribusi Qurban') @section('header_title', 'Paket Distribusi Perwakilan') @section('header_subtitle', 'Daftar penanggung jawab pengambilan paket titipan beserta rincian jatahnya') @section('content')

ðŸ“Ķ Rekapitulasi Paket Distribusi & Titipan

@if(request()->anyFilled(['search', 'only_representatives', 'status'])) Reset @endif
@if ($participants->isEmpty())
ðŸ‘Ĩ Tidak ditemukan data perwakilan paket qurban.
@else
@foreach ($participants as $p) @php $alloc = $p->getAllocation(); $ownStatus = $p->distribution ? $p->distribution->status : 'Belum'; $pendingTitips = $p->entrustedToMe->where('status', '!=', 'Selesai'); $hasPendingItems = ($ownStatus !== 'Sudah') || ($pendingTitips->count() > 0); @endphp @endforeach
Nama Perwakilan Tipe Status List Titipan (Pemilik & Tipe) Total Paket Aksi Serah Terima
{{ $p->nama }}
Kupon: {{ $p->no_kupon }} Regu {{ $p->regu ?? '-' }}
{{ $p->jenis }}
@if($ownStatus === 'Titip')
Paket dititipkan ke:
{{ $p->distribution->entrustee->nama ?? '-' }}
Dititip @else @if($alloc->daging_sapi > 0) ðŸŪ Sapi: {{ $alloc->daging_sapi }} Porsi
@endif @if($alloc->daging_kambing > 0) 🐐 Kambing: {{ $alloc->daging_kambing }} Porsi
@endif @if($alloc->hak_2kg > 0) ⭐ Hak 2Kg: {{ $alloc->hak_2kg }}
@endif @if($alloc->hak_paha > 0) 🍗 Paha: {{ $alloc->hak_paha }} @endif
@if($ownStatus === 'Sudah') Diambil @else Belum @endif
@endif
@if($p->entrustedToMe->isEmpty()) Tidak ada titipan paket @else
    @foreach($p->entrustedToMe as $t) @php $tAlloc = $t->participant->getAllocation(); @endphp
  • {{ $t->participant->nama }} ({{ $t->participant->no_kupon }}) {{ $t->participant->jenis }}
    Jatah: @if($tAlloc->daging_sapi > 0) ðŸŪS:{{ $tAlloc->daging_sapi }} @endif @if($tAlloc->daging_kambing > 0) 🐐K:{{ $tAlloc->daging_kambing }} @endif @if($tAlloc->hak_2kg > 0) ⭐2K:{{ $tAlloc->hak_2kg }} @endif
    @if($t->status === 'Pending') Pending @elseif($t->status === 'Diproses') Diproses @else Selesai @endif
  • @endforeach
@endif
@php $tally = []; if ($ownStatus !== 'Titip') { $tally[$p->jenis] = ($tally[$p->jenis] ?? 0) + 1; } foreach ($p->entrustedToMe as $t) { $tally[$t->participant->jenis] = ($tally[$t->participant->jenis] ?? 0) + 1; } @endphp @if (empty($tally)) 0 Paket @else
@foreach ($tally as $type => $count) {{ $count }}x {{ $type }} @endforeach
@endif
@if($ownStatus === 'Titip') Dititipkan @elseif($hasPendingItems)
@csrf
@if($p->entrustedToMe->count() > 0)
Total: {{ 1 + $p->entrustedToMe->count() }} Paket
@endif @else ✅ Semua Selesai @endif
Menampilkan {{ $participants->firstItem() }} - {{ $participants->lastItem() }} dari {{ $participants->total() }} Data
{{ $participants->links() }}
@endif
@endsection