@php $fmt = fn($n) => 'Rp ' . number_format((float) $n, 0, ',', '.'); @endphp
@if ($bill->product?->category) {!! $svgKategori($bill->product->category->slug, 'w-6 h-6') !!} @endif
{{ $bill->product?->category?->name }}

{{ $bill->product?->name }}

No. Pelanggan {{ $bill->customer_no }}
Nama Pelanggan {{ $bill->customer_name ?: '-' }}
@php $bebas = (float) $bill->requested_amount > 0; @endphp {{ $bebas ? 'Nominal Top Up' : 'Nominal Tagihan' }} {{ $fmt($bebas ? $bill->requested_amount : $bill->amount) }}
Biaya Admin + Keuntungan {{ $fmt(max((float) $bill->price - ($bebas ? (float) $bill->requested_amount : (float) $bill->amount), 0)) }}
Total Dibayar {{ $fmt($bill->price) }}
@if (! empty($bill->description) && is_array($bill->description))

Rincian Tagihan

@foreach ($bill->description as $key => $val) @if (is_scalar($val) && $key !== 'detail')
{{ ucfirst(str_replace('_', ' ', $key)) }} {{ $val }}
@endif @endforeach @foreach (($bill->description['detail'] ?? []) as $d) @if (is_array($d))
@foreach ($d as $k => $v) @if (is_scalar($v))
{{ ucfirst(str_replace('_', ' ', $k)) }} {{ $v }}
@endif @endforeach
@endif @endforeach
@endif @if ($bill->status === 'inquired') @if ($saldo < (float) $bill->price)
Saldo kurang {{ $fmt((float) $bill->price - $saldo) }}. Isi saldo
@endif
@csrf
@else @php $stMap = [ 'paid' => ['Lunas', 'bg-green-100 text-green-700'], 'failed' => ['Gagal', 'bg-red-100 text-red-700'], 'expired' => ['Kadaluarsa', 'bg-slate-100 text-slate-600'], ]; [$lbl, $wrn] = $stMap[$bill->status] ?? [ucfirst($bill->status), 'bg-slate-100 text-slate-600']; @endphp
{{ $lbl }}
@endif