Bug
This commit is contained in:
1 parent
0df335803e
commit
c2dbe506c5
3 files changed
+15
-4
No files matched your search
@@ -19,7 +19,14 @@ import { fmtEUR } from '../utils/format.js';
|
||||
* onChange : (value) => void
|
||||
* options : investissementOptions — { id, plateforme_nom, nom_projet, montant_investi }[]
|
||||
*/
|
||||
export default function InvestissementSelect({ value, onChange, options = [] }) {
|
||||
export default function InvestissementSelect({
|
||||
value, onChange, options = [],
|
||||
// Libellé du sentinel INTERETS_PLATEFORME (17/09/26, cf. RemboursementsSimple.jsx —
|
||||
// une distribution PE n'est pas un "intérêt" au sens crowdlending du terme ; la valeur
|
||||
// technique INTERETS_PLATEFORME/interets_plateforme reste inchangée, seul l'intitulé
|
||||
// affiché change). Par défaut, le libellé crowdlending d'origine.
|
||||
interetsPlateformeLabel = '🏦 Intérêts plateforme',
|
||||
}) {
|
||||
const [open, setOpen] = useState(false);
|
||||
const [dropPos, setDropPos] = useState({ left: 0, width: 0, maxHeight: 260, direction: 'down', top: 0, bottom: 0 });
|
||||
|
||||
@@ -29,7 +36,7 @@ export default function InvestissementSelect({ value, onChange, options = [] })
|
||||
const selectedOption = options.find(i => String(i.id) === String(value));
|
||||
const label = value === 'BONUS_PARRAINAGE' ? '🎁 Bonus Parrainage'
|
||||
: value === 'BONUS_PLATEFORME' ? '🏆 Bonus Plateforme'
|
||||
: value === 'INTERETS_PLATEFORME' ? '🏦 Intérêts plateforme'
|
||||
: value === 'INTERETS_PLATEFORME' ? interetsPlateformeLabel
|
||||
: selectedOption ? `${selectedOption.plateforme_nom} — ${selectedOption.nom_projet} (${fmtEUR(selectedOption.montant_investi)})`
|
||||
: null;
|
||||
|
||||
@@ -124,7 +131,7 @@ export default function InvestissementSelect({ value, onChange, options = [] })
|
||||
<button type="button" style={rowStyle(value === '')} onClick={() => select('')}>—</button>
|
||||
<button type="button" style={rowStyle(value === 'BONUS_PARRAINAGE')} onClick={() => select('BONUS_PARRAINAGE')}>🎁 Bonus Parrainage</button>
|
||||
<button type="button" style={rowStyle(value === 'BONUS_PLATEFORME')} onClick={() => select('BONUS_PLATEFORME')}>🏆 Bonus Plateforme</button>
|
||||
<button type="button" style={rowStyle(value === 'INTERETS_PLATEFORME')} onClick={() => select('INTERETS_PLATEFORME')}>🏦 Intérêts plateforme</button>
|
||||
<button type="button" style={rowStyle(value === 'INTERETS_PLATEFORME')} onClick={() => select('INTERETS_PLATEFORME')}>{interetsPlateformeLabel}</button>
|
||||
<div className="cat-select-sep" />
|
||||
{options.map(i => (
|
||||
<button key={i.id} type="button" style={rowStyle(String(value) === String(i.id))} onClick={() => select(String(i.id))}>
|
||||
|
||||
@@ -85,6 +85,7 @@ export default function RembFormModal({
|
||||
// crowdlending-only qu'un deal PE n'a aucune raison d'avoir renseigné — sans ce
|
||||
// forçage, le champ "Frais TTC" disparaissait pour toute nouvelle distribution PE).
|
||||
forceShowFrais = false,
|
||||
interetsPlateformeLabel = '🏦 Intérêts plateforme',
|
||||
}) {
|
||||
const isBonus = !locked && BONUS_VALUES.includes(form.investissement_id);
|
||||
const isInteretsPlateforme = !locked && form.investissement_id === INTERETS_PLATEFORME_VALUE;
|
||||
@@ -181,6 +182,7 @@ export default function RembFormModal({
|
||||
value={form.investissement_id}
|
||||
onChange={v => onFieldChange('investissement_id', v)}
|
||||
options={investissementOptions}
|
||||
interetsPlateformeLabel={interetsPlateformeLabel}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -18,7 +18,7 @@ import { fmtEUR, fmtDate, today } from '../utils/format.js';
|
||||
const TYPE_LABELS = {
|
||||
bonus_plateforme: 'Bonus plateforme',
|
||||
bonus_parrainage: 'Bonus parrainage',
|
||||
interets_plateforme: 'Intérêts plateforme',
|
||||
interets_plateforme: 'Distribution',
|
||||
};
|
||||
|
||||
const MOIS_FR = ['Janvier','Février','Mars','Avril','Mai','Juin','Juillet','Août','Septembre','Octobre','Novembre','Décembre'];
|
||||
@@ -608,6 +608,7 @@ export default function RemboursementsSimple() {
|
||||
investissementLabel="Type *"
|
||||
dealOptions={dealsForSelectedPlat}
|
||||
forceShowFrais
|
||||
interetsPlateformeLabel="💰 Distribution"
|
||||
/>
|
||||
</>
|
||||
);
|
||||
@@ -878,6 +879,7 @@ export default function RemboursementsSimple() {
|
||||
investissementLabel="Type *"
|
||||
dealOptions={dealsForSelectedPlat}
|
||||
forceShowFrais
|
||||
interetsPlateformeLabel="💰 Distribution"
|
||||
/>
|
||||
|
||||
<ConfirmModal
|
||||
|
||||
Reference in new issue
Block a user