{{ __('Detail Pesanan') }} #{{ $order->order_code }}

@if($order->status === 'pending')
@csrf @method('PUT')
@csrf @method('PUT')
@endif

Informasi Pemesan & Produk

Pelanggan

{{ $order->user->name ?? 'User Terhapus' }}

{{ $order->user->email ?? '-' }}

{{ $order->user->phone ?? '-' }}

Waktu Pesanan

{{ $order->created_at->format('d M Y, H:i') }}

{{ $order->created_at->diffForHumans() }}

Item Pesanan

@forelse($order->orderItems as $item) @php $itemQty = $item->quantity ?? 1; @endphp
@if(isset($item->product) && $item->product->thumbnail) {{ $item->product->name }} @else
@endif

{{ $item->product->name ?? 'Produk Terhapus' }}

{{ $item->product->category->name ?? '' }}

Rp {{ number_format($item->price, 0, ',', '.') }} × {{ $itemQty }} item

Rp {{ number_format($item->price * $itemQty, 0, ',', '.') }}

@if($itemQty > 1)

qty: {{ $itemQty }}

@endif
@empty
@if(isset($order->product) && $order->product->thumbnail) {{ $order->product->name }} @else
@endif

{{ $order->product->name ?? 'Produk Terhapus' }}

{{ $order->product->category->name ?? '' }}

Rp {{ number_format($order->amount, 0, ',', '.') }}

@endforelse
@php $itemSubtotal = $order->orderItems->sum(fn($i) => ($i->price * ($i->quantity ?? 1))); if ($itemSubtotal == 0 && $order->product) { $itemSubtotal = $order->product->price ?? 0; } $uniqueCode = $order->amount - $itemSubtotal; @endphp {{-- Total Tagihan --}}
Subtotal Produk Rp {{ number_format($itemSubtotal, 0, ',', '.') }}
@if($uniqueCode > 0)
Kode Unik Verifikasi Untuk identifikasi mutasi +{{ $uniqueCode }}
@endif
Total Tagihan ke Pelanggan Rp {{ number_format($order->amount, 0, ',', '.') }}

Bukti Pembayaran

@if($order->paymentProof) @if($order->paymentProof->note)

Catatan dari Pelanggan:

"{{ $order->paymentProof->note }}"

@endif

Diunggah: {{ $order->paymentProof->created_at->format('d M Y, H:i') }}

@else

Belum ada bukti pembayaran

Pelanggan belum mengunggah bukti transfer.

@endif
{{-- ASSIGNED CREDENTIAL ACCOUNTS (for account-type products) --}} @php $order->loadMissing('orderItems.product', 'orderItems.productAccounts'); $accountItems = $order->orderItems->filter(fn($i) => optional($i->product)->product_type === 'account'); @endphp @if($accountItems->isNotEmpty())

Kredensial Akun (Vault)

@if($order->status === 'paid') Sudah Di-assign @else Menunggu Konfirmasi @endif
@foreach($accountItems as $item)

{{ optional($item->product)->name }} (Qty: {{ $item->quantity }})

@if($item->productAccounts && $item->productAccounts->isNotEmpty())
@foreach($item->productAccounts as $index => $account)

Akun {{ $index + 1 }}

@php $parts = explode('|', $account->account_details, 2); $credEmail = trim($parts[0] ?? ''); $credPass = trim($parts[1] ?? $account->account_details); @endphp
Email {{ $credEmail }}
@if($credPass && $credPass !== $credEmail)
Password {{ $credPass }}
@endif

ID Vault: #{{ $account->id }} | Di-assign: {{ $account->updated_at->format('d M Y, H:i') }}

@endforeach
@else
Akun belum di-assign. Klik "Konfirmasi Lunas" untuk auto-assign dari vault.
@endif
@endforeach
@endif

Status Pesanan

Status Saat Ini

@if($order->status === 'paid')

Lunas / Sukses

{{ $order->paid_at ? $order->paid_at->format('d M Y, H:i') : '' }}

@elseif($order->status === 'pending')

Menunggu Pembayaran

@else

Dibatalkan

@endif

Metode Pemesanan

{{ $order->method == 'whatsapp' ? 'WhatsApp Redirect' : 'Transfer Bank (Panel)' }}

@if($order->status === 'paid')
@csrf @method('PUT')
@endif
@csrf @method('DELETE')