This commit is contained in:
2026-06-16 21:03:15 +02:00
parent 1423354514
commit ab7b945705
@@ -648,6 +648,7 @@ export default function InvestissementDetail() {
const remb = inv.remboursements || []; const remb = inv.remboursements || [];
const simul = inv.simul || []; const simul = inv.simul || [];
const todayStr = today();
const historique = inv.historique || []; const historique = inv.historique || [];
const reinvs = inv.reinvestissements || []; const reinvs = inv.reinvestissements || [];
// Capital total = montant initial + réinvestissements // Capital total = montant initial + réinvestissements
@@ -1227,6 +1228,7 @@ export default function InvestissementDetail() {
? matchedAll.reduce((sum, r) => sum + (r.net_recu || 0), 0) ? matchedAll.reduce((sum, r) => sum + (r.net_recu || 0), 0)
: matchedAll.reduce((sum, r) => sum + (r.capital || 0) + (r.cashback || 0) + (r.interets_bruts || 0), 0)) : matchedAll.reduce((sum, r) => sum + (r.capital || 0) + (r.cashback || 0) + (r.interets_bruts || 0), 0))
: null; : null;
const isPast = s.date_prevue < todayStr;
const interetsDiffers = isPaid && Math.abs(interetsReels - interets) > 0.01; const interetsDiffers = isPaid && Math.abs(interetsReels - interets) > 0.01;
const totalDiffers = isPaid && Math.abs(totalRecu - s.total_prevu) > 0.01; const totalDiffers = isPaid && Math.abs(totalRecu - s.total_prevu) > 0.01;
@@ -1248,6 +1250,11 @@ export default function InvestissementDetail() {
<span style={{ textDecoration: 'line-through', color: 'var(--text-muted)', fontWeight: 400 }}>{fmtEUR(interets)}</span> <span style={{ textDecoration: 'line-through', color: 'var(--text-muted)', fontWeight: 400 }}>{fmtEUR(interets)}</span>
<span>{fmtEUR(interetsReels)}</span> <span>{fmtEUR(interetsReels)}</span>
</span> </span>
) : (isPast && !isPaid) ? (
<span style={{ display: 'inline-flex', alignItems: 'baseline', gap: 5 }}>
<span style={{ textDecoration: 'line-through', color: 'var(--text-muted)', fontWeight: 400 }}>{fmtEUR(interets)}</span>
<span>0,00 €</span>
</span>
) : fmtEUR(interets)} ) : fmtEUR(interets)}
</td> </td>
<td className="num"> <td className="num">
@@ -1256,6 +1263,11 @@ export default function InvestissementDetail() {
<span style={{ textDecoration: 'line-through', color: 'var(--text-muted)', fontWeight: 400 }}>{fmtEUR(s.total_prevu)}</span> <span style={{ textDecoration: 'line-through', color: 'var(--text-muted)', fontWeight: 400 }}>{fmtEUR(s.total_prevu)}</span>
<strong>{fmtEUR(totalRecu)}</strong> <strong>{fmtEUR(totalRecu)}</strong>
</span> </span>
) : (isPast && !isPaid) ? (
<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>0,00 €</strong>
</span>
) : ( ) : (
<strong>{fmtEUR(s.total_prevu)}</strong> <strong>{fmtEUR(s.total_prevu)}</strong>
)} )}