Ajoute "Charges structurelles par client" (+ par année) sur le dashboard SAS
Réutilise le node-level query déjà exécuté pour caParClient/totalParType (aucune requête SQL supplémentaire) -- accumule abs(montant_ht) des lignes type=charge par client (le vendeur/organisme : loyer, assurance, URSSAF...). Trié par montant décroissant (pas alphabétique), pas de plafond top-N vu le petit nombre de vendeurs distincts. Coloré en gris "charge", même couleur que ce type dans "Répartition de l'activité par type".
This commit is contained in:
@@ -176,6 +176,27 @@
|
||||
return { annee, items };
|
||||
}).filter((y) => y.items.length);
|
||||
},
|
||||
// Charges structurelles by client (i.e. by vendor: loyer,
|
||||
// assurance, hébergement, URSSAF...) -- sorted by value descending
|
||||
// server-side already (no alphabetical option asked for here,
|
||||
// unlike the versements-par-compte chart), no top-N cap needed
|
||||
// (see DashboardStatsController::stats()'s own comment -- only a
|
||||
// handful of distinct vendors ever show up on a "charge" line).
|
||||
// `type: 'charge'` on every item is just so colorFor="typeColor"
|
||||
// (same method the type-breakdown chart uses) paints every bar the
|
||||
// same "charge" grey -- every row here is that type by definition.
|
||||
chargeParClientItems() {
|
||||
if (!this.stats) return [];
|
||||
return this.stats.charge_par_client.map((c) => ({ label: c.client, value: c.total, type: 'charge' }));
|
||||
},
|
||||
chargeParClientParAnnee() {
|
||||
if (!this.stats) return [];
|
||||
return this.stats.annees.map((annee) => {
|
||||
const items = (this.stats.charge_par_client_par_annee[annee] || [])
|
||||
.map((c) => ({ label: c.client, value: c.total, type: 'charge' }));
|
||||
return { annee, items };
|
||||
}).filter((y) => y.items.length);
|
||||
},
|
||||
// total_par_type_par_compte is already in the stats response --
|
||||
// it's the same répartition-level query /dashboard/compte uses for
|
||||
// its own (single-compte) type breakdown, just never sliced down
|
||||
|
||||
Reference in New Issue
Block a user