diff --git a/app/config/packages/backoffice_menu.yaml b/app/config/packages/backoffice_menu.yaml index f2fff241c..57bd81fc1 100644 --- a/app/config/packages/backoffice_menu.yaml +++ b/app/config/packages/backoffice_menu.yaml @@ -128,6 +128,9 @@ parameters: forum_inscriptions: nom: 'Inscriptions' niveau: 'ROLE_FORUM' + url: '/admin/event/tickets' + extra_routes: + - admin_event_ticket_list forum_pending_bankwires: nom: 'Virements en attente' niveau: 'ROLE_ADMIN' diff --git a/app/config/routing/admin_event.yml b/app/config/routing/admin_event.yml index 3f05ee012..ef268bfb0 100644 --- a/app/config/routing/admin_event.yml +++ b/app/config/routing/admin_event.yml @@ -136,3 +136,7 @@ admin_event_sessions_delete: id: ~ requirements: id: \d+ + +admin_event_ticket_list: + path: /tickets + defaults: { _controller: AppBundle\Controller\Admin\Event\Ticket\IndexAction } \ No newline at end of file diff --git a/db/seeds/Inscriptions.php b/db/seeds/Inscriptions.php index 75bd9fd9e..42c718ba5 100644 --- a/db/seeds/Inscriptions.php +++ b/db/seeds/Inscriptions.php @@ -2,6 +2,7 @@ declare(strict_types=1); +use AppBundle\Association\MemberType; use AppBundle\Event\Model\Ticket; use Phinx\Seed\AbstractSeed; @@ -12,6 +13,7 @@ public function run(): void // Inscriptions $data = [ [ + 'date' => time(), 'reference' => 'REF-TEST-001', 'type_inscription' => Ticket::TYPE_2_DAYS, 'montant' => $GLOBALS['AFUP_Tarifs_Forum'][Ticket::TYPE_2_DAYS], @@ -24,9 +26,11 @@ public function run(): void 'newsletter_afup' => '1', 'newsletter_nexen' => '0', 'id_forum' => Event::ID_FORUM, + 'member_type' => MemberType::MemberPhysical->value, 'etat' => Ticket::STATUS_PAID, ], [ + 'date' => (new \DateTime("2023-06-25"))->getTimestamp(), 'reference' => 'REF-TEST-002', 'type_inscription' => Ticket::TYPE_2_DAYS, 'montant' => $GLOBALS['AFUP_Tarifs_Forum'][Ticket::TYPE_2_DAYS], @@ -39,9 +43,11 @@ public function run(): void 'newsletter_afup' => '1', 'newsletter_nexen' => '0', 'id_forum' => Event::ID_FORUM, + 'member_type' => MemberType::MemberPhysical->value, 'etat' => Ticket::STATUS_PAID, ], [ + 'date' => (new \DateTime("2024-01-02"))->getTimestamp(), 'reference' => 'REF-TEST-003', 'type_inscription' => Ticket::TYPE_2_DAYS, 'montant' => $GLOBALS['AFUP_Tarifs_Forum'][Ticket::TYPE_2_DAYS], @@ -54,8 +60,79 @@ public function run(): void 'newsletter_afup' => '1', 'newsletter_nexen' => '0', 'id_forum' => Event::ID_FORUM, + 'member_type' => MemberType::MemberPhysical->value, 'etat' => Ticket::STATUS_PAID, ], + [ + 'date' => (new \DateTime("2024-01-02"))->getTimestamp(), + 'reference' => 'REF-TEST-004', + 'type_inscription' => Ticket::TYPE_2_DAYS_AFUP, + 'montant' => $GLOBALS['AFUP_Tarifs_Forum'][Ticket::TYPE_2_DAYS_AFUP], + 'civilite' => 'Mme', + 'nom' => 'Sans', + 'prenom' => 'Cotisation', + 'email' => 'sans@cotisation.fr', + 'telephone' => '0102030406', + 'citer_societe' => '1', + 'newsletter_afup' => '1', + 'newsletter_nexen' => '0', + 'id_forum' => Event::ID_FORUM, + 'member_type' => MemberType::MemberPhysical->value, + 'etat' => Ticket::STATUS_PAID, + ], + [ + 'date' => time(), + 'reference' => 'REF-TEST-005', + 'type_inscription' => Ticket::TYPE_2_DAYS_AFUP, + 'montant' => $GLOBALS['AFUP_Tarifs_Forum'][Ticket::TYPE_2_DAYS_AFUP], + 'civilite' => 'M', + 'nom' => 'Personne', + 'prenom' => 'Paul', + 'email' => 'paul.personne@mycorp.fr', + 'telephone' => '0102030406', + 'citer_societe' => '1', + 'newsletter_afup' => '1', + 'newsletter_nexen' => '0', + 'id_forum' => Event::ID_FORUM, + 'id_member' => Users::ID_USER_PERSONNE_PHYSIQUE, + 'member_type' => MemberType::MemberPhysical->value, + 'etat' => Ticket::STATUS_PAID, + ], + [ + 'date' => time(), + 'reference' => 'REF-TEST-006', + 'type_inscription' => Ticket::TYPE_2_DAYS_AFUP, + 'montant' => $GLOBALS['AFUP_Tarifs_Forum'][Ticket::TYPE_2_DAYS_AFUP], + 'civilite' => 'M', + 'nom' => 'Maurice', + 'prenom' => 'Jean', + 'email' => 'userexpire@yahoo.fr', + 'telephone' => '0102030406', + 'citer_societe' => '1', + 'newsletter_afup' => '1', + 'newsletter_nexen' => '0', + 'id_forum' => Event::ID_FORUM, + 'id_member' => Users::ID_USER_EXPIRIE, + 'member_type' => MemberType::MemberPhysical->value, + 'etat' => Ticket::STATUS_PAID, + ], + [ + 'date' => time(), + 'reference' => 'REF-TEST-007', + 'type_inscription' => Ticket::TYPE_2_DAYS, + 'montant' => $GLOBALS['AFUP_Tarifs_Forum'][Ticket::TYPE_2_DAYS], + 'civilite' => 'Mme', + 'nom' => 'Annulé', + 'prenom' => 'Lepaiement', + 'email' => 'annule@example.com', + 'telephone' => '0601020304', + 'citer_societe' => '1', + 'newsletter_afup' => '1', + 'newsletter_nexen' => '0', + 'id_forum' => Event::ID_FORUM, + 'member_type' => MemberType::MemberPhysical->value, + 'etat' => Ticket::STATUS_CANCELLED, + ], ]; $table = $this->table('afup_inscription_forum'); @@ -76,6 +153,7 @@ public function run(): void 'email' => 'bernadette@yahoo.fr', 'nom' => 'Michu', 'prenom' => 'Bernadette', + 'societe' => 'Helios Aerospace', 'adresse' => '3 rue du chemin', 'code_postal' => '99002', 'ville' => 'Ville', @@ -91,7 +169,7 @@ public function run(): void 'reference' => 'REF-TEST-002', 'montant' => $GLOBALS['AFUP_Tarifs_Forum'][Ticket::TYPE_2_DAYS], 'date_reglement' => (new \DateTime("2023-06-25"))->getTimestamp(), - 'type_reglement' => Ticket::PAYMENT_CREDIT_CARD, + 'type_reglement' => Ticket::PAYMENT_CHEQUE, 'email' => 'jean@yahoo.fr', 'nom' => 'Jean', 'prenom' => 'Maurice', @@ -110,7 +188,7 @@ public function run(): void 'reference' => 'REF-TEST-003', 'montant' => $GLOBALS['AFUP_Tarifs_Forum'][Ticket::TYPE_2_DAYS], 'date_reglement' => (new \DateTime("2024-01-02"))->getTimestamp(), - 'type_reglement' => Ticket::PAYMENT_CREDIT_CARD, + 'type_reglement' => Ticket::PAYMENT_BANKWIRE, 'email' => 'james@starfleet.fr', 'nom' => 'Kirk', 'prenom' => 'James Tiberius', @@ -125,6 +203,82 @@ public function run(): void 'id_forum' => Event::ID_FORUM, 'date_facture' => (new \DateTime("2024-01-02"))->getTimestamp(), ], + [ + 'reference' => 'REF-TEST-004', + 'montant' => $GLOBALS['AFUP_Tarifs_Forum'][Ticket::TYPE_2_DAYS_AFUP], + 'date_reglement' => (new \DateTime("2024-01-02"))->getTimestamp(), + 'type_reglement' => Ticket::PAYMENT_CREDIT_CARD, + 'email' => 'sans@cotisation.fr', + 'nom' => 'Sans', + 'prenom' => 'Cotisation', + 'adresse' => "3 avenue de l'enterprise", + 'code_postal' => '69003', + 'ville' => 'Lyon', + 'id_pays' => 'FR', + 'autorisation' => 'ozzbfksgvz', + 'transaction' => 'yaedskem', + 'etat' => Ticket::STATUS_PAID, + 'facturation' => 1, + 'id_forum' => Event::ID_FORUM, + 'date_facture' => (new \DateTime("2024-01-02"))->getTimestamp(), + ], + [ + 'reference' => 'REF-TEST-005', + 'montant' => $GLOBALS['AFUP_Tarifs_Forum'][Ticket::TYPE_2_DAYS_AFUP], + 'date_reglement' => (new \DateTime("2024-01-02"))->getTimestamp(), + 'type_reglement' => Ticket::PAYMENT_CREDIT_CARD, + 'nom' => 'Personne', + 'prenom' => 'Paul', + 'email' => 'paul.personne@mycorp.fr', + 'adresse' => "3 avenue de l'enterprise", + 'code_postal' => '69003', + 'ville' => 'Lyon', + 'id_pays' => 'FR', + 'autorisation' => 'ozzbfksgvz', + 'transaction' => 'yaedskem', + 'etat' => Ticket::STATUS_PAID, + 'facturation' => 1, + 'id_forum' => Event::ID_FORUM, + 'date_facture' => (new \DateTime("2024-01-02"))->getTimestamp(), + ], + [ + 'reference' => 'REF-TEST-006', + 'montant' => $GLOBALS['AFUP_Tarifs_Forum'][Ticket::TYPE_2_DAYS_AFUP], + 'date_reglement' => (new \DateTime("2024-01-02"))->getTimestamp(), + 'type_reglement' => Ticket::PAYMENT_CREDIT_CARD, + 'nom' => 'Maurice', + 'prenom' => 'Jean', + 'email' => 'userexpire@yahoo.fr', + 'adresse' => "3 avenue de l'enterprise", + 'code_postal' => '69003', + 'ville' => 'Lyon', + 'id_pays' => 'FR', + 'autorisation' => 'ozzbfksgvz', + 'transaction' => 'yaedskem', + 'etat' => Ticket::STATUS_PAID, + 'facturation' => 1, + 'id_forum' => Event::ID_FORUM, + 'date_facture' => (new \DateTime("2024-01-02"))->getTimestamp(), + ], + [ + 'reference' => 'REF-TEST-007', + 'montant' => $GLOBALS['AFUP_Tarifs_Forum'][Ticket::TYPE_2_DAYS], + 'date_reglement' => time(), + 'type_reglement' => Ticket::PAYMENT_CREDIT_CARD, + 'nom' => 'Annulé', + 'prenom' => 'Lepaiement', + 'email' => 'annule@example.com', + 'adresse' => '3 rue du chemin', + 'code_postal' => '99002', + 'ville' => 'Ville', + 'id_pays' => 'FR', + 'autorisation' => 'otzbfksgve', + 'transaction' => 'taedsken', + 'etat' => Ticket::STATUS_CANCELLED, + 'facturation' => 0, + 'id_forum' => Event::ID_FORUM, + 'date_facture' => time(), + ], ]; $table = $this->table('afup_facturation_forum'); diff --git a/htdocs/pages/administration/forum_inscriptions.php b/htdocs/pages/administration/forum_inscriptions.php index 9ddd85c76..0d90dc83b 100644 --- a/htdocs/pages/administration/forum_inscriptions.php +++ b/htdocs/pages/administration/forum_inscriptions.php @@ -130,9 +130,9 @@ function updateGlobalsForTarif( $invoice = $invoiceRepository->getByReference($_GET['id']); if ($forum_inscriptions->supprimerInscription($_GET['id']) && (null === $invoice || $invoiceService->deleteInvoice($invoice))) { Logs::log('Suppression de l\'inscription ' . $_GET['id']); - afficherMessage('L\'inscription a été supprimée', 'index.php?page=forum_inscriptions&action=lister'); + afficherMessage('L\'inscription a été supprimée', '/admin/event/tickets?id=' . $_GET['id_forum']); } else { - afficherMessage('Une erreur est survenue lors de la suppression de l\'inscription', 'index.php?page=forum_inscriptions&action=lister', true); + afficherMessage('Une erreur est survenue lors de la suppression de l\'inscription', '/admin/event/tickets?id=' . $_GET['id_forum'], true); } } else { @@ -154,7 +154,7 @@ function updateGlobalsForTarif( } else { $champs = $forum_inscriptions->obtenir($_GET['id']); if ($champs == false) { - afficherMessage('L\'inscription n\'existe plus', 'index.php?page=forum_inscriptions&action=lister'); + afficherMessage('L\'inscription n\'existe plus', '/admin/event/tickets?id=' . $_GET['id_forum']); exit(0); } $champs2 = $forum_facturation->obtenir($champs['reference']); @@ -409,7 +409,7 @@ function updateGlobalsForTarif( } else { Logs::log('Modification de l\'inscription de ' . $formulaire->exportValue('prenom') . ' ' . $formulaire->exportValue('nom') . ' (' . $_GET['id'] . ')'); } - afficherMessage('L\'inscription a été ' . (($action == 'ajouter') ? 'ajoutée' : 'modifiée'), 'index.php?page=forum_inscriptions&action=lister&id_forum=' . $valeurs['id_forum']); + afficherMessage('L\'inscription a été ' . (($action == 'ajouter') ? 'ajoutée' : 'modifiée'), '/admin/event/tickets?id=' . $_GET['id_forum']); } else { $smarty->assign('erreur', 'Une erreur est survenue lors de ' . (($action == 'ajouter') ? "l'ajout" : 'la modification') . ' de l\'inscription'); } diff --git a/sources/AppBundle/Controller/Admin/Event/Ticket/IndexAction.php b/sources/AppBundle/Controller/Admin/Event/Ticket/IndexAction.php new file mode 100644 index 000000000..a7b864a01 --- /dev/null +++ b/sources/AppBundle/Controller/Admin/Event/Ticket/IndexAction.php @@ -0,0 +1,119 @@ +addFlash('notice', $_SESSION['flash']['message']); + } + if (isset($_SESSION['flash']['erreur'])) { + $this->addFlash('error', $_SESSION['flash']['erreur']); + } + unset($_SESSION['flash']); + + + $event = $eventSelection->event; + $data = [ + 'id' => $event->getId(), + ]; + $filterForm = $this->filterForm($data); + $filterForm->handleRequest($request); + + if ($filterForm->isSubmitted() && $filterForm->isValid()) { + $data = $filterForm->getData(); + $data = array_filter($data); + } + $data['sort_key'] ??= 'date'; + $data['sort_direction'] ??= 'desc'; + + $statistics = $this->eventStatsRepository->getStats($event->getId()); + $tickets = $this->ticketRepository->getByEventWithAll( + event: $event, + search: $data['filter'] ?? null, + sortKey: $data['sort_key'], + sortDirection: $data['sort_direction'], + ); + $computed = $this->computeStatistics($statistics, $event); + + return $this->render('admin/event/ticket/index.html.twig', [ + 'event' => $event, + 'event_select_form' => $eventSelection->selectForm(), + 'statistics' => $statistics, + 'tickets' => $tickets, + 'computed' => $computed, + 'filter_form' => $filterForm, + 'filter' => $data, + ]); + } + + private function computeStatistics(EventStats $statistics, Event $event): array + { + $computed = []; + $offers = $this->ticketOffer->getAllOffersForEvent($event); + + foreach ($offers as $ticketType => $ticketOffer) { + + $registered = $statistics->ticketType->registered[$ticketType] ?? 0; + $confirmed = $statistics->ticketType->confirmed[$ticketType] ?? 0; + $paying = $statistics->ticketType->paying[$ticketType] ?? 0; + $amount = $paying * $ticketOffer->price; + + if ($registered) { + $computed[$ticketType] = [ + 'label' => $ticketOffer->name, + 'registered' => $registered, + 'confirmed' => $confirmed, + 'paying' => $paying, + 'amount' => $ticketOffer->price, + 'payingAmount' => $amount, + 'availableTickets' => $ticketOffer->availableTickets, + ]; + } + } + + return $computed; + } + + private function filterForm(array $data): FormInterface + { + return $this->formFactory->createNamedBuilder('', FormType::class, $data, [ + 'csrf_protection' => false, + ]) + ->setMethod('GET') + ->add('filter', TextType::class, ['required' => false]) + ->add('id', HiddenType::class, ['required' => false]) + ->add('sort_key', HiddenType::class, ['required' => false]) + ->add('sort_direction', HiddenType::class, ['required' => false]) + ->add('submit', SubmitType::class) + ->getForm(); + } +} diff --git a/sources/AppBundle/Controller/Admin/Talk/IndexAction.php b/sources/AppBundle/Controller/Admin/Talk/IndexAction.php index 3e7b22f2e..3f49f87ef 100644 --- a/sources/AppBundle/Controller/Admin/Talk/IndexAction.php +++ b/sources/AppBundle/Controller/Admin/Talk/IndexAction.php @@ -44,7 +44,7 @@ public function __invoke(Request $request, AdminEventSelection $eventSelection): $sessions = $this->talkRepository->getByEventWithSpeakersAndVotes( event: $event, - search: $data['q'] ?? '', + search: $data['filter'] ?? '', orderBy: $data['sort_key'] . ' ' . $data['sort_direction'], planned: $data['planned'] ?? false, needMentoring: $data['needs_mentoring'] ?? false, @@ -65,7 +65,7 @@ private function filterForm(array $data): FormInterface 'csrf_protection' => false, ]) ->setMethod('GET') - ->add('q', TextType::class, ['required' => false]) + ->add('filter', TextType::class, ['required' => false]) ->add('needs_mentoring', CheckboxType::class, ['required' => false]) ->add('planned', CheckboxType::class, ['required' => false]) ->add('id', HiddenType::class, ['required' => false]) diff --git a/sources/AppBundle/Event/Model/Repository/TicketRepository.php b/sources/AppBundle/Event/Model/Repository/TicketRepository.php index a61b17f1c..5e1168f15 100644 --- a/sources/AppBundle/Event/Model/Repository/TicketRepository.php +++ b/sources/AppBundle/Event/Model/Repository/TicketRepository.php @@ -7,6 +7,7 @@ use AppBundle\Event\Model\Event; use AppBundle\Event\Model\Invoice; use AppBundle\Event\Model\Ticket; +use AppBundle\Event\Model\TicketAggregate; use AppBundle\Event\Model\TicketType; use CCMBenchmark\Ting\Driver\Mysqli\Serializer\Boolean; use CCMBenchmark\Ting\Query\QueryException; @@ -181,6 +182,67 @@ public function getByEvent(Event $event): CollectionInterface ; } + /** + * @return array + */ + public function getByEventWithAll(Event $event, ?string $search, ?string $sortKey, ?string $sortDirection): array + { + $sql = 'SELECT ticket.*, aff.*, aft.*, + CASE WHEN ticket.id_member IS NOT NULL + THEN (SELECT MAX(ac.date_fin) AS last_subscription + FROM afup_cotisations ac + WHERE ac.type_personne = ticket.member_type AND ac.id_personne = ticket.id_member) + ELSE (SELECT MAX(ac.date_fin) AS last_subscription + FROM afup_personnes_physiques app + LEFT JOIN afup_personnes_morales apm ON apm.id = app.id_personne_morale + LEFT JOIN afup_cotisations ac ON ac.type_personne = IF(apm.id IS NULL, 0, 1) AND ac.id_personne = IFNULL(apm.id, app.id) + WHERE app.email = ticket.email + GROUP BY app.id) + END AS last_subscription + FROM afup_inscription_forum AS ticket + LEFT JOIN afup_facturation_forum aff ON ticket.reference = aff.reference + LEFT JOIN afup_forum_tarif_event afte ON afte.id_tarif = ticket.type_inscription AND afte.id_event = ticket.id_forum + LEFT JOIN afup_forum_tarif aft ON aft.id = afte.id_tarif + WHERE %s + ORDER BY %s'; + + $andWhere = 'ticket.id_forum = :id_forum'; + $params = ['id_forum' => $event->getId()]; + + if ($search) { + $andWhere .= ' AND (LOWER(CONCAT(ticket.nom, ticket.prenom)) LIKE :q + OR LOWER(CONCAT(ticket.prenom, ticket.nom)) LIKE :q + OR LOWER(aff.societe) LIKE :q)'; + $params['q'] = '%' . strtolower($search) . '%'; + } + + $column = match ($sortKey) { + 'label' => 'ticket.nom', + 'company' => 'aff.societe', + 'ticketType' => 'aft.id', + 'ticketStatus' => 'ticket.etat', + default => 'ticket.date', + }; + $orderBy = $column . ' ' . $sortDirection; + + $result = $this->getPreparedQuery(sprintf($sql, $andWhere, $orderBy)) + ->setParams($params) + ->query(); + + $aggregates = []; + + foreach ($result as $row) { + $aggregates[] = new TicketAggregate( + $row['ticket'], + $row['aft'], + $row['aff'], + $row[0]->last_subscription ? new \DateTimeImmutable('@' . $row[0]->last_subscription) : null, + ); + } + + return $aggregates; + } + /** * @return CollectionInterface&iterable */ diff --git a/sources/AppBundle/Event/Model/TicketAggregate.php b/sources/AppBundle/Event/Model/TicketAggregate.php new file mode 100644 index 000000000..f9c36f19d --- /dev/null +++ b/sources/AppBundle/Event/Model/TicketAggregate.php @@ -0,0 +1,15 @@ + + */ + public function getAllOffersForEvent(Event $event): array + { + global $AFUP_Tarifs_Forum, $AFUP_Tarifs_Forum_Lib; + + $ticketTypes = $this->ticketEventTypeRepository->getTicketsByEvent($event, false); + + $offers = []; + foreach ($AFUP_Tarifs_Forum as $ticketType => $ticketPrice) { + $offers[$ticketType] = new TicketOffer( + (int) $ticketType, + $AFUP_Tarifs_Forum_Lib[$ticketType], + $ticketPrice, + $event->getSeats(), + $event, + ); + } + + foreach ($ticketTypes as $ticketType) { + $offers[$ticketType->getTicketTypeId()] = new TicketOffer( + $ticketType->getTicketTypeId(), + $ticketType->getTicketType()->getPrettyName(), + $ticketType->getPrice(), + $this->ticketTypeAvailability->getStock($ticketType, $event), + $event, + ); + } + + return $offers; + } + +} diff --git a/templates/admin/event/ticket/index.html.twig b/templates/admin/event/ticket/index.html.twig new file mode 100644 index 000000000..d94fda6a9 --- /dev/null +++ b/templates/admin/event/ticket/index.html.twig @@ -0,0 +1,151 @@ +{% extends 'admin/base_with_header.html.twig' %} + +{% block content %} +

