Configure les tarifs d'adoption par espèce

Refs #14 #18
This commit is contained in:
Alexandre NOEL 2026-09-08 00:44:40 +02:00
commit 1378aefa9c
14 changed files with 93 additions and 35 deletions

View file

@ -285,9 +285,9 @@ if ($felvPos) {
<span class="badge <?= h($sterilizationClass) ?>">
<?= h($sterilizationLabel) ?>
</span>
<?php if ($isCat): ?><span class="text-muted small"><?= h(t('animal.adoption_fee_hint')) ?>
<strong
class="text-body"><?= $sterilizationState === 'yes' ? AppSettings::int('adoption_fee_sterilized') . ' €' : AppSettings::int('adoption_fee_unsterilized') . ' €' ?></strong></span><?php endif; ?>
<?php $adoptionFee = PricingService::adoptionFee((string)$animal['species'], $sterilizationState === 'yes'); ?>
<span class="text-muted small"><?= h(t('animal.adoption_fee_hint')) ?>
<strong class="text-body"><?= $adoptionFee === null ? h(t('pricing.free_fee')) : $adoptionFee . ' €' ?></strong></span>
<?php if ($sterilizationState === 'yes' && (!empty($animal['sterilization_date']) || !empty($sterilizationContacts))): ?><span
class="text-muted small"><?= !empty($animal['sterilization_date']) ? h(date('d/m/Y', strtotime((string)$animal['sterilization_date']))) : '' ?><?= !empty($sterilizationContacts['vet']['name']) ? ' · ' . h($sterilizationContacts['vet']['name']) : '' ?><?= !empty($sterilizationContacts['clinic']['name']) ? ' · ' . h($sterilizationContacts['clinic']['name']) : '' ?></span><?php endif; ?>
</div>