@extends('mainlayout.layout') @section('title', config('app.name') . ' | Plot ' . $plot->plotnumber) @push('css') @endpush @section('content') @php $plotId = encrypt($plot->id); $projectId = encrypt($property->id); $canEdit = Auth::user()->hasRole('superadmin') || Auth::user()->can('property.edit'); $plotPricing = $pricing->firstWhere('landuseid', $plot->landuse); $plotStatus = [1 => ['Available', 'pw-success'], 2 => ['Reserved', 'pw-warning'], 3 => ['Sold', 'pw-success'], 4 => ['Unavailable', 'pw-danger']][$plot->status] ?? ['Unknown', 'pw-neutral']; $orderUrl = $order ? '/property/orders/view/' . encrypt($order->id) : null; $customerName = $order && $order->user ? trim($order->user->first_name . ' ' . $order->user->last_name) : 'Not available'; @endphp
Back to project plots{{ $property->name }}

Plot {{ $plot->plotnumber }}

{{ $plotStatus[0] }}

Plot details, purchase information and payment activity.

Transaction Logs @if($canEdit && in_array((int) $plot->status, [1, 2, 4]))
@csrf
@endif
@include('superadmin.property.partials.workspace_feedback')
Plot Area{{ number_format((float) $plot->area_size) }}Square metres
Full Payment Price{{ $plotPricing ? number_format((float) $plotPricing->full) : '—' }}TZS per SQM
Installment Price{{ $plotPricing ? number_format((float) $plotPricing->installment) : '—' }}TZS per SQM
Amount Paid{{ number_format((float) $amount_paid) }}TZS · current order

Order Details

Purchase and payment information for this plot.

@if($order)
Order status
{{ $order->status_description ?: 'Not provided' }}
Order value
TZS {{ number_format((float) $order->amount) }}
Payment plan
{{ $order->order_type ?: 'Not provided' }}
Amount paid
TZS {{ number_format((float) $amount_paid) }}
Balance after latest payment
{{ $lastTransaction ? 'TZS ' . number_format((float) $balance) : 'No payment recorded' }}
Customer
@if($order->user){{ $customerName }}@else{{ $customerName }}@endif
Customer phone
{{ optional($order->user)->phone ?: 'Not provided' }}
Initial payment amount
TZS {{ number_format((float) $order->initial_payment_amount) }}
Initial payment deadline
{{ $order->initial_expiry_date ?: 'Not set' }}
Completion deadline
{{ $order->full_expiry_date ?: 'Not set' }}
Order created
{{ optional($order->created_at)->format('M d, Y H:i') ?: 'Not available' }}
@else

No active order

Purchase details will appear here when an order is placed for this plot.

@endif
@if($order)

Purchase Contacts

Property beneficiary and next of kin recorded on the order.

@foreach(['beneficiary' => ['Property Beneficiary', trim($order->firstname . ' ' . $order->middlename . ' ' . $order->surname), $order->phonenumber, $order->email, $order->propertyfor, $order->id_type, $order->id_number], 'kin' => ['Next of Kin', trim($order->next_of_kin_firstname . ' ' . $order->next_of_kin_middlename . ' ' . $order->next_of_kin_surname), $order->next_of_kin_phonenumber, $order->next_of_kin_email, $order->next_of_kin_relation, $order->next_of_kin_id_type, $order->next_of_kin_id_number]] as $person)

{{ $person[0] }}

@foreach(['Name', 'Phone', 'Email', 'Relationship', 'ID type', 'ID number'] as $index => $label)
{{ $label }}
{{ $person[$index + 1] ?: 'Not provided' }}
@endforeach
@endforeach
@endif

Payment Transactions

Payments recorded against the current order.

Total: TZS {{ number_format((float) $amount_paid) }}
@forelse($transactions as $transaction) @empty@endforelse
Order / TransactionReceiptDateSource institutionAmount paid (TZS)Status
{{ $transaction->reference }}{{ $transaction->transactionId ?: 'No transaction ID' }}{{ $transaction->receipt ?: '—' }}{{ optional($transaction->created_at)->format('M d, Y H:i') ?: '—' }}{{ $transaction->sourceInstitution ?: '—' }}{{ number_format((float) $transaction->amount_paid) }}{{ $transaction->status_description ?: '—' }}

No payment transactions

Payments for this order will appear here.

@include('superadmin.property.partials.workspace_pagination', ['paginator' => $transactions, 'label' => 'transactions', 'section' => 'transactions'])

Site Visit Bookings

Confirmed and processed visits for this plot.

Total: TZS {{ number_format((float) $bookingTotal) }}
@forelse($bookings as $booking) @empty@endforelse
Booking / VisitorPhoneReceiptVisit dateLocationAmount (TZS)Status
#{{ $booking->id }}{{ trim($booking->firstname . ' ' . $booking->lastname) }}{{ $booking->phone ?: '—' }}{{ optional($booking->visitPayments->first())->receipt ?: '—' }}{{ $booking->booked_date_time ?: '—' }}{{ $booking->location ?: '—' }}{{ number_format((float) $booking->amount) }}{{ $booking->status ?: '—' }}

No site visits

Processed bookings for this plot will appear here.

@include('superadmin.property.partials.workspace_pagination', ['paginator' => $bookings, 'label' => 'bookings', 'section' => 'bookings'])
@if((int) $plot->status === 3)

Post-Purchase History

{{ number_format($statuses->total()) }} status updates recorded for this plot.

@if($canEdit) Add Status Update@endif
@forelse($statuses as $index => $status) @empty@endforelse
#StatusNotesDocumentDate
{{ $statuses->firstItem() + $index }}{{ $status->status_description }}{!! App\Support\RichTextSanitizer::clean($status->notes) ?: '—' !!}@if($status->attachment) View document@else — @endif{{ optional($status->created_at)->format('M d, Y H:i') ?: '—' }}

No status updates

Add an update to track post-purchase progress.

@include('superadmin.property.partials.workspace_pagination', ['paginator' => $statuses, 'label' => 'updates', 'section' => 'statuses'])
@endif
@endsection @push('scripts') @endpush