Lien comptes courants / enveloppes

This commit is contained in:
ocroguennec committed 2026-09-28 10:02:22 +02:00
1 parent f507163369
commit 9591ae400e
13 files changed
+202 -79

No files matched your search

+1 -1
View File
@@ -727,7 +727,7 @@ export default function Remboursements() {
if (next.methode_remboursement === 'compte_courant') {
// Priorité : compte lié à l'investissement, sinon premier compte_courant
const inherited = inv.compte_id ? comptes.find(c => c.id === inv.compte_id) : null;
const def = inherited ?? comptes.find(c => c.type === 'compte_courant') ?? comptes[0];
const def = inherited ?? comptes.find(c => c.compte_reglement_par_defaut) ?? comptes[0];
if (def) setForm(f => ({ ...f, compte_id: String(def.id) }));
}
})