@extends('layouts.admin') @section('title', 'Order Details') @section('content')
@php $firstItem = $order->items->first(); $firstProduct = $firstItem?->product; $firstGame = $firstProduct?->game; @endphp @if($firstProduct && $firstProduct->image) {{ $firstProduct->name }} @else
🎮
@endif
@if($firstGame && $firstGame->icon) @endif {{ $firstGame->name ?? 'No Game' }}

{{ $firstProduct->name ?? 'No Product' }}

@if($order->items->count() > 1) +{{ $order->items->count() - 1 }} more item(s) @endif
Order # {{ $order->order_number }}
Date {{ $order->created_at ? $order->created_at->format('d/m/Y H:i') : '-' }}
Status {{ ucfirst($order->status) }}
@if(!in_array($order->status, ['delivered', 'failed', 'refunded']))
@csrf
@csrf
Don't forget to take screenshots or record a video of delivery.
@else Order is final ({{ ucfirst($order->status) }}) @endif

Order Items

{{ $order->items->count() }} item(s)
@foreach($order->items as $item)
@if($item->product && $item->product->image) @else
📦
@endif

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

@if($item->product && $item->product->game) @if($item->product->game->icon) @endif {{ $item->product->game->name }} @endif • Qty: {{ $item->quantity }}

Rp {{ number_format($item->price * $item->quantity) }}

@ Rp {{ number_format($item->price) }}

@endforeach
@if($order->deliveryLogs->count())

Delivery Logs

@foreach($order->deliveryLogs as $log)
{{ $log->created_at ? date('d/m/Y H:i', strtotime($log->created_at)) : '-' }} {{ $log->bot_account }} → {{ $log->roblox_username }}
{{ $log->delivery_status }}
@endforeach
@endif

Chat dengan Customer

{{ $order->user->username ?? 'Guest' }}
@forelse($order->chats ?? [] as $chat)

{{ $chat->message }}

{{ $chat->created_at ? date('d/m/Y H:i', strtotime($chat->created_at)) : '-' }} @if($chat->sender_type == 'admin') {{ $chat->is_read ? '✓✓' : '✓' }} @endif

@empty

Belum ada pesan

@endforelse
@csrf

Customer Info

Username

{{ $order->user->username ?? 'Guest' }}

Email

{{ $order->email }}

Roblox Username

{{ $order->roblox_username }}

Order Summary

Subtotal Rp {{ number_format($order->subtotal) }}
Discount - Rp {{ number_format($order->discount) }}
Fee Rp {{ number_format($order->fee) }}
Total Rp {{ number_format($order->total) }}

Payment Details

Method {{ $order->payment->payment_method ?? '-' }}
Gateway {{ $order->payment->gateway ?? '-' }}
Status {{ $order->payment->status ?? 'pending' }}
@if($order->payment->transaction_id)

Transaction ID

{{ $order->payment->transaction_id }}

@endif
@if($order->manualPayment)

Manual Payment

{{ ucfirst($order->manualPayment->status) }}
@if($order->manualPayment->bank)

Bank Tujuan

@if($order->manualPayment->bank->logo) @endif

{{ $order->manualPayment->bank->bank_name }}

{{ $order->manualPayment->bank->account_number }}

a.n. {{ $order->manualPayment->bank->account_holder }}

@endif

Transfer Detail

Bank Pengirim {{ $order->manualPayment->bank_name }} Nama Pengirim {{ $order->manualPayment->account_name }} No. Rekening {{ $order->manualPayment->account_number }} Tanggal Transfer {{ $order->manualPayment->transfer_date ? date('d/m/Y H:i', strtotime($order->manualPayment->transfer_date)) : '-' }} Jumlah Rp {{ number_format($order->manualPayment->amount) }}
@if($order->manualPayment->notes)
Catatan:

{{ $order->manualPayment->notes }}

@endif
@if($order->manualPayment->proof_file) @endif @if($order->manualPayment->status == 'pending')
@csrf
@elseif($order->manualPayment->status == 'verified')
✓ Diverifikasi oleh {{ $order->manualPayment->verifier->username ?? 'Admin' }}

{{ $order->manualPayment->verified_at ? date('d/m/Y H:i', strtotime($order->manualPayment->verified_at)) : '-' }}

@endif
@endif @if(isset($order->attachments) && $order->attachments->count())

Attachments

@foreach($order->attachments as $file)
{{ $file->file_name }}
View
@endforeach
@endif @if($order->status == 'paid')
@csrf
@endif
@endsection @section('scripts') @endsection