@extends('layouts/layoutMaster') @title('Maintenance Ticket Details') @section('content')

Maintenance / Ticket #{{ $maintenance->id }}

Back to List
@if(session('success')) @endif
{{ $maintenance->title }}
Logged by {{ $maintenance->tenant->name }} on {{ $maintenance->created_at->format('M d, Y \a\t g:i A') }}
@if($maintenance->status === 'pending') Pending Review @elseif($maintenance->status === 'assigned') Assigned @else Resolved @endif
Property {{ $maintenance->property->name }}
Unit / Room No Unit {{ $maintenance->unit->unit_number }}
Category {{ $maintenance->category }}
Contact Phone {{ $maintenance->tenant->phone_number ?? 'Not Available' }}
Description of the Issue
{{ $maintenance->description }}
@if($maintenance->photo_path)
Uploaded Attachment
Issue attachment
@endif
Assigned Provider
@if($maintenance->provider)
{{ $maintenance->provider->name }} Service Representative

{{ $maintenance->provider->email }}

@if($maintenance->provider->phone_number)

{{ $maintenance->provider->phone_number }}

@endif @else

Unassigned Ticket

No maintenance service provider has been assigned to this ticket yet.

@endif
@if(in_array(auth()->user()->role, ['admin', 'owner', 'manager']) && $maintenance->status !== 'resolved')
Assign Service Provider
@csrf
@endif @if($maintenance->status !== 'pending')
Contractor Quotation
@if($maintenance->quote_status === 'approved') Approved @elseif($maintenance->quote_status === 'quoted') Pending Review @elseif($maintenance->quote_status === 'rejected') Rejected @else No Quote @endif
@if($maintenance->estimated_cost > 0)
ESTIMATED REPAIR COST: Ksh {{ number_format($maintenance->estimated_cost, 2) }} @if($maintenance->quote_notes)
{{ $maintenance->quote_notes }}
@endif
@endif @if($maintenance->quote_status === 'quoted' && in_array(auth()->user()->role, ['admin', 'owner', 'manager']))
@csrf
@csrf
@endif @if($maintenance->status !== 'resolved' && (auth()->user()->role === 'admin' || (auth()->user()->role === 'provider' && $maintenance->provider_id === auth()->id())) && $maintenance->quote_status !== 'approved')
@csrf
@endif
@endif @if($maintenance->status !== 'resolved' && (auth()->user()->role === 'admin' || (auth()->user()->role === 'provider' && $maintenance->provider_id === auth()->id()) || (in_array(auth()->user()->role, ['owner', 'manager']) && $maintenance->status === 'assigned')))
Complete & Resolve Job

Confirm final repair cost. An expense record will automatically be posted to the property remittance ledger.

@csrf
@endif @if($maintenance->status === 'resolved')
Job Completed & Resolved
@if($maintenance->actual_cost > 0) TOTAL REPAIR EXPENSE:

Ksh {{ number_format($maintenance->actual_cost, 2) }}

Auto-booked to Property Expense Ledger for landlord monthly remittance deduction.
@endif
Tenant Quality Review
@if($maintenance->tenant_rating)
@for($i = 1; $i <= 5; $i++) {!! $i <= $maintenance->tenant_rating ? '★' : '☆' !!} @endfor {{ $maintenance->tenant_rating }} / 5 Stars
@if($maintenance->tenant_feedback)
{{ $maintenance->tenant_feedback }}
@endif @elseif(auth()->user()->role === 'tenant' && $maintenance->tenant_id === auth()->id())
@csrf
@else

Tenant satisfaction review pending.

@endif
@endif
@endsection