From 5f9c63d0a1090253841bd9e99761caae4dc1edb3 Mon Sep 17 00:00:00 2001 From: vgreb Date: Wed, 1 Jul 2026 23:41:30 +0200 Subject: [PATCH] Corrige la mutation involontaire de la date de fin d'une cotisation --- sources/AppBundle/MembershipFee/MembershipFeeService.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sources/AppBundle/MembershipFee/MembershipFeeService.php b/sources/AppBundle/MembershipFee/MembershipFeeService.php index e88cc9920..02083088f 100644 --- a/sources/AppBundle/MembershipFee/MembershipFeeService.php +++ b/sources/AppBundle/MembershipFee/MembershipFeeService.php @@ -93,7 +93,8 @@ public function getLatestByUserTypeAndId(MemberType $typePersonne, int $idPerson public function getNextSubscriptionExpiration(?MembershipFee $cotisation = null): DateTime { - $endSubscription = $cotisation ? $cotisation->getEndDate() : new DateTime(); + $endDate = $cotisation?->getEndDate(); + $endSubscription = $endDate !== null ? (clone $endDate)->setTime(23, 59, 59) : new DateTime(); $base = $now = new DateTime(); $year = new DateInterval('P1Y'); @@ -108,9 +109,6 @@ public function getNextSubscriptionExpiration(?MembershipFee $cotisation = null) /** * Renvoit la cotisation demandée - * - * @param $invoiceId Identifiant de la facture - * @param $token Token de la facture. Si null, pas de vérification */ public function getByInvoice(string $invoiceId, ?string $token = null): ?MembershipFee {