@extends('mainlayout.layout') @section('title', config('app.name') . ' | Order Details') @push('css') @endpush @section('content') @php $projectId = encrypt($property->id); $plotId = encrypt($plot->id); $statusTone = [0 => 'pw-neutral', 1 => 'pw-warning', 2 => 'pw-success', 3 => 'pw-danger', 4 => 'pw-danger'][(int) $order->status] ?? 'pw-neutral'; $ownerPayment = optional($order->ownerDisbursementOrder)->disbursement; $canEditProject = Auth::user()->hasRole('superadmin') || Auth::user()->can('property.edit'); @endphp
All ordersOrder management

Order #{{ $order->id }}

{{ $order->status_description ?: 'Status not provided' }}

Plot {{ $plot->plotnumber }} · {{ $property->name }} · Reference {{ $order->referenceid ?: 'not provided' }}

@include('superadmin.property.partials.workspace_feedback')
Order Value{{ number_format((float) $order->amount) }}TZS
Amount Paid{{ number_format((float) $amount_paid) }}TZS · all payments
Latest Payment Balance{{ $last_transition ? number_format((float) $balance) : '—' }}{{ $last_transition ? 'TZS' : 'No payment recorded' }}
Payment Completion{{ number_format($completion, 1) }}%Of the order value

Purchase Details

Customer, payment plan and deadlines.

Order reference
{{ $order->referenceid ?: 'Not provided' }}
Payment plan
{{ $order->order_type ?: 'Not provided' }}
Customer
@if($order->user){{ trim($order->user->first_name . ' ' . $order->user->last_name) }}@else Not available @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' }}
Payment progress
{{ number_format($completion, 1) }}% paid
Owner disbursement
@if($order->ownerDisbursementOrder)Paid to owner@if($ownerPayment && (Auth::user()->hasRole('superadmin') || (int) Auth::user()->propertyownerid === (int) $ownerPayment->property_owner_id))
View disbursement {{ $ownerPayment->transfer_reference }}@endif @elseif((int) $order->status === 2)Awaiting disbursement @else Not yet completed @endif

Purchase Contacts

Beneficiary and next of kin recorded with the purchase.

@foreach([['Property Beneficiary', trim($order->firstname . ' ' . $order->middlename . ' ' . $order->surname), $order->phonenumber, $order->email, $order->propertyfor, $order->id_type, $order->id_number], ['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

Payment Transactions

Payments recorded against this order reference.

Total: TZS {{ number_format((float) $amount_paid) }}
@forelse($transactions as $index => $transaction)@empty@endforelse
#Reference / TransactionReceiptDateSourceAmount paid (TZS)Status
{{ $transactions->firstItem() + $index }}{{ $transaction->reference }}{{ $transaction->transactionId ?: $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 ?: 'Not provided' }}

No payment transactions

Payments for this order will appear here.

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