Repairs

Add repair
{{-- Status Filter Tabs --}} @php $statuses = [ '' => ['label' => 'All', 'color' => 'gray'], '0' => ['label' => 'Pending', 'color' => 'yellow'], '1' => ['label' => 'Repairing', 'color' => 'blue'], '2' => ['label' => 'Ready', 'color' => 'green'], '3' => ['label' => 'Completed', 'color' => 'gray'], '4' => ['label' => 'Returned', 'color' => 'red'], ]; $totalCount = array_sum($statusCounts ?? []); @endphp
@foreach($statuses as $key => $info) @php $count = $key === '' ? $totalCount : ($statusCounts[$key] ?? 0); $isActive = (string)($status ?? '') === (string)$key; @endphp {{ $info['label'] }} {{ $count }} @endforeach
@forelse($repairs as $repair) @php $statusOptions = [ 0 => ['label' => 'Pending', 'class' => 'bg-yellow-100 text-yellow-800 border-yellow-300'], 1 => ['label' => 'Repairing', 'class' => 'bg-blue-100 text-blue-800 border-blue-300'], 2 => ['label' => 'Ready', 'class' => 'bg-green-100 text-green-800 border-green-300'], 3 => ['label' => 'Completed', 'class' => 'bg-gray-200 text-gray-800 border-gray-400'], 4 => ['label' => 'Returned', 'class' => 'bg-red-100 text-red-800 border-red-300'], ]; $paid = $repair->payments->sum('amount'); $balance = ($repair->amount ?? 0) - $paid; @endphp @empty @endforelse
Customer Item Issue Status Amount Balance Actions
{{ $repair->name }}
{{ $repair->contact }}
{{ $repair->brand }} {{ $repair->model }}
@if($repair->serial)
SN: {{ $repair->serial }}
@endif
{{ Str::limit($repair->problem_description, 30) }} {{ number_format($repair->amount ?? 0, 2) }} {{ number_format($balance, 2) }}
@if($balance > 0) @endif ✏️
@csrf @method('DELETE')
No repairs found.
{{ $repairs->links() }}
{{-- Hidden iframe for inline printing --}} {{-- Quick Payment Modal --}}