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:
@@ -654,23 +654,29 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (resteAVerser > 0.01) {
|
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) {
|
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) {
|
if (unresolved) {
|
||||||
return { kind: 'inconnu', detail: 'Entrée(s) liée(s) pas encore vérifiée(s) -- cliquer pour vérifier.' };
|
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;
|
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) {
|
// Takes the whole status object (not just kind) -- reste/sur-verse/
|
||||||
if (kind === 'non-liee') return 'Non liée';
|
// ok show the exact solde right in the badge, not just in the
|
||||||
if (kind === 'reste') return 'Reste à verser';
|
// hover title, since a bare "Reste à verser" with no figure meant
|
||||||
if (kind === 'sur-verse') return 'Sur-versé';
|
// opening the drill-down modal just to see how much.
|
||||||
if (kind === 'inconnu') return 'À vérifier';
|
linkStatusLabel(status) {
|
||||||
return 'Lié';
|
if (status.kind === 'non-liee') return 'Non liée';
|
||||||
|
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
|
// Only non-liee/sur-versé read as a hard anomaly (red); reste and
|
||||||
// inconnu are their own softer amber; ok gets neither, falling back
|
// inconnu are their own softer amber; ok gets neither, falling back
|
||||||
|
|||||||
@@ -221,7 +221,7 @@
|
|||||||
:class="linkStatusClasses(linkStatus(item).kind)"
|
:class="linkStatusClasses(linkStatus(item).kind)"
|
||||||
:title="item.entreeLieeIds.length ? linkStatus(item).detail + ' -- cliquer pour voir la ou les entrées liées' : linkStatus(item).detail + ' -- cliquer pour lier une entrée client'"
|
:title="item.entreeLieeIds.length ? linkStatus(item).detail + ' -- cliquer pour voir la ou les entrées liées' : linkStatus(item).detail + ' -- cliquer pour lier une entrée client'"
|
||||||
@click="item.entreeLieeIds.length ? toggleEntreeFilter(item.entreeLieeIds[0], item.nid) : openLinkForm(item.nid)"
|
@click="item.entreeLieeIds.length ? toggleEntreeFilter(item.entreeLieeIds[0], item.nid) : openLinkForm(item.nid)"
|
||||||
>{{ linkStatus(item).kind === 'ok' ? '' : '⚠ ' }}{{ linkStatusLabel(linkStatus(item).kind) }}</span>
|
>{{ linkStatus(item).kind === 'ok' ? '' : '⚠ ' }}{{ linkStatusLabel(linkStatus(item)) }}</span>
|
||||||
</template>
|
</template>
|
||||||
</td>
|
</td>
|
||||||
<td class="amount" :class="montantClass(item.montant_ht)">{{ formatEur(item.montant_ht) }}</td>
|
<td class="amount" :class="montantClass(item.montant_ht)">{{ formatEur(item.montant_ht) }}</td>
|
||||||
@@ -299,7 +299,7 @@
|
|||||||
v-if="linkStatus(item)"
|
v-if="linkStatus(item)"
|
||||||
class="figli-recon-badge"
|
class="figli-recon-badge"
|
||||||
:class="linkStatusClasses(linkStatus(item).kind)"
|
:class="linkStatusClasses(linkStatus(item).kind)"
|
||||||
>{{ linkStatus(item).kind === 'ok' ? '' : '⚠ ' }}{{ linkStatusLabel(linkStatus(item).kind) }}</span>
|
>{{ linkStatus(item).kind === 'ok' ? '' : '⚠ ' }}{{ linkStatusLabel(linkStatus(item)) }}</span>
|
||||||
</td>
|
</td>
|
||||||
<td class="amount" :class="montantClass(item.montant_ht)">{{ formatEur(item.montant_ht) }}</td>
|
<td class="amount" :class="montantClass(item.montant_ht)">{{ formatEur(item.montant_ht) }}</td>
|
||||||
<td class="amount">{{ formatEur(item.montant_ttc) }}</td>
|
<td class="amount">{{ formatEur(item.montant_ttc) }}</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user