@extends('layouts.exat') @section('title', 'Remboursements') @section('subtitle', 'Suivi des avances décaissées') @section('content')
Total à rembourser
{{ number_format($stats['total_a_rembourser'], 0, ',', ' ') }}FCFA
Encours
{{ number_format($stats['encours'], 0, ',', ' ') }}FCFA
Total remboursé
{{ number_format($stats['rembourse'], 0, ',', ' ') }}FCFA
En retard
{{ $stats['en_retard'] }}
Soldées
{{ $stats['soldees'] }}
@if(auth()->user()->hasRole(['SUPERADMIN','ADMIN']))
@csrf
@endif
@include('partials._filtre-date')
@if(request()->hasAny(['periode', 'date', 'date_debut', 'date_fin', 'semaine', 'mois', 'annee'])) Réinitialiser @endif
@include('partials.th-tri', ['col' => 'reference', 'label' => 'Réf. Int / Ext']) @include('partials.th-tri', ['col' => 'planteur', 'label' => 'Planteur']) @include('partials.th-tri', ['col' => 'montant', 'label' => 'Montant', 'align' => 'right']) @include('partials.th-tri', ['col' => 'mois', 'label' => 'Mois', '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' => 'decaissement', 'label' => 'Décaissement']) @include('partials.th-tri', ['col' => 'dernier', 'label' => 'Dernier remb.']) @include('partials.th-tri', ['col' => 'avancement', 'label' => 'Avancement']) @include('partials.th-tri', ['col' => 'statut', 'label' => 'Statut']) @forelse($demandes as $d) @php $montant = (float) $d->montant; $rembourse = (float) ($sommes[$d->id] ?? 0); $solde = max(0, $montant - $rembourse); $pct = $montant > 0 ? min(100, round($rembourse / $montant * 100)) : 0; @endphp @empty @endforelse
{{ $d->reference }}
@if($d->numero_pret)
{{ $d->numero_pret }}
@endif
{{ $d->planteur->nom ?? '—' }}
{{ $d->planteur->code ?? '' }}
{{ number_format($montant, 0, ',', ' ') }} {{ $d->duree_mois ?? '—' }} {{ number_format($rembourse, 0, ',', ' ') }} {{ number_format($solde, 0, ',', ' ') }} {{ $d->date_octroi ? \Illuminate\Support\Carbon::parse($d->date_octroi)->format('d/m/Y') : '—' }} {{ ($derniersRemb[$d->id] ?? null) ? \Illuminate\Support\Carbon::parse($derniersRemb[$d->id])->format('d/m/Y') : '—' }}
{{ $pct }}%
Détail
Aucune avance décaissée. Décaissez une demande validée depuis sa fiche.
@if($demandes->total() > 0)
@include('partials.pagination', ['paginator' => $demandes])
@endif
@endsection