@php if (!function_exists('formatRupiah')) { function formatRupiah($number) { return 'Rp ' . number_format($number ?? 0, 0, ',', '.'); } } @endphp @foreach ($orders as $order) @php $logisticName = $order->logistic?->name ?? ($order->order?->name ?? ''); $rateCode = $order->orderShipmentGenerate?->rate_code ?? ($order->orderShipmentGenerate?->rate_code ?? '-'); $actorType = $order->actor?->type ?? ''; $mitraName = $order->csBonus?->customerService?->name ?? 'Mitra'; $shipperName = $actorType == 'mitra' ? $mitraName : $order->shipper_name ?? '-'; @endphp
@php $logoUrl = match ($logisticName) { 'ID Express' => 'https://s3.bukalapak.com/attachment/340042/id-express.png', 'J&T Express' => 'https://upload.wikimedia.org/wikipedia/commons/thumb/0/01/J%26T_Express_logo.svg/2560px-J%26T_Express_logo.svg.png', 'JNE' => 'https://upload.wikimedia.org/wikipedia/commons/9/92/New_Logo_JNE.png', 'POS Indonesia' => 'https://admin-piol.posindonesia.co.id/media/pages-makna-logo-4.jpg', default => '', }; @endphp @if ($logoUrl)
@else
{{ $logisticName ?: 'LOGISTIK' }}
@endif
{{ $order->client_order_no ?? '-' }}
{{ $rateCode }}
{{ $order->awb_number ?? 'NO AWB' }}
Tanggal Order: {{ $order->order_date ?? date('Y-m-d') }}
Pengirim:
{{ $shipperName }} ({{ $order->csBonus?->customerService?->phone ?? '-' }})
{{ $order->actor?->address ?? '-' }}, {{ $order->actor?->area->sub_district_name ?? '' }}, {{ $order->actor?->area->district_name ?? '' }}, {{ $order->actor?->area->city_name ?? '' }} {{ $order->actor?->area->province_name ?? '' }}, {{ $order->actor?->area->zip_code ?? '' }}
Penerima:
{{ $order->receiver?->name ?? 'Tanpa Nama' }} ({{ $order->receiver?->phone_number ?? '' }})
{{ $order->receiver?->address ?? '-' }}, {{ $order->receiver?->sub_district ?? '' }}, {{ $order->receiver?->district ?? '' }}, {{ $order->receiver?->city ?? '' }}, {{ $order->receiver?->postal_code ?? '' }}
BERAT
1 KG
ONGKIR
{{ formatRupiah($order->orderShipmentGenerate->shipping_cost ?? 0) }}
Sudah Termasuk PPN
COD
{{ formatRupiah($order->total_payment) }}
{{ ($order->total_payment ?? 0) > 0 ? 'Bayar di Tempat (COD)' : 'Sudah Dibayar' }}
@endforeach