@foreach($items as $index => $pengajuan)
FORM PENGAJUAN BARANG
Nomor: PB-{{ str_pad($pengajuan->id, 5, '0', STR_PAD_LEFT) }}
Nama Pemohon : {{ $pengajuan->user?->name ?? '-' }} Tanggal Pengajuan : {{ \Carbon\Carbon::parse($pengajuan->created_at)->format('d F Y') }}
Jabatan / Role : {{ $pengajuan->user?->role?->name ?? '-' }} Tanggal Dibutuhkan : {{ $pengajuan->needed_date ? \Carbon\Carbon::parse($pengajuan->needed_date)->format('d F Y') : '-' }}
Kampus : {{ $pengajuan->user?->kampus?->nama_kampus ?? 'Global' }} Tipe Pengajuan : @if($pengajuan->request_type == 'asset_candidate') Calon Aset @elseif($pengajuan->request_type == 'consumable') Sekali Pakai @else Campuran @endif
Judul Pengajuan : {{ $pengajuan->title }}
Tujuan/Alasan : {{ $pengajuan->purpose }}
@php $totalEstimasi = 0; $itemList = is_string($pengajuan->items) ? json_decode($pengajuan->items, true) : $pengajuan->items; @endphp @if(is_array($itemList) || is_object($itemList)) @foreach($itemList as $idx => $item) @php $qty = (int)($item['qty'] ?? 0); $price = (int)($item['estimated_price'] ?? 0); $subtotal = $qty * $price; $totalEstimasi += $subtotal; $jenis = ($item['item_kind'] ?? 'consumable') == 'asset_candidate' ? 'Calon Aset' : 'Sekali Pakai'; @endphp @endforeach @else @endif
No Nama Barang Jenis Qty Harga Est. (Rp) Total Est. (Rp)
{{ $idx + 1 }} {{ $item['name'] ?? '-' }} @if(!empty($item['notes']))
Catatan: {{ $item['notes'] }} @endif
{{ $jenis }} {{ $qty }} {{ number_format($price, 0, ',', '.') }} {{ number_format($subtotal, 0, ',', '.') }}
Tidak ada item
TOTAL ESTIMASI {{ number_format($totalEstimasi, 0, ',', '.') }}
Catatan Pemohon:
{{ $pengajuan->employee_notes ?: '-' }}

Catatan Keuangan (Approval):
{{ $pengajuan->approval_notes ?: '-' }}
Pemohon,


{{ $pengajuan->user?->name ?? '-' }}
{{ \Carbon\Carbon::parse($pengajuan->created_at)->format('d F Y') }}
Disetujui Oleh (Keuangan),


@if($pengajuan->status == 'approved') Admin Keuangan @else ( ..................................... ) @endif
@if($pengajuan->status == 'approved' && $pengajuan->approved_at) {{ \Carbon\Carbon::parse($pengajuan->approved_at)->format('d F Y') }} @else   @endif
@if(!$loop->last)
@endif @endforeach