fix
This commit is contained in:
@@ -648,6 +648,7 @@ export default function InvestissementDetail() {
|
||||
|
||||
const remb = inv.remboursements || [];
|
||||
const simul = inv.simul || [];
|
||||
const todayStr = today();
|
||||
const historique = inv.historique || [];
|
||||
const reinvs = inv.reinvestissements || [];
|
||||
// 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.capital || 0) + (r.cashback || 0) + (r.interets_bruts || 0), 0))
|
||||
: null;
|
||||
const isPast = s.date_prevue < todayStr;
|
||||
const interetsDiffers = isPaid && Math.abs(interetsReels - interets) > 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>{fmtEUR(interetsReels)}</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)}
|
||||
</td>
|
||||
<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>
|
||||
<strong>{fmtEUR(totalRecu)}</strong>
|
||||
</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>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user