diff --git a/web/modules/custom/figli_compta_ledger/src/Controller/LedgerStatsController.php b/web/modules/custom/figli_compta_ledger/src/Controller/LedgerStatsController.php index 2e3a34b..c053a62 100644 --- a/web/modules/custom/figli_compta_ledger/src/Controller/LedgerStatsController.php +++ b/web/modules/custom/figli_compta_ledger/src/Controller/LedgerStatsController.php @@ -18,8 +18,13 @@ class LedgerStatsController extends ControllerBase { /** * GET /lignes/api/totaux?annee=2023 -- per-compte répartition sums (plus * montant HT/TTC/écart totals) for every ligne_comptable dated that - * year. Ouverture lines are excluded: they're a carried-over balance, - * not activity within the year. + * year, including ouverture lines: the footer is meant to read as the + * actual account balance (solde) for the year, i.e. the same "clôture + * calculée" (ouverture + every movement dated within the year) that + * reconciliationOuverture() compares the *next* year's ouverture + * against. Excluding ouverture here would make this a net-movement + * figure instead, which never matches what the reconciliation badge's + * tooltip cites for the same year. */ public function totauxAnnee(Request $request) { $annee = $request->query->get('annee'); @@ -33,7 +38,6 @@ class LedgerStatsController extends ControllerBase { ->condition('type', 'ligne_comptable') ->condition('field_date_ligne', $annee . '-01-01', '>=') ->condition('field_date_ligne', ((int) $annee + 1) . '-01-01', '<') - ->condition('field_type_ligne', 'ouverture', '<>') ->execute(); $par_compte = [];