{{-- 側滑面板標題 --}}

{{ __('Order Details') }}

{{ $order->order_no }}
{{-- 基本狀態卡片 --}}

{{ __('Order Status') }}

@php $statusMap = [ 'pending' => 'pending', 'paid' => 'active', 'completed' => 'active', 'cancelled' => 'disabled', 'refunded' => 'error', ]; $labelMap = [ 'pending' => __('Pending'), 'paid' => __('Paid'), 'completed' => __('Completed'), 'cancelled' => __('Cancelled'), 'refunded' => __('Refunded'), ]; $status = $statusMap[$order->status] ?? 'slate'; $label = $labelMap[$order->status] ?? $order->status; @endphp

{{ __('Payment Type') }}

{{ $order->payment_type_label }}

{{-- 交易資訊 --}}

{{ __('Transaction Info') }}

{{ __('Transaction Time') }}

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

{{ __('Machine Name') }}

{{ $order->machine->name ?? __('Unknown') }}

{{ __('Machine Serial') }}

{{ $order->machine->serial_no ?? '---' }}

{{ __('Machine Flow ID') }}

{{ $order->flow_id }}

{{-- 員工卡資訊 --}} @if($order->payment_type == 41 && $order->staffCardLog && $order->staffCardLog->staffCard)

{{ __('Staff Card Info') }}

{{ __('Staff Name') }}

{{ $order->staffCardLog->staffCard->name }}

{{ __('Employee ID') }}

{{ $order->staffCardLog->staffCard->employee_id }}

{{ __('Card UID') }}

{{ $order->staffCardLog->staffCard->card_uid }}

@if($order->staffCardLog->staffCard->notes)

{{ __('Notes') }}

{{ $order->staffCardLog->staffCard->notes }}

@endif
@endif @if($order->payment_type == 42 && !empty($order->member_barcode))

{{ __('Pickup Recipient Info') }}

{{ __('Pickup Recipient (Prescription Slip)') }}

{{ $order->member_barcode }}

@endif {{-- 商品明細 --}}

{{ __('Product Details') }}

{{ $order->items->count() }} {{ __('Items') }}
@foreach($order->items as $item)
@if(isset($item->product->image_url) && $item->product->image_url) @endif

{{ $item->product_name }}

${{ number_format($item->price, 0) }} × {{ $item->quantity }}

${{ number_format($item->subtotal, 0) }}

@endforeach
{{-- 金額彙總 --}}
{{ __('Subtotal') }} ${{ number_format($order->total_amount + $order->discount_amount, 0) }}
{{ __('Discount') }} -${{ number_format($order->discount_amount, 0) }}
{{ __('Total') }}
${{ number_format($order->total_amount, 0) }}
{{-- 出貨紀錄 --}} @if($order->dispenseRecords->count() > 0)

{{ __('Dispense Status') }}

@foreach($order->dispenseRecords as $dispense) @endforeach
{{ __('Slot') }} {{ __('Product') }} {{ __('Status') }}
#{{ str_pad($dispense->slot_no, 2, '0', STR_PAD_LEFT) }}

{{ $dispense->product->localized_name ?? __('Unknown Product') }}

@php $dStatusMap = [ 'success' => 'active', 'failed' => 'error', 'pending' => 'pending', '1' => 'active', '0' => 'error', ]; $dLabelMap = [ 'success' => __('Success'), 'failed' => __('Failed'), 'pending' => __('Pending'), '1' => __('Success'), '0' => __('Failed'), ]; $statusValue = (string)($dispense->dispense_status ?? 'pending'); $ds = $dStatusMap[$statusValue] ?? 'slate'; $dl = $dLabelMap[$statusValue] ?? $statusValue; @endphp
@endif {{-- 發票資訊 --}} @if($order->invoice)

{{ __('Invoice Information') }}

{{ $order->invoice->invoice_no }}

{{ __('Issued At') }}

{{ $order->invoice->invoice_date }} {{ $order->invoice->invoice_time }}

@endif