feat: offer the accommodation booking PDF download in every status
This commit is contained in:
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) {
|
||||
|
||||
Reference in new issue
Block a user