@extends('mainlayout.layout') @section('title', config('app.name') . ' | Order ' . ($order->referenceid ?: $order->id)) @section('topbar-search', 'enabled') @section('content')
Dashboard Customer order

Order {{ $order->referenceid ?: '#' . $order->id }}

Created {{ optional($order->created_at)->format('d M Y, H:i') ?: 'date unavailable' }}

Order details

Purchase and payment information.

{{ $order->status_description ?: 'Status unavailable' }}
Order ID
{{ $order->referenceid ?: $order->id }}
Payment plan
{{ ucfirst($order->order_type ?: 'Not specified') }}
Order amount
TZS {{ number_format((int) $order->amount) }}
Amount paid
TZS {{ number_format($amountPaid) }}
Balance
TZS {{ number_format($balance) }}
Initial payment due
{{ $order->initial_expiry_date ?: 'Not specified' }}
Final payment due
{{ $order->full_expiry_date ?: 'Not specified' }}
Payment phone
{{ $order->msisdn ?: ($order->phonenumber ?: 'Not available') }}

Booking history

Visit options and payments selected by this customer.

{{ $bookingHistory->count() }} {{ Str::plural('booking', $bookingHistory->count()) }}
@forelse($bookingHistory as $booking) @php $visitPayment = $booking->visitPayments->sortByDesc('created_at')->first(); $bookingOption = $booking->charge ?: ((int) $booking->amount > 0 ? 'Paid' : 'Free'); $paymentMethod = $visitPayment?->payment_option ?: (strtolower($bookingOption) === 'free' ? 'Not required' : 'Not recorded'); $paymentAmount = $visitPayment?->amount ?? $booking->amount; $paymentStatus = $visitPayment?->status_description ?: $booking->status; @endphp @empty @endforelse
BookingProject & plotVisit selectionOptionPaymentAmountStatusReceipt
#{{ $booking->id }}{{ optional($booking->created_at)->format('d M Y, H:i') ?: '—' }} {{ optional($booking->property)->name ?: 'Project unavailable' }}Plot {{ optional($booking->plot)->plotnumber ?: 'not selected' }} {{ $booking->booked_date_time ?: ($booking->booked_date ?: 'Date not selected') }}{{ $booking->location ?: 'Location not specified' }} {{ ucfirst($bookingOption) }} {{ strtoupper($paymentMethod) }} {{ strtolower($bookingOption) === 'free' ? 'Free' : 'TZS ' . number_format((int) $paymentAmount) }} {{ ucfirst($paymentStatus ?: 'Pending') }} {{ $visitPayment?->receipt ?: '—' }}
No booking history found for this customer.

Transactions

Payments recorded against this order.

@forelse($transactions as $transaction) @empty @endforelse
DateReceiptAmount paidBalance after paymentStatus
{{ optional($transaction->created_at)->format('d M Y, H:i') ?: '—' }} {{ $transaction->receipt ?: '—' }} TZS {{ number_format((int) $transaction->amount_paid) }} TZS {{ number_format((int) $transaction->balance_after_payment) }} {{ $transaction->status_description ?: '—' }}
No transactions recorded for this order.
@endsection