amélioration de l'affichage des projections
This commit is contained in:
@@ -1199,6 +1199,19 @@ export default function InvestissementDetail() {
|
|||||||
const interets = netMode
|
const interets = netMode
|
||||||
? (s.interets_prevus || 0) * (1 - reduction)
|
? (s.interets_prevus || 0) * (1 - reduction)
|
||||||
: (s.interets_prevus || 0);
|
: (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 (
|
return (
|
||||||
<tr
|
<tr
|
||||||
key={s.id}
|
key={s.id}
|
||||||
@@ -1211,8 +1224,24 @@ export default function InvestissementDetail() {
|
|||||||
<td className="num">{s.numero_echeance}</td>
|
<td className="num">{s.numero_echeance}</td>
|
||||||
<td>{fmtDate(s.date_prevue)}</td>
|
<td>{fmtDate(s.date_prevue)}</td>
|
||||||
<td className="num">{fmtEUR(s.capital_prevu)}</td>
|
<td className="num">{fmtEUR(s.capital_prevu)}</td>
|
||||||
<td className="num">{fmtEUR(interets)}</td>
|
<td className="num">
|
||||||
<td className="num"><strong>{fmtEUR(s.total_prevu)}</strong></td>
|
{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>
|
<td>
|
||||||
{isPaid
|
{isPaid
|
||||||
? <span style={{ color: 'var(--success, #22c55e)', fontSize: 12, fontWeight: 600 }}>
|
? <span style={{ color: 'var(--success, #22c55e)', fontSize: 12, fontWeight: 600 }}>
|
||||||
@@ -2390,4 +2419,4 @@ export default function InvestissementDetail() {
|
|||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user