diff --git a/backend/src/routes/plateformes.js b/backend/src/routes/plateformes.js
index 018b80d..c79699b 100644
--- a/backend/src/routes/plateformes.js
+++ b/backend/src/routes/plateformes.js
@@ -219,7 +219,7 @@ function syncCategories(platId, catIds) {
router.get('/referentiel-list', (_req, res) => {
const rows = db.prepare(`
SELECT pr.id, pr.nom, pr.domiciliation, pr.fiscalite,
- pr.taux_fiscalite_locale, pr.type_produit_fiscal, pr.logo_filename
+ pr.taux_fiscalite_locale, pr.type_produit_fiscal, pr.logo_filename, pr.icone_filename
FROM plateformes_referentiel pr
ORDER BY pr.nom
`).all();
@@ -262,13 +262,15 @@ router.post('/', (req, res, next) => {
let taux = fiscalite === 'avec_fiscalite_locale' ? (body.taux_fiscalite_locale ?? null) : null;
let typeProduitFiscal = body.domiciliation === 'FR' ? (body.type_produit_fiscal ?? '2TT') : '2TT';
let referentielId = body.referentiel_id ?? null;
+ let logoFilename = null;
+ let iconeFilename = null;
- // Si un référentiel est sélectionné, hériter ses valeurs (pas encore d'overrides)
+ // Si un référentiel est sélectionné, hériter logo et icone
if (referentielId) {
const ref = db.prepare('SELECT * FROM plateformes_referentiel WHERE id = ?').get(referentielId);
if (!ref) throw new HttpError(404, 'Référentiel introuvable');
- // Les champs du body priment (l'user peut déjà avoir modifié à la création)
- // On calcule les overrides par rapport au référentiel
+ logoFilename = ref.logo_filename ?? null;
+ iconeFilename = ref.icone_filename ?? null;
}
const r = db.prepare(`
@@ -276,6 +278,7 @@ router.post('/', (req, res, next) => {
(user_id, nom, url, notes, domiciliation, fiscalite, taux_fiscalite_locale, type_produit_fiscal,
methode_remboursement, investisseur_id, date_ouverture,
type_pret_defaut, freq_interets_defaut,
+ logo_filename, icone_filename,
referentiel_id, overridden_fields)
VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
`).run(
@@ -283,8 +286,9 @@ router.post('/', (req, res, next) => {
body.domiciliation, fiscalite, taux, typeProduitFiscal,
body.methode_remboursement, body.investisseur_id ?? null, body.date_ouverture || null,
body.type_pret_defaut ?? null, body.freq_interets_defaut ?? null,
+ logoFilename, iconeFilename,
referentielId,
- '[]' // toujours vide à la création — les overrides se calculent au premier PUT
+ '[]'
);
const id = r.lastInsertRowid;
syncCategories(id, body.categories);
diff --git a/frontend/src/pages/settings/PlateformesSection.jsx b/frontend/src/pages/settings/PlateformesSection.jsx
index 7f950c2..a811f71 100644
--- a/frontend/src/pages/settings/PlateformesSection.jsx
+++ b/frontend/src/pages/settings/PlateformesSection.jsx
@@ -273,6 +273,361 @@ function PlatDetailPanel({ plat, onEdit }) {
/* ── Panneau de détail PFU ───────────────────────────────────── */
+
+
+/* ── Picker référentiel ──────────────────────────────────────── */
+function PlatPickerModal({ open, onClose, referentiel, onSelect, onManual, err }) {
+ const [search, setSearch] = useState('');
+ const [domFilter, setDomFilter] = useState('all'); // 'all' | 'fr' | 'etr'
+ if (!open) return null;
+
+ const q = search.trim().toLowerCase();
+ const filtered = referentiel.filter(r => {
+ if (domFilter === 'fr' && r.domiciliation !== 'FR') return false;
+ if (domFilter === 'etr' && r.domiciliation === 'FR') return false;
+ if (q && !r.nom.toLowerCase().includes(q)) return false;
+ return true;
+ });
+
+ const imgFor = (r) => {
+ const f = r.icone_filename || r.logo_filename;
+ return f ? (LOGO_BASE + f) : null;
+ };
+
+ return (
+
+
+
+
+ }
+ >
+
+ {err &&
{err}
}
+
+ Sélectionnez une plateforme depuis le référentiel pour l'ajouter à votre portefeuille.
+ Les informations (domiciliation, fiscalité…) seront pré-remplies automatiquement.
+