Améliorations diverses

This commit is contained in:
2026-06-18 08:25:05 +02:00
parent eb961cbed4
commit 03b7b87538
7 changed files with 110 additions and 64 deletions
+11 -1
View File
@@ -72,10 +72,20 @@ export default function DrillCellPanel({
if (!cell) { setData(null); return; }
setLoading(true);
setData(null);
/* En mode consolidé, cell.platIds contient plusieurs IDs numériques ;
si l'utilisateur a choisi un filtre manuel dans le select, on l'utilise tel quel */
const isInitialFilter = cell.platId ? filterPlatId === String(cell.platId) : !filterPlatId;
const consolidatedIds = isInitialFilter && cell.platIds?.length > 1
? cell.platIds.join(',')
: null;
const params = {
annee: cell.annee,
mois: cell.mois,
...(filterPlatId ? { plateforme_id: filterPlatId } : {}),
...(consolidatedIds
? { plateforme_ids: consolidatedIds }
: filterPlatId ? { plateforme_id: filterPlatId } : {}),
...(activeView === 'all' ? { scope: 'all' } : {}),
};
api.get('/dashboard/detail-cellule', params)
+2 -27
View File
@@ -12,20 +12,6 @@ function startOfMonth(Y, M) {
return `${Y}-${String(M).padStart(2,'0')}-01`;
}
const STATUT_BG = {
en_cours: 'var(--b-en_cours-bg)',
rembourse: 'var(--b-rembourse-bg)',
en_retard: 'var(--b-en_retard-bg)',
procedure: 'var(--b-procedure-bg)',
cloture: 'var(--surface-2)',
};
const STATUT_FG = {
en_cours: 'var(--b-en_cours-fg)',
rembourse: 'var(--b-rembourse-fg)',
en_retard: 'var(--b-en_retard-fg)',
procedure: 'var(--b-procedure-fg)',
cloture: 'var(--text-muted)',
};
export default function InvMensuelTable({ rows, allRembs, allReinvests, year, originFrom }) {
const navigate = useNavigate();
@@ -125,11 +111,7 @@ export default function InvMensuelTable({ rows, allRembs, allReinvests, year, or
</tr>
<tr>
<th className="tip-th-name tip-th-name-amber" style={{ minWidth: '22ch', maxWidth: '40ch' }}>Investissement</th>
<th style={{
padding: '7px 10px', background: 'var(--surface-2)', color: 'var(--text)',
fontWeight: 600, fontSize: 'var(--fs-xs)', textAlign: 'left',
borderRight: '1px solid var(--border)', whiteSpace: 'nowrap',
}}>Statut</th>
<th className="tip-th-name" style={{ minWidth: 'unset', position: 'static', fontSize: 'var(--fs-xs)', textAlign: 'left' }}>Statut</th>
{MOIS_LONG.map((m, i) => (
<th key={m}
className={`tip-th-month${displayYear === currentYear && i === currentMonth - 1 ? ' tip-th-month-current' : ''}`}>
@@ -148,14 +130,7 @@ export default function InvMensuelTable({ rows, allRembs, allReinvests, year, or
{inv.nom_projet || '—'}
</td>
<td style={{ padding: '8px 10px', whiteSpace: 'nowrap', borderRight: '1px solid var(--border)' }}>
<span style={{
display: 'inline-block', padding: '2px 8px', borderRadius: 4,
fontSize: 'var(--fs-xs)', fontWeight: 600,
background: STATUT_BG[inv.statut] || 'var(--surface-2)',
color: STATUT_FG[inv.statut] || 'var(--text-muted)',
}}>
{fmtStatut(inv.statut)}
</span>
<span className={`badge ${inv.statut}`}>{fmtStatut(inv.statut)}</span>
</td>
{months.map((v, mi) => {
const curClass = displayYear === currentYear && mi === currentMonth - 1 ? ' tip-col-current' : '';
@@ -136,12 +136,14 @@ export default function TableauInteretsPlateforme({ activeView, activeId, pfuRat
if (!byNom[plat.nom]) {
byNom[plat.nom] = {
...plat,
id: plat.nom,
id: plat.nom,
_ids: [plat.id], // ← tous les IDs numériques fusionnés
detenteur_nom: null,
rembourses: { ...plat.rembourses },
projections: { ...plat.projections },
};
} else {
byNom[plat.nom]._ids.push(plat.id);
byNom[plat.nom].rembourses = mergeMaps(byNom[plat.nom].rembourses, plat.rembourses);
byNom[plat.nom].projections = mergeMaps(byNom[plat.nom].projections, plat.projections);
}
@@ -397,7 +399,8 @@ export default function TableauInteretsPlateforme({ activeView, activeId, pfuRat
className={`tip-td-num${v?.projected ? ' tip-projected' : ''}${isCurrent ? ' tip-col-current' : ''}${isActive ? ' tip-td-active' : ''}${clickable ? ' tip-td-clickable' : ''}`}
onClick={() => clickable && onCellClick && onCellClick({
key: cellKey,
platId: plat.id,
platId: plat._ids ? plat._ids[0] : plat.id, // toujours numérique
platIds: plat._ids ?? [plat.id], // tous les IDs (consolidé)
platNom: plat.nom,
annee,
mois: String(mi + 1).padStart(2, '0'),