@php $companyName = \App\Models\Setting::get('receipt_company_name', \App\Helpers\SeoHelper::siteName()); $companyAddress = \App\Models\Setting::get('receipt_company_address', ''); $companyPhone = \App\Models\Setting::get('receipt_company_phone', ''); $companyEmail = \App\Models\Setting::get('receipt_company_email', ''); $companyWebsite = \App\Models\Setting::get('receipt_website', url('/')); $footerText = \App\Models\Setting::get('receipt_footer_text', 'Thank you for your business!'); $showLogo = \App\Models\Setting::get('receipt_show_logo', true); $siteLogo = \App\Helpers\SeoHelper::logo(); $days = \Carbon\Carbon::parse($booking->check_in)->diffInDays(\Carbon\Carbon::parse($booking->check_out)); $baseSubtotal = $booking->listing->price_per_day * $days; $subtotalAfterDiscount = $baseSubtotal - ($booking->discount_amount ?? 0); $addOnsTotal = $booking->addOns->sum('pivot.price_paid'); $bookingAmount = $subtotalAfterDiscount + $addOnsTotal; // Gateway fee (payment processing fee) - charged to guest $gatewayFee = $booking->platform_fee > 0 ? $booking->platform_fee : \App\Services\GatewayFeeService::calculateFee($bookingAmount); // Get gateway fee settings for display $gatewayFeeType = \App\Models\Setting::get('payment_gateway_fee_type', 'fixed'); $gatewayFeeFixed = \App\Models\Setting::get('payment_gateway_fee_fixed', 0); $gatewayFeePercentage = \App\Models\Setting::get('payment_gateway_fee_percentage', 0); @endphp Receipt #{{ $booking->invoice_number }}
Back to Bookings
@if($showLogo && $siteLogo) {{ $companyName }} @endif

{{ $companyName }}

{{ $companyWebsite }}

@if($companyAddress)

{{ $companyAddress }}

@endif @if($companyPhone)

Tel: {{ $companyPhone }}

@endif @if($companyEmail)

{{ $companyEmail }}

@endif

BOOKING RECEIPT

Receipt #{{ $booking->id }} | Invoice: {{ $booking->invoice_number }}

Issue Date

{{ now()->format('M d, Y') }}

{{ strtoupper($booking->status) }}

Customer

{{ $booking->user->name }}

{{ $booking->user->email }}

@if($booking->user->phone)

{{ $booking->user->phone }}

@endif

Booking Info

Booked: {{ $booking->created_at->format('M d, Y h:i A') }}

@if($booking->payment && $booking->payment->transaction_id)

Transaction: {{ $booking->payment->transaction_id }}

@endif

{{ $booking->listing->title }}

Type: {{ $booking->listing->rentalType->name }}
Location: {{ $booking->listing->location->name }}
Guests: {{ $booking->guests }}
Check-in: {{ \Carbon\Carbon::parse($booking->check_in)->format('M d, Y') }}
Check-out: {{ \Carbon\Carbon::parse($booking->check_out)->format('M d, Y') }}
Duration: {{ $days }} {{ $days > 1 ? 'days' : 'day' }}
@if(isset($booking->discount_amount) && $booking->discount_amount > 0) @endif @if($booking->addOns && $booking->addOns->count() > 0) @foreach($booking->addOns as $addOn) @endforeach @endif @if($gatewayFee > 0) @endif
Rental (RM {{ number_format($booking->listing->price_per_day, 2) }} × {{ $days }} {{ $days > 1 ? 'days' : 'day' }}) RM {{ number_format($baseSubtotal, 2) }}
Discount ({{ number_format($booking->discount_percentage ?? 0, 0) }}% OFF) -RM {{ number_format($booking->discount_amount, 2) }}
Add-on: {{ $addOn->name }} @if($addOn->pricing_type === 'per_day') (per day) @elseif($addOn->pricing_type === 'per_guest') (per guest) @elseif($addOn->pricing_type === 'per_day_per_guest') (per day/guest) @endif RM {{ number_format($addOn->pivot->price_paid, 2) }}
Subtotal RM {{ number_format($bookingAmount, 2) }}
Payment Processing Fee @if($gatewayFeeType === 'fixed') (RM {{ number_format($gatewayFeeFixed, 2) }}) @elseif($gatewayFeeType === 'percentage') ({{ number_format($gatewayFeePercentage, 1) }}%) @else (RM {{ number_format($gatewayFeeFixed, 2) }} + {{ number_format($gatewayFeePercentage, 1) }}%) @endif RM {{ number_format($gatewayFee, 2) }}
TOTAL PAID RM {{ number_format($booking->total_price, 2) }}
@if($booking->payment)
Payment Status: @if(in_array($booking->payment->status, ['successful', 'completed'])) ✓ PAID @else {{ strtoupper($booking->payment->status) }} @endif
@endif

{{ $footerText }}

@if($companyEmail)

Contact: {{ $companyEmail }} @if($companyPhone) | Tel: {{ $companyPhone }}@endif

@endif

Automatically generated receipt. No signature required.