@extends('layouts.exat') @section('title', 'Import des prêts — Aperçu') @section('subtitle', 'Lecture du référentiel externe (aucune écriture)') @section('content') @if(session('error'))
{{ session('error') }}
@endif @if($erreur)
{{ $erreur }}
@else
{{-- Statistiques --}}
Prêts (filtrés)
{{ $stats['nb'] }}
À importer / Importés / À arbitrer
{{ $stats['nouveaux'] }} / {{ $stats['deja'] }} / {{ $stats['arbitrer'] }}
Total prêts
{{ number_format($stats['total_pret'], 0, ',', ' ') }} FCFA
Total remboursé
{{ number_format($stats['total_remb'], 0, ',', ' ') }} FCFA
{{-- Filtres + outils --}} {{-- Filtres --}}
Réinitialiser
{{-- Outils d'import --}}
{{-- Tableau (dans le formulaire d'import) --}}
@csrf
@include('partials.th-tri', ['col' => 'numero', 'label' => 'N° Prêt']) @include('partials.th-tri', ['col' => 'date', 'label' => 'Date du prêt']) @include('partials.th-tri', ['col' => 'planteur', 'label' => 'Planteur']) @include('partials.th-tri', ['col' => 'mois', 'label' => 'Mois', 'align' => 'center']) @include('partials.th-tri', ['col' => 'montant', 'label' => 'Montant prêt', 'align' => 'right']) @include('partials.th-tri', ['col' => 'nb_remb', 'label' => 'Nb remb.', 'align' => 'center']) @include('partials.th-tri', ['col' => 'rembourse', 'label' => 'Remboursé', 'align' => 'right']) @include('partials.th-tri', ['col' => 'solde', 'label' => 'Solde', 'align' => 'right']) @include('partials.th-tri', ['col' => 'statut', 'label' => 'Statut']) @include('partials.th-tri', ['col' => 'etat', 'label' => 'Correspondance / Action']) @forelse($page as $l) @empty @endforelse
@if($l['etat'] === 'arbitrer') @else @endif
{{ $l['numero_pret'] }}
{{ $l['date_debut'] ? \Illuminate\Support\Carbon::parse($l['date_debut'])->format('d/m/Y') : '—' }}
{{ $l['nom'] ?: '—' }}
{{ $l['code'] }}
{{ $l['nb_mois'] }} {{ number_format($l['montant'], 0, ',', ' ') }} {{ $l['nb_remb'] }} {{ number_format($l['somme_remb'], 0, ',', ' ') }} {{ number_format($l['solde'], 0, ',', ' ') }} @if($l['statut'] === 'SOLDEE') Soldée @else En remboursement @endif @if($l['etat'] === 'importe') Importé @elseif($l['etat'] === 'arbitrer') À arbitrer
Corresp. : {{ collect($l['candidats'])->pluck('reference')->join(', ') }}
@else Nouveau @endif
Aucun prêt ne correspond aux filtres.
@if($page && $page->total() > 0)
@include('partials.pagination', ['paginator' => $page])
@endif

Un solde négatif signale une incohérence (remboursements > montant du prêt) à vérifier avant import. « Tout sélectionner » ne coche que la page courante. Les lignes À arbitrer (un prêt qui ressemble à une demande interne non soldée : même planteur, montant et durée) demandent un choix explicite — Rattacher ou Créer ; sans choix, la ligne est ignorée.

@endif {{-- Pop-up détail du prêt --}} @endsection