feat: offer the accommodation booking PDF download in every status

This commit is contained in:
fromme committed 2026-10-01 08:46:06 +02:00
1 parent 67c0c2fb0c
commit ec10ca3623
4 files changed
+16 -38

No files matched your search

@@ -21,12 +21,8 @@ class PdfController extends AbstractController
#[Route('/admin/accommodation-booking/{id}/pdf', name: 'app_admin_accommodationbooking_pdf')]
public function index(AccommodationBooking $booking): Response
{
if (false === $booking->isConfirmed()) {
$this->addFlash('warning', 'Ein PDF kann nur für bestätigte Buchungen erstellt werden.');
return $this->redirectToRoute('app_admin_accommodationbooking_show', ['id' => $booking->getId()]);
}
// Offered in every status, so the office can check the document before it goes out
// with the confirmation email; it labels itself Angebot or Buchung accordingly.
try {
return $this->pdfGenerator->createDownloadResponse($booking);
} catch (\RuntimeException $e) {