{{-- v4.28.0 §B2 — Section « Factures ↔ opérations » de la page de contrôle. Une carte par contrôle : vert « aucun », orange « à vérifier », rouge « bloquant ». Dépliable. Lecture seule, sauf « Relier » (contrôle 3, paire sûre, confirmation + audit). --}} @php $page = $getLivewire(); $controles = $page->controleFactures; $total = array_sum(array_column($controles, 'nombre')); $peutRelier = (auth()->user()?->can('settings.manage') ?? false) && (auth()->user()?->can('invoices.update') ?? false); @endphp

Factures ↔ opérations

{{ $total === 0 ? 'Aucune incohérence.' : $total.' cas au total' }} — lecture seule : rien n'est corrigé d'office.

@foreach ($controles as $c) @php $couleur = match (true) { $c['nombre'] === 0 => 'success', $c['gravite_constatee'] === \App\Services\Controles\ControleFacturesOperations::BLOQUANT => 'danger', default => 'warning', }; $pastille = match ($couleur) { 'success' => 'bg-success-50 text-success-700 ring-success-600/20 dark:bg-success-400/10 dark:text-success-400', 'danger' => 'bg-danger-50 text-danger-700 ring-danger-600/20 dark:bg-danger-400/10 dark:text-danger-400', default => 'bg-warning-50 text-warning-700 ring-warning-600/20 dark:bg-warning-400/10 dark:text-warning-400', }; $bord = match ($couleur) { 'success' => 'border-l-success-500', 'danger' => 'border-l-danger-500', default => 'border-l-warning-500', }; @endphp
{{ $c['code'] }}. {{ $c['intitule'] }} @if ($c['nombre'] === 0) aucun @else {{ $c['nombre'] }} · {{ $couleur === 'danger' ? 'bloquant' : 'à vérifier' }} @endif

{{ $c['pourquoi'] }}

@if ($c['nombre'] > 0)
    @foreach ($c['lignes'] as $l)
  • @if ($l['facture']) Facture {{ $l['facture'] }} @endif @if ($l['client']) · {{ $l['client'] }} @endif @if ($l['operation_id']) · opération n°{{ $l['operation_id'] }} @endif @if ($l['marche']) · {{ $l['marche'] }} @endif

    {{ $l['detail'] }}

    @if ($l['montant_facture'] !== null || $l['montant_operation'] !== null)

    @if ($l['montant_facture'] !== null) Net facture {{ \App\Support\Money::format($l['montant_facture']) }} @endif @if ($l['montant_operation'] !== null) · Opération {{ \App\Support\Money::format($l['montant_operation']) }} @endif

    @endif
    @if ($l['lien_facture']) Ouvrir la facture @endif @if ($l['lien_operation']) Ouvrir l'opération @endif @if ($l['reliable'] && $peutRelier) Relier @endif
  • @endforeach

Que faire : {{ $c['action'] }}

@endif @foreach ($c['informations'] ?? [] as $info)

ℹ︎ {{ $info }}

@endforeach
@endforeach