Ajouter les statistiques par période

This commit is contained in:
Alexandre NOEL 2026-10-02 12:11:30 +02:00
commit 86642095cd
14 changed files with 315 additions and 125 deletions

View file

@ -30,7 +30,7 @@ $animalRows = static function (array$rows, string$title, string$color, string$ic
<div class="d-flex flex-wrap justify-content-between align-items-center gap-2 mb-3">
<div class="d-flex flex-wrap gap-2"><a class="btn" href="/directory">←
<?= h(t('directory.back')) ?></a><?php if ($expensePeriodRequested): ?><a class="btn btn-outline-orange"
href="/statistics?<?= h(http_build_query(['year' => $expensePeriodYear ?? 'all','municipality' => $expensePeriodMunicipality])) ?>">←
href="/statistics?<?= h(http_build_query(($expensePeriodQuery ?? ['period_type' => 'all']) + ['municipality' => $expensePeriodMunicipality])) ?>">←
<?= h(t('directory.back_statistics')) ?></a><?php endif; ?></div><a class="btn btn-primary"
href="/directory/edit?id=<?= (int)$contact['id'] ?>"><?= h(t('common.edit')) ?></a>
</div>
@ -78,7 +78,7 @@ if ($address): ?><div>📍 <?= h($address) ?></div>
<div class="row align-items-center">
<div class="col">
<div class="subheader"><?= h(t('directory.total_invoiced')) ?><?php if ($expensePeriodRequested): ?> ·
<?= h($expensePeriodYear ?? t('statistics.all_years')) ?><?php if ($expensePeriodMunicipality !== ''): ?>
<?= h($expensePeriodLabel ?? t('statistics.all_years')) ?><?php if ($expensePeriodMunicipality !== ''): ?>
· <?= h($expensePeriodMunicipality) ?><?php endif; ?><?php endif; ?></div>
<div class="h1 mb-0 text-orange"><?= h($money((int)$expenseTotal)) ?></div>
<div class="text-muted small"><?= h(t('directory.expense_count', ['count' => (int)$expenseCount])) ?>