Fix
This commit is contained in:
@@ -129,7 +129,9 @@ export function adjustSimulForActuals(db, investissementId) {
|
||||
FROM investissements WHERE id = ?
|
||||
`).get(investissementId);
|
||||
|
||||
if (!inv || !inv.taux_interet || !inv.duree_mois) return;
|
||||
// taux_interet peut légitimement valoir 0 (ex. révision suite à un arrêt de production
|
||||
// n'engendrant plus d'intérêts) — ne pas confondre avec "non renseigné" (null/undefined).
|
||||
if (!inv || inv.taux_interet == null || !inv.duree_mois) return;
|
||||
|
||||
// Réinvestissements triés par date (peuvent être vides)
|
||||
const reinvests = db.prepare(
|
||||
@@ -379,7 +381,8 @@ export function generateSimulWithReinvestissements(db, investissementId) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!inv.taux_interet || !inv.duree_mois) return;
|
||||
// taux_interet peut légitimement valoir 0 (cf. commentaire dans adjustSimulForActuals)
|
||||
if (inv.taux_interet == null || !inv.duree_mois) return;
|
||||
|
||||
const startDate = inv.date_debut_simul || inv.date_premiere_echeance || inv.date_souscription;
|
||||
if (!startDate) return;
|
||||
@@ -525,7 +528,8 @@ export function generateSimul(db, inv) {
|
||||
const { id, montant_investi, taux_interet, duree_mois, type_remb, freq_interets,
|
||||
date_premiere_echeance, date_debut_simul, date_souscription, echeance_fin_de_mois } = inv;
|
||||
|
||||
if (!taux_interet || !duree_mois) return;
|
||||
// taux_interet peut légitimement valoir 0 (cf. commentaire dans adjustSimulForActuals)
|
||||
if (taux_interet == null || !duree_mois) return;
|
||||
|
||||
// date_debut_simul remplace le point de départ quand le prêt a été restructuré
|
||||
const startDate = date_debut_simul || date_premiere_echeance || date_souscription;
|
||||
|
||||
Reference in New Issue
Block a user