'cyan','benevole' => 'green','dirigeant' => 'purple','veterinaire' => 'red','cabinet' => 'orange','crematorium' => 'dark','adoptant' => 'blue','deposant' => 'yellow','fourriere' => 'azure']; $contactRoles = array_filter(explode(',', (string)$contact['roles'])); $money = static fn (int$cents): string => number_format($cents / 100, 2, ',', ' ') . ' €'; $frDate = static function (?string$date): string { if (!$date) { return'—'; }try { return(new DateTimeImmutable($date))->format('d/m/Y'); } catch (Throwable) { return$date; } }; $animalRows = static function (array$rows, string$title, string$color, string$icon) use ($frDate): void { if (!$rows) { return; } ?>
| = h(t('common.date')) ?> | = h(t('animal.animal')) ?> | = h(t('common.label')) ?> | = h(t('common.amount')) ?> |
|---|---|---|---|
| = h($frDate($expense['occurred_on'])) ?> | = h($expense['animal_name']) ?>
= h($expense['internal_code']) ?>
|
= h($expense['label']) ?> | = h($money((int)$expense['total_cents'])) ?> |
| = h(t('common.total')) ?> | = h($money((int)$expenseTotal)) ?> | ||