@php $storeName = $order->tenant?->name ?? 'TOKO'; $customerName = $order->customer?->name ?? $order->customer_name ?? 'Guest'; $customerWhatsapp = $order->customer?->whatsapp ?? '-'; $cashierName = $order->user?->name ?? '-'; $orderItems = $order->items ?? collect(); $subtotal = $orderItems->sum(function ($item) { return ($item->price ?? 0) * ($item->quantity ?? 0); }); $totalQty = $orderItems->sum('quantity'); @endphp
{{ $storeName }}
Struk Pembelian
No. Order {{ $order->order_number }}
Tanggal {{ $order->created_at->format('d M Y H:i') }}
Kasir {{ $cashierName }}
Pelanggan
Nama {{ $customerName }}
No. HP {{ $customerWhatsapp }}
Detail Pesanan
@forelse($orderItems as $item)
{{ $item->product_name ?? '-' }}
{{ $item->quantity ?? 0 }} x Rp {{ number_format($item->price ?? 0, 0, ',', '.') }} Rp {{ number_format($item->subtotal ?? (($item->price ?? 0) * ($item->quantity ?? 0)), 0, ',', '.') }}
@empty
Detail item tidak tersedia.
@endforelse
Total Item {{ $totalQty }}
Subtotal Rp {{ number_format($subtotal, 0, ',', '.') }}
TOTAL BAYAR Rp {{ number_format($order->total_amount ?? 0, 0, ',', '.') }}
Pembayaran
Metode {{ $order->paymentMethod?->name ?? '-' }}
Tunai Rp {{ number_format($order->payment_amount ?? 0, 0, ',', '.') }}
Kembalian Rp {{ number_format($order->change_amount ?? 0, 0, ',', '.') }}