@extends('admin.layout') @section('title', "Intervention #{$intervention['IDINTERVENTION']}") @section('content')

Intervention #{{ $intervention['IDINTERVENTION'] }}

@include('admin.gestan._stale_banner') @if (session('success'))
{{ session('success') }}
@endif @if (session('error'))
{{ session('error') }}
@endif @if (session('warning'))
{{ session('warning') }}
@endif
{{-- ======================== --}} {{-- Informations Générales --}} {{-- ======================== --}}
Informations générales
Libellé {{ $intervention['LIBINTER'] ?? '—' }}
Description
{!! $intervention['DESCINTER'] ?? '—' !!}
Rapport
{!! $intervention['RAPINTER'] ?? '—' !!}
Date de facturation {!! $intervention['DATE_FACTURATION'] ?? '—' !!}
Statut intervention @include('admin.gestan.partials.badge-status', [ 'statut' => $intervention['ST_INTER'] ?? null, ])
Statut facturation @include('admin.gestan.partials.badge-status', [ 'statut' => $intervention['ST_FACT'] ?? null, ])
Priorité {{ $intervention['PRIORITE'] ?? '—' }}
Créée par {{ $intervention['USCRE'] ?? '—' }}
{{ $intervention['DHCRE'] ?? '' }}
{{-- ======================== --}} {{-- Client --}} {{-- ======================== --}}
Client
@if ($client)
Nom / Raison sociale {{ $client['RAISON_SOCIALE'] ?: trim(($client['NOMFAMILLE'] ?? '') . ' ' . ($client['PRENOM'] ?? '')) }}
Adresse {{ $client['ADRESSEP1'] ?? '' }}
@if (!empty($client['ADRESSEP2'])) {{ $client['ADRESSEP2'] }}
@endif {{ $client['CPOSTALP'] ?? '' }} {{ $client['VILLEP'] ?? '' }}
Téléphone {{ $client['TELP1'] ?? '—' }}
Email @if (!empty($client['EMAILP'])) {{ $client['EMAILP'] }} @else — @endif
@else
Aucun client associé dans Gestan.
@endif
Retour à la liste @if ($intervention['ST_INTER'] !== 'TERMINÉ') Créer un rapport @endif
{{-- ======================== --}} {{-- Rapports saisis (JSON) --}} {{-- ======================== --}} @if ($rapports->isNotEmpty())
Rapports saisis
@foreach ($rapports as $r) @endforeach
Auteur Durée Rapport Saisi le Sync Gestan
{{ $r->contenu['signataire'] ?? ($r->user->nom ?? '—') }} {{ $r->contenu['duree'] ?? '—' }} {!! nl2br(e($r->contenu['rapport'] ?? '')) !!} {{ $r->created_at->format('d/m/Y H:i') }} @php $st = $r->sync_status ?? 'synced'; @endphp @if ($st === 'synced') Synchronisé @elseif ($st === 'pending') En attente… @else À renvoyer @endif @if ($st !== 'synced' && $r->user_id === auth()->id())
@csrf
@endif
@if ($r->user_id === auth()->id() && $intervention['ST_INTER'] !== 'TERMINÉ') @endif
@endif {{-- ======================== --}} {{-- Historique complet --}} {{-- ======================== --}}
Historique des interventions précédentes
@if (!empty($intervention['historique'])) @foreach ($intervention['historique'] as $h)
Intervention #{{ $h['IDINTERVENTION'] }} Voir
Libellé {{ $h['LIBINTER'] ?? '—' }}
Description
{!! $h['DESCINTER'] ?? '—' !!}
Créée par {{ $h['USCRE'] ?? '—' }}
{{ $h['DHCRE'] ?? '' }}
Statut intervention {{ $h['ST_INTER'] ?? '—' }}
Statut facturation @if (empty($h['ST_FACT'])) Non facturé @else {{ $h['ST_FACT'] }} @endif
Priorité {{ $h['PRIORITE'] ?? '—' }}
@endforeach @else

Aucune intervention précédente pour ce client.

@endif
@endsection