diff --git a/migrations/Version20260321220000.php b/migrations/Version20260321220000.php new file mode 100644 index 0000000..9b751f2 --- /dev/null +++ b/migrations/Version20260321220000.php @@ -0,0 +1,26 @@ +addSql('ALTER TABLE billet_order ADD COLUMN IF NOT EXISTS is_invitation BOOLEAN DEFAULT NULL'); + } + + public function down(Schema $schema): void + { + $this->addSql('ALTER TABLE billet_order DROP COLUMN IF EXISTS is_invitation'); + } +} diff --git a/src/Entity/BilletOrder.php b/src/Entity/BilletOrder.php index 7988d24..f28151a 100644 --- a/src/Entity/BilletOrder.php +++ b/src/Entity/BilletOrder.php @@ -37,6 +37,9 @@ class BilletOrder #[ORM\Column(length: 20)] private string $state = self::STATE_VALID; + #[ORM\Column(nullable: true)] + private ?bool $isInvitation = null; + #[ORM\Column(nullable: true)] private ?\DateTimeImmutable $firstScannedAt = null; @@ -129,6 +132,18 @@ class BilletOrder return self::STATE_VALID === $this->state; } + public function isInvitation(): ?bool + { + return $this->isInvitation; + } + + public function setIsInvitation(?bool $isInvitation): static + { + $this->isInvitation = $isInvitation; + + return $this; + } + public function getFirstScannedAt(): ?\DateTimeImmutable { return $this->firstScannedAt; diff --git a/templates/pdf/billet.html.twig b/templates/pdf/billet.html.twig index ae33ba5..c9ab9f5 100644 --- a/templates/pdf/billet.html.twig +++ b/templates/pdf/billet.html.twig @@ -298,9 +298,9 @@ {% if ticket.billet.definedExit %} Sortie definitive {% else %} - Sortie libre + Sortie - Entree illimitee {% endif %} - {% if design %} + {% if ticket.invitation %} {{ inv_title }} {% endif %} @@ -341,9 +341,15 @@ {% endif %}