@php($paymentOwner = $platformOrder->sellerOrders->sortBy('id')->first()) @php($hasPendingPrescription = $platformOrder->sellerOrders->contains(fn ($order) => in_array($order->status, ['waiting_prescription', 'prescription_under_review', 'prescription_rejected'], true))) @php($isPaid = $platformOrder->payment_status === 'paid')

Satu transaksi · {{ $platformOrder->sellerOrders->count() }} pengiriman

{{ $platformOrder->order_number }}

Dikirim ke {{ $platformOrder->recipient_name }} · {{ $platformOrder->delivery_address }}

{{ $isPaid ? 'Sudah dibayar' : ($hasPendingPrescription ? 'Resep sedang ditinjau' : 'Siap dibayar') }}
@foreach($platformOrder->sellerOrders as $index => $order) @php($requiresPrescription = $order->items->contains('requires_prescription', true))

Pengiriman {{ $index + 1 }}

{{ $order->tenant->name }}

{{ $order->outlet?->name }} · {{ str($order->quoted_service)->replace('_', ' ')->headline() }} @if($order->quoted_eta) · {{ $order->quoted_eta }} @endif

@if($isPaid){{ in_array($order->status, ['shipped', 'delivered', 'completed'], true) ? 'Dalam pengiriman' : 'Disiapkan' }}@endif
@foreach($order->items as $item)

{{ $item->product_name_snapshot }}

{{ $item->quantity }} × Rp{{ number_format($item->price, 0, ',', '.') }} @if($item->requires_prescription) · perlu resep @endif

Rp{{ number_format($item->subtotal, 0, ',', '.') }}
@endforeach

Ongkir paket

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

@if($requiresPrescription && in_array($order->status, ['waiting_prescription', 'prescription_rejected'], true)){{ $order->status === 'prescription_rejected' ? 'Unggah ulang resep' : 'Unggah resep' }}@elseif($requiresPrescription && $order->status === 'prescription_under_review')Sedang diperiksa apoteker@endif @if($isPaid)Lacak paket@endif
@endforeach