@extends('layouts.app') @section('content') @php $format = fn ($value) => ($stamp = \App\Support\ServerTime::stamp($value)) !== '' ? $stamp : '—'; @endphp

{{ $service->number }}

@can('services.update') {{ __('common.edit') }} @endcan {{ __('services.service_form') }} {{ __('services.materials_form') }} {{ $service->status?->label() }}

{{ $service->title }}

{{ $service->description }}

{{ __('services.customer') }}: {{ $service->mainCustomer?->name }}
{{ __('services.branch') }}: {{ $service->subCustomer?->name ?: __('services.no_branch') }}
@php $branchAddress = trim(implode(' ', array_filter([ $service->subCustomer?->address, $service->subCustomer?->district, $service->subCustomer?->city, ]))); $directions = $service->subCustomer?->directionsUrl(); @endphp
{{ __('common.address') }}: {{ $branchAddress !== '' ? $branchAddress : '—' }} @if ($directions)
{{ __('maps.actions.navigate') }}
@endif
{{ __('services.opened_by') }}: {{ $service->creator?->name ?: '—' }}
{{ __('services.created_at') }}: {{ $format($service->created_at) }}
{{ __('services.updated_by') }}: {{ $service->editor?->name ?: '—' }}
{{ __('services.updated_at') }}: {{ $service->editor ? $format($service->updated_at) : '—' }}
{{ __('services.deleted_by') }}: {{ $service->deleter?->name ?: '—' }}
{{ __('services.deleted_at') }}: {{ $service->deleted_at ? $format($service->deleted_at) : '—' }}
{{ __('services.type') }}: {{ $service->type?->label() }}@if($service->type) · {{ $service->type->intervention_minutes }} {{ __('services.minutes_short') }}@endif
{{ __('services.category') }}: {{ $service->category?->label() }}
{{ __('services.severity') }}: {{ $service->severity?->label() }}
@if ($service->customer_notes)

{{ __('services.customer_notes') }}: {{ $service->customer_notes }}

@endif @if ($service->internal_notes)

{{ __('services.internal_notes') }}: {{ $service->internal_notes }}

@endif

{{ __('services.history') }}

@foreach ($service->histories as $history) @endforeach
{{ __('common.date') }} {{ __('common.status') }} {{ __('common.description') }}
{{ $format($history->changed_at) }} {{ $history->fromStatus?->label() }} → {{ $history->toStatus?->label() }} {{ $history->description }}

{{ __('services.sla') }}

{{ __('services.response_due') }}: {{ $format($service->response_due_at) }}

{{ __('services.intervention_due') }}: {{ $format($service->intervention_due_at) }} {{ $service->interventionRemaining() }}

{{ __('services.resolution_due') }}: {{ $format($service->resolution_due_at) }}

@can('services.status')

{{ __('services.change_status') }}

@csrf
@if ($service->assignments->isEmpty())
{{ __('services.assign_first') }}
@endif
{{ __('common.save') }}
@endcan @can('services.assign')

{{ __('services.assign') }}

@csrf
{{ __('services.assign') }}
    @foreach ($service->assignments as $assignment)
  • {{ $assignment->user?->name }} — {{ $format($assignment->assigned_at) }}
  • @endforeach
@endcan

{{ __('services.gallery') }}

@can('attachments.manage')
@csrf
{{ __('services.upload') }}
@endcan
@forelse ($service->attachments as $attachment)
@if ($attachment->isImage()) {{ $attachment->original_name }} @else {{ $attachment->original_name }} @endif
{{ __('services.categories.'.$attachment->category) }}
@empty

{{ __('services.files') }}

@endforelse

{{ __('services.materials') }}

@canany(['forms.manage', 'stock.move'])
@csrf

{{ __('services.warehouse_empty') }}

{{ __('services.add_line') }} {{ __('common.save') }}
@endcanany
    @forelse ($service->materials as $material)
  • {{ $material->product?->name }} — {{ $material->quantity }} × {{ number_format((float) $material->unit_price, 2, ',', '.') }} {{ $material->currency }} = {{ number_format((float) $material->quantity * (float) $material->unit_price, 2, ',', '.') }} {{ $material->currency }} @if ($material->warehouse) · {{ $material->warehouse->name }} @endif @if ($material->serial_number) · {{ $material->serial_number }} @endif @if ($material->reversed_at) {{ __('services.reversed') }} @endif @if (! $material->reversed_at) @canany(['forms.manage', 'stock.move'])
    @csrf {{ __('services.reverse') }}
    @endcanany @endif
  • @empty
  • {{ __('services.materials') }}
  • @endforelse

{{ __('services.forms') }}

@can('forms.manage')
@csrf
@foreach (['symptoms', 'source', 'findings', 'action', 'result', 'work', 'resolution', 'technician_notes', 'customer_confirmation', 'approval', 'notes'] as $field)
@endforeach
{{ __('common.save') }}
@endcan
@can('services.delete')
@csrf @method('DELETE') {{ __('common.delete') }}
@endcan @endsection @push('scripts') @endpush