diff --git a/src/BusProNet/Model/Booking.php b/src/BusProNet/Model/Booking.php index 0bebd2b..54d6829 100644 --- a/src/BusProNet/Model/Booking.php +++ b/src/BusProNet/Model/Booking.php @@ -19,7 +19,7 @@ class Booking public ?Travel $travelData = null; public ?int $hotelId = null; public ?string $hotelName = null; - public ?bool $document = null; + public bool $hasDocuments = false; public ?float $payment = null; public ?string $paymentId = null; public ?string $paymentType = null; diff --git a/src/BusProNet/XmlParser/BookingsParser.php b/src/BusProNet/XmlParser/BookingsParser.php index 7775fa8..cc56a58 100644 --- a/src/BusProNet/XmlParser/BookingsParser.php +++ b/src/BusProNet/XmlParser/BookingsParser.php @@ -31,10 +31,12 @@ class BookingsParser extends AbstractParser $booking->travelId = $this->getIntOrNullValue($node->filterXPath('//idreise')); $booking->travelDate = $this ->stringToDate($this->getStringOrNullValue($node->filterXPath('//reisedatum'))); - $booking->document = $this + $booking->hasDocuments = $this ->stringToBool($this->getStringOrNullValue($node->filterXPath('//reisedokument'))); $booking->payment = $this ->stringToFloat($this->getStringOrNullValue($node->filterXPath('//zahlung'))); + $booking->hasDocuments = $this + ->stringToBool($this->getStringOrNullValue($node->filterXPath('//reisedokument'))); $bookings[] = $booking; }); diff --git a/templates/booking/index.html.twig b/templates/booking/index.html.twig index b2e1050..fd30b89 100644 --- a/templates/booking/index.html.twig +++ b/templates/booking/index.html.twig @@ -4,6 +4,7 @@

Meine Buchungen

+ {% include '_partials/_flashes.html.twig' %} @@ -70,13 +71,17 @@ {% endif %} + class="button bg-button button--small" + target="_blank"> Bestätigung - - Reisedokumente - + {% if booking.hasDocuments %} + + Reisedokumente + + {% endif %}