@php
$allocationGroups = [
1 => ['label' => 'Kalkulasi', 'items' => $detail->allocations->where('type', 1)],
2 => ['label' => 'Tagihan', 'items' => $detail->allocations->where('type', 2)],
];
@endphp
@foreach ($allocationGroups as $groupType => $group)
{{ $group['label'] }}
| ID Alokasi |
Nama |
Tipe |
Nilai |
Keterangan |
Status |
Dibuat Oleh |
Waktu |
|
@forelse ($group['items'] as $allocation)
| {{ $allocation->allocation_number }} |
{{ $allocation->name }} |
{{ $allocation->type_name }} |
Rp{{ number_format($allocation->amount, 0, ',', '.') }} |
{{ $allocation->description ?? '-' }} |
@if ($allocation->status == 0)
@else
Aktif
@endif
|
{{ $allocation->creator->name ?? '-' }} |
{{ date_format(date_create($allocation->created), 'd M Y H:i') }} |
@if ($allocation->status == 0)
@endif
|
@empty
| Belum ada alokasi |
@endforelse
@if ($group['items']->count() > 0)
| Total |
Rp{{ number_format($group['items']->sum('amount'), 0, ',', '.') }}
|
|
@endif
@endforeach