amélioration de l'affichage des projections

This commit is contained in:
2026-06-16 20:08:22 +02:00
parent 58ec637139
commit f4db83591f
+32 -3
View File
@@ -1199,6 +1199,19 @@ export default function InvestissementDetail() {
const interets = netMode
? (s.interets_prevus || 0) * (1 - reduction)
: (s.interets_prevus || 0);
// Montants réels pour comparaison
const interetsReels = isPaid
? (netMode ? (matched.interets_nets || 0) : (matched.interets_bruts || 0))
: null;
const totalRecu = isPaid
? (netMode
? (matched.net_recu || 0)
: (matched.capital || 0) + (matched.cashback || 0) + (matched.interets_bruts || 0))
: null;
const interetsDiffers = isPaid && Math.abs(interetsReels - interets) > 0.01;
const totalDiffers = isPaid && Math.abs(totalRecu - s.total_prevu) > 0.01;
return (
<tr
key={s.id}
@@ -1211,8 +1224,24 @@ export default function InvestissementDetail() {
<td className="num">{s.numero_echeance}</td>
<td>{fmtDate(s.date_prevue)}</td>
<td className="num">{fmtEUR(s.capital_prevu)}</td>
<td className="num">{fmtEUR(interets)}</td>
<td className="num"><strong>{fmtEUR(s.total_prevu)}</strong></td>
<td className="num">
{interetsDiffers ? (
<span style={{ display: 'inline-flex', alignItems: 'baseline', gap: 5 }}>
<span style={{ textDecoration: 'line-through', color: 'var(--text-muted)', fontWeight: 400 }}>{fmtEUR(interets)}</span>
<span>{fmtEUR(interetsReels)}</span>
</span>
) : fmtEUR(interets)}
</td>
<td className="num">
{totalDiffers ? (
<span style={{ display: 'inline-flex', alignItems: 'baseline', gap: 5 }}>
<span style={{ textDecoration: 'line-through', color: 'var(--text-muted)', fontWeight: 400 }}>{fmtEUR(s.total_prevu)}</span>
<strong>{fmtEUR(totalRecu)}</strong>
</span>
) : (
<strong>{fmtEUR(s.total_prevu)}</strong>
)}
</td>
<td>
{isPaid
? <span style={{ color: 'var(--success, #22c55e)', fontSize: 12, fontWeight: 600 }}>
@@ -2390,4 +2419,4 @@ export default function InvestissementDetail() {
/>
</>
);
}
}