diff --git a/client/src/pages/Dashboard.tsx b/client/src/pages/Dashboard.tsx index 86ee180..d56cc3e 100644 --- a/client/src/pages/Dashboard.tsx +++ b/client/src/pages/Dashboard.tsx @@ -155,11 +155,26 @@ export default function Dashboard() { {stats?.annualSummary?.length ? ( -
- - - {stats.annualSummary.map((row) => )} -
AnnéeFactures BAPMontant BAPAbonnementsMontant abonnementsTotal annuel
{row.year}{row.bapCount}{formatCurrency(row.bapAmount)}{row.subscriptionCount}{formatCurrency(row.subscriptionAmount)}{formatCurrency(row.totalAmount)}
+
+
+ + + + + new Intl.NumberFormat("fr-FR", { notation: "compact", maximumFractionDigits: 1 }).format(value)} /> + formatCurrency(Number(value))} labelFormatter={(year) => `Année ${year}`} /> + + + + + +
+
+ + + {stats.annualSummary.map((row) => )} +
AnnéeFactures BAPMontant BAPAbonnementsMontant abonnementsTotal annuel
{row.year}{row.bapCount}{formatCurrency(row.bapAmount)}{row.subscriptionCount}{formatCurrency(row.subscriptionAmount)}{formatCurrency(row.totalAmount)}
+
) :
Aucune facture finalisée avec une date disponible.
} diff --git a/server/invoiceAnalytics.test.ts b/server/invoiceAnalytics.test.ts index 7df881c..82c80f2 100644 --- a/server/invoiceAnalytics.test.ts +++ b/server/invoiceAnalytics.test.ts @@ -21,4 +21,13 @@ describe("agrégats de facturation", () => { { supplierName: "SFR", subscriptionCount: 1, subscriptionAmount: 20, nonSubscriptionCount: 1, nonSubscriptionAmount: 100, totalAmount: 120 }, ]); }); + + it("classe le budget du fournisseur le plus facturé au moins facturé", () => { + const rows = buildSupplierBudgetSummary([ + ...invoices, + { invoiceDate: "2026-05-22", createdAt: "2026-05-22", status: "completed", isSubscription: 0, supplierName: "Orange", totalAmount: "300" }, + ], "2026", "05"); + + expect(rows.map((row) => row.supplierName)).toEqual(["Orange", "SFR"]); + }); }); diff --git a/todo.md b/todo.md index 952a4f2..dce799d 100644 --- a/todo.md +++ b/todo.md @@ -820,3 +820,8 @@ - [x] Créer l’écran Budget réel à la fin du menu Facturation - [x] Afficher par fournisseur les montants Abonnement, Hors abonnement et le total - [x] Ajouter les tests et valider TypeScript, build et affichage en sandbox + +## Améliorations Budget réel et tableau de bord +- [x] Confirmer le tri décroissant par montant total dans le budget +- [x] Ajouter un graphique annuel BAP versus abonnements au tableau de bord +- [x] Ajouter les tests et valider TypeScript, build et rendu sandbox