@php // Assume $booking, $details, $payments, $member, $voucher are passed to this view // Fetch all banks for lookup $banks = \DB::table('Luv2_bank')->pluck('name', 'code'); function paymentTypeName($type) { return match($type) { 'B' => 'Bank', 'C' => 'Credit', 'O' => 'Onsite', 'S' => 'Saldo', 'CD' => 'Card', 'P' => 'PayPal', 'M' => 'Midtrans', 'D' => 'Deposit', default => $type, }; } @endphp Payment Receipt - {{ $booking->no ?? 'Booking' }}
PAYMENT RECEIPT
Your Details
Name {{ $member->name ?? 'Guest' }}
Email {{ $member->email ?? '-' }}
Order Details
Booking No {{ $booking->no ?? '-' }}
Date Booking {{ $booking->booking_date ?? '-' }}
Package Details
@foreach($details as $d) @endforeach
Code Name Date
Lesson
Price Qty Nett
{{ $d->code }} {{ $d->name }} {{ $d->date ? \Carbon\Carbon::parse($d->date)->format('d/m/Y') : '-' }} {{ number_format($d->price, 0, ',', '.') }} {{ $d->qty }} {{ number_format($d->nett, 0, ',', '.') }}
Summary
Total Gross {{ number_format($booking->gross, 0, ',', '.') }}
Total Discount {{ number_format($booking->disc, 0, ',', '.') }}
Discount % {{ number_format($booking->discp, 2) }}%
Total Nett {{ number_format($booking->nett, 0, ',', '.') }}
@if($voucher)
Voucher: {{ $voucher->voucher }} - @if($voucher->tipe == 0) {{ $voucher->value }}% Discount @else Rp {{ number_format($voucher->value, 0, ',', '.') }} Discount @endif
@endif
Payment History
Payment Type Amount
@foreach($payments as $p)
{{ paymentTypeName($p->type) }} @if($p->type === 'B') - {{ $banks[$p->bank_code] ?? '-' }} @endif {{ number_format($p->amount, 0, ',', '.') }}
@endforeach
TOTAL {{ number_format($booking->paid, 0, ',', '.') }}