@extends('layouts.app') @section('title', 'Repairs') @section('breadcrumb') @endsection @section('content') {{-- Status Stats --}}
@php $statColors = ['pending'=>['#fef3c7','#d97706'],'diagnosing'=>['#ede9fe','#7c3aed'],'in_progress'=>['#dbeafe','#1d4ed8'],'completed'=>['#d1fae5','#059669'],'delivered'=>['#f0fdf4','#16a34a'],'cancelled'=>['#f1f5f9','#64748b']]; @endphp @foreach(App\Models\RepairTicket::STATUSES as $key => $label)
{{ $statusCounts[$key] ?? 0 }}
{{ $label }}
@endforeach
@if($overdueCount > 0)
{{ $overdueCount }} ticket(s) are past their expected delivery date. View overdue →
@endif
Repair Tickets ({{ $tickets->total() }})
@forelse($tickets as $ticket) @php $isOverdue = $ticket->expected_delivery && $ticket->expected_delivery < today() && !in_array($ticket->status, ['delivered','cancelled']); @endphp @empty @endforelse
Ticket # Customer Device Problem Technician Received Expected Cost Status Actions
{{ $ticket->ticket_no }}
{{ $ticket->customer->name }}
{{ $ticket->customer->phone }}
{{ $ticket->device_name }}
@if($ticket->device_model)
{{ $ticket->device_model }}
@endif @if($ticket->serial_no){{ $ticket->serial_no }}@endif
{{ Str::limit($ticket->problem_description, 60) }}
{{ $ticket->technician?->name ?? '—' }} {{ $ticket->received_date->format('d M Y') }} {{ $ticket->expected_delivery?->format('d M Y') ?? '—' }} @if($isOverdue)
OVERDUE
@endif
@if($ticket->actual_cost > 0) ৳{{ number_format($ticket->actual_cost, 0) }} @elseif($ticket->estimated_cost > 0) ~৳{{ number_format($ticket->estimated_cost, 0) }} @else @endif @php $rc=['pending'=>'warning','diagnosing'=>'info','in_progress'=>'primary','completed'=>'success','delivered'=>'success','cancelled'=>'secondary']; @endphp {{ $ticket->status_name }}
@can_permission('repair.edit') @endcan_permission
No repair tickets found. Create your first ticket.
@if($tickets->hasPages())@endif
@endsection