Inscriptions

+ {% include 'admin/event/change_event.html.twig' with {form: event_select_form} only %} + + + + {% include 'admin/event/ticket/statistics.html.twig' with {computed: computed, statistics: statistics} only %} + +
+ {% form_theme filter_form 'form_theme_admin_filter.html.twig' %} + {{ form_start(filter_form) }} +
+
+ {{ form_row(filter_form.filter, {label: 'Recherche'}) }} + {{ form_row(filter_form.submit, {label: 'Filtrer'}) }} +
+
+ {{ form_end(filter_form) }} + + {% set sort_direction = filter.sort_direction == 'asc' ? 'desc' : 'asc'%} + + + + + + + + + + + + + + + {% for a in tickets %} + + + + + + + + + + + {% endfor %} + +
DateNom PrénomSociété (facturation)TypeÉtatRèg.Statut cotisation
(tarif AFUP)
 
{{ a.ticket.date|date('d/m/Y H:i') }} + {{ a.ticket.lastname }} {{ a.ticket.firstname }} + + + + + {{ a.invoice.company }} + + + + {{ a.ticketType.prettyName }} + {% if a.ticket.status == 0 %} + Créé + {% elseif a.ticket.status == 1 %} + Annulé + {% elseif a.ticket.status == 2 %} + Erreur + {% elseif a.ticket.status == 3 %} + Refusé + {% elseif a.ticket.status == 4 %} + Réglé + {% elseif a.ticket.status == 5 %} + Invité + {% elseif a.ticket.status == 6 %} + Attente règlement + {% elseif a.ticket.status == 7 %} + Facturé + {% endif %} + + {% if a.invoice.paymentType == constant('AppBundle\\Event\\Model\\Ticket::PAYMENT_CREDIT_CARD') %} + CB + {% elseif a.invoice.paymentType == constant('AppBundle\\Event\\Model\\Ticket::PAYMENT_CHEQUE') %} + CHQ + {% elseif a.invoice.paymentType == constant('AppBundle\\Event\\Model\\Ticket::PAYMENT_BANKWIRE')%} + VIR + {% endif %} + + {% if a.ticketType.isRestrictedToMembers %} + {% if a.lastSubscription == null %} + Non trouvée + {% elseif a.lastSubscription < 'now'|date('U') %} + À expiré le {{ a.lastSubscription|date('d/m/Y') }} + + URL Paiement + + {% elseif a.lastSubscription < event.dateEnd %} + Expiré le {{ a.lastSubscription|date('d/m/Y') }} + + URL Paiement + + {% else %} + OK + {% endif %} + {% else %} + n/a + {% endif %} + + + + + + + + +
+
+ + +{% endblock %} \ No newline at end of file diff --git a/templates/admin/event/ticket/statistics.html.twig b/templates/admin/event/ticket/statistics.html.twig new file mode 100644 index 000000000..1001cf102 --- /dev/null +++ b/templates/admin/event/ticket/statistics.html.twig @@ -0,0 +1,74 @@ +
+ + + + + + + + + + + + + + {% set registered = 0 %} + {% set confirmed = 0 %} + {% set paying = 0 %} + {% set payingAmount = 0 %} + {% for ticket in computed %} + {% set registered = registered + ticket.registered %} + {% set confirmed = confirmed + ticket.confirmed %} + {% set paying = paying + ticket.paying %} + {% set payingAmount = payingAmount + ticket.payingAmount %} + + + + + + + + + + {% endfor %} + + + + + + + + + + + + +
TypeTarifNb. inscritsNb. confirmésNb. payantsMontantPlaces restantes
+ {{ ticket.label }} + {{ ticket.amount }} €{{ ticket.registered }}{{ ticket.confirmed }}{{ ticket.paying }}{{ ticket.payingAmount }} €{{ ticket.availableTickets }}
{{ registered }}{{ confirmed }}{{ paying }}{{ payingAmount }} €
+ + + + + + + + + + + + + + + + + + + + + + + + +
InscritsConfirmésEn attente de règlement
Jour 1{{ statistics.firstDay.registered }}{{ statistics.firstDay.confirmed }}{{ statistics.firstDay.pending }}
Jour 2{{ statistics.secondDay.registered }}{{ statistics.secondDay.confirmed }}{{ statistics.secondDay.pending }}
+
\ No newline at end of file diff --git a/templates/admin/talk/index.html.twig b/templates/admin/talk/index.html.twig index 35152a976..13fda432d 100644 --- a/templates/admin/talk/index.html.twig +++ b/templates/admin/talk/index.html.twig @@ -42,7 +42,7 @@ {{ form_start(filter_form) }}
- {{ form_row(filter_form.q, {label: 'Titre'}) }} + {{ form_row(filter_form.filter, {label: 'Titre'}) }} {{ form_row(filter_form.needs_mentoring, {label: 'Afficher seulement les conférences dont le speaker a demandé un accompagnement'}) }} {{ form_row(filter_form.planned, {label: 'Afficher seulement les conférences plannifiées'}) }} {{ form_row(filter_form.submit, {label: 'Filtrer'}) }} diff --git a/tests/behat/features/Admin/Events/Conferences.feature b/tests/behat/features/Admin/Events/Conferences.feature index 2a8155938..cb22925b2 100644 --- a/tests/behat/features/Admin/Events/Conferences.feature +++ b/tests/behat/features/Admin/Events/Conferences.feature @@ -12,7 +12,7 @@ Feature: Administration - Évènements - Conférences And the "table" element should contain "Moy. notes" And the "table" element should contain "Nb. notes" And the "table" element should contain "Soumission" - When I fill in "q" with "Jouons" + When I fill in "filter" with "Jouons" And I press "Filtrer" Then I should see "1 CONFÉRENCE(S)" diff --git a/tests/behat/features/Admin/Events/FacturesEvennement.feature b/tests/behat/features/Admin/Events/FacturesEvennement.feature index 910baf14d..9763869fe 100644 --- a/tests/behat/features/Admin/Events/FacturesEvennement.feature +++ b/tests/behat/features/Admin/Events/FacturesEvennement.feature @@ -7,7 +7,7 @@ Feature: Administration - Évènements - Factures d'évènement Then the ".content h2" element should contain "Factures d'évènement" And the ".content table" element should contain "REF-TEST-001" When I follow "devis_REF-TEST-001" - Then the response header "Content-disposition" should match '#attachment; filename="Devis - Michu Bernadette - (.*).pdf"#' + Then the response header "Content-disposition" should match '#attachment; filename="Devis - Helios Aerospace - (.*).pdf"#' @reloadDbWithTestData @vat @@ -25,12 +25,13 @@ Feature: Administration - Évènements - Factures d'évènement Then The page "1" of the PDF should contain "2 Jours Maurice Jean 250 €" Then The page "1" of the PDF should not contain "Total HT" Then The page "1" of the PDF should not contain "Total TVA" - Then The page "1" of the PDF should contain "TOTAL 250 €" + Then The page "1" of the PDF should contain "FRAIS Paiement par chèque 25 €" + Then The page "1" of the PDF should contain "TOTAL 275 €" Then The page "1" of the PDF should not contain "Total TTC" - Then The page "1" of the PDF should contain "Payé par CB le 25/06/2023" + Then The page "1" of the PDF should contain "Payé par chèque le 25/06/2023" Then The page "1" of the PDF should contain "TVA non applicable - art. 293B du CGI" Then The page "1" of the PDF should not contain "TOTAL TTC 250 €" - Then the checksum of the response content should be "7ee7e977465db7d540cbd4b4d1e31061" + Then the checksum of the response content should be "c0469956c7972c51a16f9a03604bfd13" @reloadDbWithTestData @vat @@ -49,10 +50,10 @@ Feature: Administration - Évènements - Factures d'évènement Then The page "1" of the PDF should contain "Total HT 227,27 €" Then The page "1" of the PDF should contain "Total TVA 10% 22,73 €" Then The page "1" of the PDF should contain "TOTAL TTC 250,00 €" - Then The page "1" of the PDF should contain "Payé par CB le 02/01/2024" + Then The page "1" of the PDF should contain "Payé par virement le 02/01/2024" Then The page "1" of the PDF should not contain "TVA non applicable - art. 293B du CGI" Then The page "1" of the PDF should contain "Numéro de TVA intracommunautaire FR27 500 869 011" - Then the checksum of the response content should be "50c90902d9702d79a93550fa8b93f3fd" + Then the checksum of the response content should be "5689b814512a03e2b420272a3fb0711a" @reloadDbWithTestData @clearEmails @@ -74,7 +75,7 @@ Feature: Administration - Évènements - Factures d'évènement And I follow "Factures d'évènement" When I follow "facture_REF-TEST-001" And I follow "telecharger_REF-TEST-001" - Then the response header "Content-disposition" should match '#attachment; filename="Facture - Michu Bernadette - (.*).pdf"#' + Then the response header "Content-disposition" should match '#attachment; filename="Facture - Helios Aerospace - (.*).pdf"#' @reloadDbWithTestData Scenario: On peut supprimer la facture diff --git a/tests/behat/features/Admin/Events/Inscriptions.feature b/tests/behat/features/Admin/Events/Inscriptions.feature index bdf13108c..54ca8f370 100644 --- a/tests/behat/features/Admin/Events/Inscriptions.feature +++ b/tests/behat/features/Admin/Events/Inscriptions.feature @@ -1,7 +1,45 @@ Feature: Administration - Évènements - Inscriptions @reloadDbWithTestData - Scenario: Accès à la liste puis ajout d'une inscription + Scenario: Statistiques des inscriptions + Given I am logged in as admin and on the Administration + And I follow "Inscriptions" + Then the ".content h2" element should contain "Inscriptions" + And I should see "Type Tarif Nb. inscrits Nb. confirmés Nb. payants Montant Places restantes" + And I should see "2 Jours 250 € 3 3 3 750 € 494" + And I should see "2 Jours AFUP 15 € 3 3 3 45 € 494" + And I should see "Inscrits Confirmés En attente de règlement" + And I should see "Jour 1 6 6 0" + And I should see "Jour 2 6 6 0" + + @reloadDbWithTestData + Scenario: Accès à la liste des inscriptions + Given I am logged in as admin and on the Administration + And I follow "Inscriptions" + Then the ".content h2" element should contain "Inscriptions" + And I should see "Michu Bernadette Helios Aerospace 2 Jours Réglé CB n/a" + And I should see "Personne Paul 2 Jours AFUP Réglé CB OK" + And I should see "Maurice Jean 2 Jours AFUP Réglé CB Expiré le 08/07/2019 URL Paiement" + And I should see "Annulé Lepaiement 2 Jours Annulé CB n/a" + And I should see "Kirk James Tiberius 2 Jours Réglé VIR n/a" + And I should see "Sans Cotisation 2 Jours AFUP Réglé CB Non trouvée" + + @reloadDbWithTestData + Scenario: Filtrer la la liste des inscriptions + Given I am logged in as admin and on the Administration + And I follow "Inscriptions" + Then the ".content h2" element should contain "Inscriptions" + When I fill in "filter" with "Personne" + And I press "Filtrer" + And I should not see "Michu Bernadette Helios Aerospace 2 Jours Réglé CB n/a" + And I should see "Personne Paul 2 Jours AFUP Réglé CB OK" + And I should not see "Maurice Jean 2 Jours AFUP Réglé CB Expiré le 08/07/2019 URL Paiement" + And I should not see "Annulé Lepaiement 2 Jours Annulé CB n/a" + And I should not see "Kirk James Tiberius 2 Jours Réglé VIR n/a" + And I should not see "Sans Cotisation 2 Jours AFUP Réglé CB Non trouvée" + + @reloadDbWithTestData + Scenario: Ajout d'une inscription Given I am logged in as admin and on the Administration And I follow "Inscriptions" Then the ".content h2" element should contain "Inscriptions" @@ -16,7 +54,7 @@ Feature: Administration - Évènements - Inscriptions And I press "Soumettre" Then I should see "L'inscription a été ajoutée" And I should see "Inscriptions" - And I should see "Prénom participant Nom participant" + And I should see "Nom participant Prénom participant" # Bug sur cet export à reprendre une fois celui-ci corrigé # Scenario: Export CSV: Inscription