Show the exact solde amount directly in the versement badge

The reste-à-verser/sur-versé badge only showed the word, with the exact
figure available in the hover title -- had to open the drill-down modal
just to see how much. linkStatus() now exposes the computed amount
(montant) alongside kind/detail, and linkStatusLabel() takes the whole
status object to format it inline: "Reste à verser : 440,00 €",
"Sur-versé : 710,00 €", "Lié : 0,00 €" for a fully settled one.

Verified live: all three cases render with the exact figure in both the
main table and the drill-down modal.
This commit is contained in:
2026-09-06 12:32:41 +02:00
parent fc89ae6232
commit 0c893b1b24
2 changed files with 17 additions and 11 deletions
@@ -654,23 +654,29 @@
}
}
if (resteAVerser > 0.01) {
return { kind: 'reste', detail: 'Reste à verser (comptes de cette ligne) : ' + this.formatEur(Math.round(resteAVerser * 100) / 100) };
const montant = Math.round(resteAVerser * 100) / 100;
return { kind: 'reste', montant, detail: 'Reste à verser (comptes de cette ligne) : ' + this.formatEur(montant) };
}
if (surVerse > 0.01) {
return { kind: 'sur-verse', detail: 'Sur-versé (comptes de cette ligne) : ' + this.formatEur(Math.round(surVerse * 100) / 100) };
const montant = Math.round(surVerse * 100) / 100;
return { kind: 'sur-verse', montant, detail: 'Sur-versé (comptes de cette ligne) : ' + this.formatEur(montant) };
}
if (unresolved) {
return { kind: 'inconnu', detail: 'Entrée(s) liée(s) pas encore vérifiée(s) -- cliquer pour vérifier.' };
}
const n = item.entreeLieeIds.length;
return { kind: 'ok', detail: 'Lié à ' + n + ' entrée' + (n > 1 ? 's' : '') + ' client' + (n > 1 ? 's' : '') + '.' };
return { kind: 'ok', montant: 0, detail: 'Lié à ' + n + ' entrée' + (n > 1 ? 's' : '') + ' client' + (n > 1 ? 's' : '') + '.' };
},
linkStatusLabel(kind) {
if (kind === 'non-liee') return 'Non liée';
if (kind === 'reste') return 'Reste à verser';
if (kind === 'sur-verse') return 'Sur-versé';
if (kind === 'inconnu') return 'À vérifier';
return 'Lié';
// Takes the whole status object (not just kind) -- reste/sur-verse/
// ok show the exact solde right in the badge, not just in the
// hover title, since a bare "Reste à verser" with no figure meant
// opening the drill-down modal just to see how much.
linkStatusLabel(status) {
if (status.kind === 'non-liee') return 'Non le';
if (status.kind === 'reste') return 'Reste à verser : ' + this.formatEur(status.montant);
if (status.kind === 'sur-verse') return 'Sur-versé : ' + this.formatEur(status.montant);
if (status.kind === 'inconnu') return 'À vérifier';
return 'Lié : ' + this.formatEur(status.montant);
},
// Only non-liee/sur-versé read as a hard anomaly (red); reste and
// inconnu are their own softer amber; ok gets neither, falling back