@php $totalSemua = 0; $paymentMethod = $batchPaymentInfo['payment_method'] ?? 'cash'; $paymentMethodLabel = $batchPaymentInfo['payment_method_label'] ?? match($paymentMethod) { 'cash' => 'Tunai', 'transfer' => 'Transfer Bank', 'ewallet' => 'E-Wallet', 'split' => 'Split Payment', default => ucfirst($paymentMethod), }; $isSplitPayment = (bool) ($batchPaymentInfo['is_split_payment'] ?? false); $splitSummary = collect($batchPaymentInfo['split_summary'] ?? []); $splitTotal = (float) ($batchPaymentInfo['split_total'] ?? $splitSummary->sum('amount')); $paidAmount = (float) ($batchPaymentInfo['paid_amount'] ?? 0); $cashReceived = (float) ($batchPaymentInfo['cash_received'] ?? 0); $changeBasePaid = $paidAmount > 0 ? $paidAmount : ($isSplitPayment ? $splitTotal : ($cashReceived ?? 0)); $changeAmount = max((float) $changeBasePaid - (float) $totalSemua, 0); @endphp
@if(env('APP_DEMO', false))
DEMO MODE
@endif
@if($shopLogo ?? false)
{{ $shopName }}
@endif

{{ $shopName }}

@if($shopAddress)
{{ $shopAddress }}
@endif @if($shopPhone)
{{ $shopPhone }}
@endif @if(env('APP_DEMO', false))
Mode Demo
@endif
@if(env('APP_DEMO', false))
Demo Mode
Nota gabungan ini adalah simulasi / percobaan
termasuk transaksi palsu dan bukan bukti pembayaran sah
@endif
Tgl Cetak: {{ now()->format('d/m/Y H:i') }}
Jumlah Order: {{ $orders->count() }}
Pelanggan: {{ $orders->first()->customer_name ?? '-' }}
Metode: {{ $paymentMethodLabel }}
@foreach($orders as $order) @php $totalSemua += (float) $order->total_price; @endphp
Invoice: {{ $order->invoice_number }}
@foreach($order->items as $item)
{{ $item->product_name }} - {{ $item->file_name }}
{{ $item->size_description ?: '-' }} | {{ ($item->sisi ?? 1) }} sisi | {{ $item->material_name ?? '-' }}
{{ $item->qty }} pcs x Rp {{ number_format($item->calculated_price, 0, ',', '.') }} Rp {{ number_format($item->subtotal, 0, ',', '.') }}
@endforeach
@endforeach
TOTAL ORDER Rp {{ number_format($totalSemua, 0, ',', '.') }}
@if($isSplitPayment)
Detail Split Payment
@foreach($splitSummary as $split)
{{ $split['method_label'] ?? '-' }} @if(!empty($split['account_label']))
{{ $split['account_label'] }} @endif
Rp {{ number_format((float) ($split['amount'] ?? 0), 0, ',', '.') }}
@endforeach
Total Split
Rp {{ number_format($splitTotal, 0, ',', '.') }}
@endif
Metode Bayar {{ $paymentMethodLabel }}
Jumlah Dibayar Rp {{ number_format($paidAmount > 0 ? $paidAmount : ($isSplitPayment ? $splitTotal : $totalSemua), 0, ',', '.') }}
@if(!$isSplitPayment && $paymentMethod === 'cash')
Uang Diterima Rp {{ number_format($cashReceived > 0 ? $cashReceived : ($paidAmount > 0 ? $paidAmount : $totalSemua), 0, ',', '.') }}
Kembalian Rp {{ number_format($changeAmount, 0, ',', '.') }}
@elseif($changeAmount > 0)
Kembalian Rp {{ number_format($changeAmount, 0, ',', '.') }}
@endif
@if(env('APP_DEMO', false))
*** DEMO / TIDAK SAH ***
@else
@if($orders->every(fn($o) => $o->isPaid())) *** LUNAS *** @else *** TAGIHAN *** @endif
@endif