{{-- HEADER --}}
{{ $store['name'] }}
@if($store['address']){{ $store['address'] }}
@endif @if($store['phone'])Telp. {{ $store['phone'] }}@endif @if($store['email']) | {{ $store['email'] }}@endif
Invoice
{{ $order->order_number }}
{{ $order->created_at?->translatedFormat('d F Y') ?? now()->translatedFormat('d F Y') }}
{{-- INFO SECTION --}}
Pelanggan
{{ $order->customer_name ?? 'Umum' }}
@if($order->customer?->address){{ $order->customer->address }}
@endif @if($order->customer?->phone)Telp. {{ $order->customer->phone }}@endif
Detail Pesanan
Metode Bayar{{ match($order->payment_method) { 'cash' => 'Tunai', 'transfer' => 'Transfer Bank', 'qris' => 'QRIS', default => '-' } }}
Jatuh Tempo{{ $order->due_date?->translatedFormat('d F Y') ?? '-' }}
{{-- ITEMS TABLE --}} @foreach($order->items as $idx => $item) @php $qtyEffective = (int) $item->quantity - (int) $item->qty_returned; $effectiveSubtotal = $qtyEffective * (float) $item->product_price; $discountAmount = (float) $item->discount > 0 ? $effectiveSubtotal * ((float) $item->discount / 100) : 0; $finalSubtotal = $effectiveSubtotal - $discountAmount; @endphp @endforeach
No Barang SKU Qty Satuan Harga Disc Jumlah
{{ $idx + 1 }} {{ $item->product_name ?? $item->product?->name ?? '-' }} @if((int) $item->qty_returned > 0)
(retur: {{ (int) $item->qty_returned }}) @endif
{{ $item->product?->sku ?? '-' }} {{ $qtyEffective }} {{ $item->product?->unit ?? 'Pcs' }} Rp {{ number_format((float) $item->product_price, 0, ',', '.') }} {{ (float) $item->discount > 0 ? number_format((float) $item->discount, 0) . '%' : '-' }} Rp {{ number_format($finalSubtotal, 0, ',', '.') }}
{{-- NOTES --}} @if($order->notes)
Catatan
{{ $order->notes }}
@endif {{-- SUMMARY --}}
@if((float) $order->amount_paid > 0) @endif
Subtotal Rp {{ number_format((float) $order->subtotal, 0, ',', '.') }}
Diskon ({{ number_format((float) $order->discount, 0) }}%) - Rp {{ number_format((float) $order->subtotal * ((float) $order->discount / 100), 0, ',', '.') }}
Pajak ({{ $order->tax_enabled ? number_format((float) $order->tax_rate, 1) . '%' : '0%' }}) Rp {{ number_format((float) $order->tax, 0, ',', '.') }}
Total Rp {{ number_format((float) $order->total, 0, ',', '.') }}
Terbayar Rp {{ number_format((float) $order->amount_paid, 0, ',', '.') }}
Sisa Rp {{ number_format((float) $order->balance_due, 0, ',', '.') }}
{{-- SIGNATURES --}}
{{ $store['name'] }}
Pelanggan
{{-- FOOTER --}}