{{-- Job details: customer, device, problem, accessories, lock, advance, delivery. Needs $job with customer, device and payments loaded. --}} @php use App\Support\JobIntakeOptions; $advance = $job->payments->firstWhere('type', \App\Enums\PaymentType::Advance); @endphp
Customer
@can('view', $job->customer) {{ $job->customer->name }} @else {{ $job->customer->name }} @endcan
{{ $job->customer->phone_display }}
Device
{{ $job->device->display_name }}
{{ collect([$job->device->deviceType->name, $job->device->color, $job->device->storage])->filter()->join(' · ') }}
@if ($job->device->serial_number)
{{ $job->device->deviceType->name === 'Phone' ? 'IMEI' : 'Serial' }}: {{ $job->device->serial_number }}
@endif
Problem
@foreach (JobIntakeOptions::labels(JobIntakeOptions::PROBLEMS, $job->problems) as $label) {{ $label }} @endforeach @if ($job->problem_reported)

{{ $job->problem_reported }}

@endif
Condition when received
@forelse (JobIntakeOptions::labels(JobIntakeOptions::CONDITIONS, $job->condition_checks) as $label) {{ $label }} @empty @unless ($job->device_condition) No marks noted @endunless @endforelse @if ($job->device_condition)

{{ $job->device_condition }}

@endif
Accessories received
{{ collect(JobIntakeOptions::labels(JobIntakeOptions::ACCESSORIES, $job->accessories))->push($job->accessories_other)->filter()->join(', ') ?: 'None' }}
Screen lock
@if (! $job->passcode_type) None @elseif (auth()->user()->can('viewPasscode', $job)) {{-- Never printed in the page: fetched (and logged) only when "Show" is pressed. --}} @include('jobs.partials.passcode-reveal') @else {{ $job->passcode_type->label() }} saved (hidden) @endif
{{-- Billing (payments, receipts, invoices): admin and front desk only, never technicians. --}} @can('view-billing')
Advance paid
@if ($advance) Rs. {{ number_format($advance->amount, 2) }} ({{ $advance->method->label() }}) · Receipt {{ $advance->receipt_no }} @else None @endif
@endcan
Expected delivery
{{ $job->promised_on?->format('D, d M Y') ?? 'Not set' }} @if ($job->priority === \App\Enums\JobPriority::Urgent) Urgent @endif
@if ($job->estimated_cost && auth()->user()->can('view-prices'))
Estimate: Rs. {{ number_format($job->estimated_cost, 2) }}
@endif