@php $setting = \App\Models\Setting::current(); $publicStorageUrl = rtrim((string) config('filesystems.disks.public.url'), '/'); $logoPath = trim((string) ($setting->store_logo ?? ''), '/'); $logoUrl = $logoPath !== '' && $publicStorageUrl !== '' ? $publicStorageUrl.'/'.$logoPath : null; $logoHost = $logoUrl ? (string) (parse_url($logoUrl, PHP_URL_HOST) ?? '') : ''; if (in_array($logoHost, ['127.0.0.1', 'localhost'], true)) { $logoUrl = null; } $storeName = (string) ($setting->store_name ?? config('app.name')); $storePhone = trim((string) ($setting->phone ?? '')); $storeAddress = trim((string) ($setting->address ?? '')); $brand = '#dc2626'; $brandDark = '#b91c1c'; $surface = '#ffffff'; $background = '#f3f4f6'; $ink = '#111827'; $muted = '#64748b'; $mutedLight = '#94a3b8'; $paidAt = $transaction->paid_at ?? $transaction->updated_at; $detailUrl = route('self-order.payment.receipt', ['code' => $transaction->code, 'token' => $transaction->self_order_token]); $orderTypeLabel = \App\Helpers\DataLabelHelper::enum($transaction->order_type ?? null, 'order_type'); $paymentMethodLabel = \App\Helpers\DataLabelHelper::enum($transaction->payment_method ?? null, 'payment_method'); $subtotal = (int) ($transaction->subtotal ?? 0); $taxAmount = (int) ($transaction->tax_amount ?? 0); $taxPercentage = (string) ($transaction->tax_percentage ?? ''); $roundingAmount = (int) ($transaction->rounding_amount ?? 0); $paymentFee = (int) ($transaction->payment_fee_amount ?? 0); $voucherDiscount = (int) ($transaction->voucher_discount_amount ?? 0); $voucherCode = trim((string) ($transaction->voucher_code ?? '')); $pointDiscount = (int) ($transaction->point_discount_amount ?? 0); $pointsRedeemed = (int) ($transaction->points_redeemed ?? 0); $manualDiscount = (int) ($transaction->manual_discount_amount ?? 0); $total = (int) ($transaction->total ?? 0); $cashReceived = (int) ($transaction->cash_received ?? 0); $cashChange = (int) ($transaction->cash_change ?? 0); $tableNumber = $transaction->diningTable?->table_number ? (string) $transaction->diningTable->table_number : ''; @endphp
Struk pembayaran #{{ $transaction->code }} dari {{ $storeName }}. Total Rp {{ number_format($total, 0, ',', '.') }}.
@if($logoUrl) {{ $storeName }} @else

{{ $storeName }}

@endif @if($storeAddress !== '')
{{ $storeAddress }}
@endif @if($storePhone !== '')
{{ $storePhone }}
@endif
PEMBAYARAN BERHASIL
Ringkasan Transaksi
@if($tableNumber !== '') @endif
Kode Transaksi #{{ $transaction->code }}
Tanggal {{ $paidAt?->format('d M Y, H:i') }}
Metode Pembayaran {{ $paymentMethodLabel }}
Tipe Pesanan {{ $orderTypeLabel }}
Nomor Meja {{ $tableNumber }}
Informasi Pelanggan
@if($transaction->phone) @endif @if(($transaction->email ?? '') !== '') @endif
Nama {{ $transaction->name }}
No. HP {{ $transaction->phone }}
Email {{ $transaction->email }}
Rincian Pesanan
@foreach($transaction->transactionItems as $item) @endforeach
Item Total
{{ $item->product->name ?? 'Item' }}
@php $variantDisplay = \App\Support\Products\ItemNameFormatter::displayVariantName((int) $item->product_id, $item->variant?->name); @endphp @if($variantDisplay !== '')
Varian: {{ $variantDisplay }}
@endif @if(! empty($item->note))
Catatan: {{ $item->note }}
@endif
{{ (int) $item->quantity }} x Rp {{ number_format((int) $item->price, 0, ',', '.') }}
Rp {{ number_format((int) $item->subtotal, 0, ',', '.') }}
Rincian Pembayaran
@if($voucherDiscount > 0) @endif @if($pointDiscount > 0) @endif @if($manualDiscount > 0) @endif @if($transaction->tax_amount > 0) @endif @if($paymentFee > 0) @endif @if($roundingAmount !== 0) @endif @if(($transaction->payment_method ?? '') === 'cash' && $cashReceived > 0) @endif
Subtotal Rp {{ number_format($subtotal, 0, ',', '.') }}
Diskon Voucher{{ $voucherCode !== '' ? ' ('.$voucherCode.')' : '' }} -Rp {{ number_format($voucherDiscount, 0, ',', '.') }}
Diskon Poin{{ $pointsRedeemed > 0 ? ' ('.number_format($pointsRedeemed, 0, ',', '.').' poin)' : '' }} -Rp {{ number_format($pointDiscount, 0, ',', '.') }}
Diskon -Rp {{ number_format($manualDiscount, 0, ',', '.') }}
Pajak PB1{{ $taxPercentage !== '' ? ' ('.$taxPercentage.'%)' : '' }} Rp {{ number_format($taxAmount, 0, ',', '.') }}
Biaya Admin Rp {{ number_format($paymentFee, 0, ',', '.') }}
Pembulatan Rp {{ number_format($roundingAmount, 0, ',', '.') }}
Total Pembayaran Rp {{ number_format($total, 0, ',', '.') }}
Tunai Diterima Rp {{ number_format($cashReceived, 0, ',', '.') }}
Kembalian Rp {{ number_format($cashChange, 0, ',', '.') }}
Lihat Struk Digital
Jika tombol tidak bisa diklik, salin tautan ini ke browser:
{{ $detailUrl }}

Terima kasih telah memesan di {{ $storeName }}.

Simpan email ini sebagai bukti pembayaran yang sah. Untuk pertanyaan atau koreksi pesanan, silakan hubungi kami.

© {{ date('Y') }} {{ $storeName }}