@php $d = $demande ?? null; $selP = $d ? $planteurs->firstWhere('id', $d->planteur_id) : null; $planteursData = $planteurs->mapWithKeys(fn ($p) => [$p->id => [ 'nom' => $p->nom, 'code' => $p->code, 'cni' => $p->numero_cni, 'naissance' => optional($p->date_naissance)->format('Y-m-d'), 'lieu' => $p->lieu_naissance, 'localite' => $p->localite, 'plantation' => $p->localisation_plantation, 'superficie' => $p->superficie_saignee_ha, 'tel_p' => $p->telephone_principal ?? $p->telephone, 'tel_s' => $p->telephone_secondaire, ]]); $pontsDispo = \App\Models\PontBascule::where('actif', true)->orderBy('nom')->get(); $pontsSel = old('pont_ids', $d?->pontsBascules->pluck('id')->all() ?? []); $perso = (bool) old('remboursement_personnalise', $d?->remboursement_personnalise ?? false); $echInit = old('echeancier', $d?->echeancier_json ?? []); @endphp
{{-- Section 1 : identification --}}

Identification du planteur

{{-- Recherche planteur (combobox) --}}
{{-- Identité éditable --}}

Pré-remplie depuis la fiche planteur ; vos modifications mettent à jour cette fiche.

{{-- Section 2 : détails --}}

Détails de l'avance

@foreach(['ÉQUIPEMENT','TRICYCLE','MOTO','SCOLARITÉ','SANTÉ','COMMERCE','ÉLEVAGE','CONSTRUCTION DE MAISON','BESOIN PERSONNEL'] as $o)
{{-- Remboursable / mois (mode automatique) --}}
Montant remboursable / mois (montant ÷ durée)
{{-- Pont bascule rattaché --}}
@include('partials._ponts-multi', ['pontsDispo' => $pontsDispo, 'pontsSel' => $pontsSel])
{{-- Personnalisation du remboursement --}}
Échéancier personnalisé Total : 0 / 0 FCFA
Date d'échéance Montant (FCFA)
@push('scripts') @endpush