From f8b4d61355cc2e84edf990455dd58104013465a8 Mon Sep 17 00:00:00 2001 From: paaton Date: Tue, 23 Apr 2024 18:00:55 +0200 Subject: [PATCH 1/2] enabled deals in dashboard --- src/Templates/translatable/widgets/deals.twig | 37 +++++++++---------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/src/Templates/translatable/widgets/deals.twig b/src/Templates/translatable/widgets/deals.twig index 2a443c76..b34d59a9 100644 --- a/src/Templates/translatable/widgets/deals.twig +++ b/src/Templates/translatable/widgets/deals.twig @@ -1,22 +1,21 @@ -{% if false %} -
- {% for deal in deals %} -

{{ ('deal.' ~ deal.slug)|trans }}

- {% if deal.isDone %} - {{ ('deal.'~deal.slug~'-done')|trans }} +
+ {% for deal in deals %} +

{{ ('deal.' ~ deal.slug)|trans }}

+ {% if deal.isDone %} + {{ ('deal.'~deal.slug~'-done')|trans }} + {% else %} + {% if deal.getDoneAt() %} + {{ ('deal.'~deal.slug~'-doneBadly')|trans({ + '%date%': deal.doneAt.format('d. m. Y, H:i:s') + }) }}:
{% else %} - {% if deal.getDoneAt() %} - {{ ('deal.'~deal.slug~'-doneBadly')|trans({ - '%date%': deal.doneAt.format('d. m. Y, H:i:s') - }) }}:
- {% else %} - {{ ('deal.'~deal.slug~'-missing')|trans }}:
- {% endif %} -
- {{ ('deal.'~deal.slug~'-button')|trans }} + {{ ('deal.'~deal.slug~'-missing')|trans }}:
{% endif %}
-
- {% endfor %} -
-{% endif %} + {{ ('deal.'~deal.slug~'-button')|trans }} + {% endif %} +
+
+ {% endfor %} +
+ From e6bea81aed2fae81e9850408f246b29c9ba5d98d Mon Sep 17 00:00:00 2001 From: paaton Date: Tue, 23 Apr 2024 20:53:49 +0200 Subject: [PATCH 2/2] Fixed Ist import, merge of multiple Participants now does not try to delete any P --- src/Import/ImportSrs.php | 9 +++++---- src/Participant/Ist/IstService.php | 5 ++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Import/ImportSrs.php b/src/Import/ImportSrs.php index 4c62bbfc..e4d0854a 100644 --- a/src/Import/ImportSrs.php +++ b/src/Import/ImportSrs.php @@ -148,6 +148,7 @@ private function mapDataIntoNewIst(array $data, Event $event, ?User $existingUse 'Ano' => true, default => false, }; + $participant = null; if ($existingUser == null) { $existingUser = $this->userService->createSkautisUser( $event, @@ -155,15 +156,15 @@ private function mapDataIntoNewIst(array $data, Event $event, ?User $existingUse $email, $userStatus, ); + } else { - $participant = $this->participantRepository->findParticipantFromUser($existingUser); - if ($participant !== null) { - $this->participantRepository->delete($participant); - } + $participant = $this->participantRepository->findParticipantFromUser($existingUser); + } return $this->istService->createIstPayment( $existingUser, $event, + $participant, $contingent, $data['first_name'], $data['last_name'], diff --git a/src/Participant/Ist/IstService.php b/src/Participant/Ist/IstService.php index f7e38806..e752aab2 100644 --- a/src/Participant/Ist/IstService.php +++ b/src/Participant/Ist/IstService.php @@ -28,6 +28,7 @@ public function __construct( public function createIstPayment( User $user, Event $event, + ?Participant $participant, string $contingent, string $firstName, string $lastName, @@ -57,7 +58,9 @@ public function createIstPayment( string $swift, DateTimeImmutable $due, ): Participant { - $participant = new Participant(); + if ($participant == null) { + $participant = new Participant(); + } $participant->user = $user; $participant->role = ParticipantRole::Ist; $participant->contingent = $contingent;