Ajoute Salaire/stage et Sous-traitant au graphique des versements par compte

Deux lignes supplémentaires (pas ventilées par compte, un seul total
chacune) dans "Total des versements par compte" et sa version par année --
même source déjà utilisée par "Répartition de l'activité par type"
(total_par_type / total_par_type_par_annee), aucun changement backend.
This commit is contained in:
2026-09-08 15:05:18 +02:00
parent 692f7f3ea3
commit d17a3e2e33
2 changed files with 19 additions and 7 deletions
@@ -181,12 +181,22 @@
// its own (single-compte) type breakdown, just never sliced down // its own (single-compte) type breakdown, just never sliced down
// to one type across every compte before now. No new backend // to one type across every compte before now. No new backend
// field needed, just pull out the "versement" entry per compte. // field needed, just pull out the "versement" entry per compte.
// Salaire/stage and sous-traitant are the two other ways money
// leaves the collective toward a person/entity outside the 6
// comptes associés -- added as two extra rows (not split per
// compte, there's only one meaningful total each) so the chart
// reads as "who/what actually got paid", not just the 6 associés.
// Sourced from total_par_type (all-time)/total_par_type_par_annee,
// same fields typeItems()/typeItemsParAnnee() above already use.
versementsParCompteItems() { versementsParCompteItems() {
if (!this.stats) return []; if (!this.stats) return [];
return Object.entries(this.stats.total_par_type_par_compte) const items = Object.entries(this.stats.total_par_type_par_compte)
.filter(([, parType]) => parType.versement !== undefined) .filter(([, parType]) => parType.versement !== undefined)
.map(([compte, parType]) => ({ label: compte, value: parType.versement })) .map(([compte, parType]) => ({ label: compte, value: parType.versement }));
.sort((a, b) => b.value - a.value); const parType = this.stats.total_par_type || {};
if (parType.salaire_stage) items.push({ label: TYPE_LABELS.salaire_stage, value: parType.salaire_stage });
if (parType.sous_traitant) items.push({ label: TYPE_LABELS.sous_traitant, value: parType.sous_traitant });
return items.sort((a, b) => b.value - a.value);
}, },
// Small multiples, one per year -- same source as typeItemsParAnnee // Small multiples, one per year -- same source as typeItemsParAnnee
// above (total_par_type_par_compte_par_annee, already there for // above (total_par_type_par_compte_par_annee, already there for
@@ -197,9 +207,11 @@
const parCompte = this.stats.total_par_type_par_compte_par_annee[annee] || {}; const parCompte = this.stats.total_par_type_par_compte_par_annee[annee] || {};
const items = Object.entries(parCompte) const items = Object.entries(parCompte)
.filter(([, parType]) => parType.versement !== undefined) .filter(([, parType]) => parType.versement !== undefined)
.map(([compte, parType]) => ({ label: compte, value: parType.versement })) .map(([compte, parType]) => ({ label: compte, value: parType.versement }));
.sort((a, b) => b.value - a.value); const parType = this.stats.total_par_type_par_annee[annee] || {};
return { annee, items }; if (parType.salaire_stage) items.push({ label: TYPE_LABELS.salaire_stage, value: parType.salaire_stage });
if (parType.sous_traitant) items.push({ label: TYPE_LABELS.sous_traitant, value: parType.sous_traitant });
return { annee, items: items.sort((a, b) => b.value - a.value) };
}).filter((y) => y.items.length); }).filter((y) => y.items.length);
}, },
totalCA() { totalCA() {
@@ -62,7 +62,7 @@
<section class="figli-chart-section"> <section class="figli-chart-section">
<h2>Total des versements par compte</h2> <h2>Total des versements par compte</h2>
<p class="figli-note">Montant total versé à chaque compte associé, toutes années confondues.</p> <p class="figli-note">Montant total versé à chaque compte associé, plus les salaires/stages et sous-traitants, toutes années confondues.</p>
<h-bar-chart :items="versementsParCompteItems" :format-value="formatEurRound"></h-bar-chart> <h-bar-chart :items="versementsParCompteItems" :format-value="formatEurRound"></h-bar-chart>
<div class="figli-year-hbar-grid"> <div class="figli-year-hbar-grid">
<div class="figli-year-hbar-card" v-for="y in versementsParCompteParAnnee" :key="y.annee"> <div class="figli-year-hbar-card" v-for="y in versementsParCompteParAnnee" :key="y.annee">