diff --git a/trunk/app/Resources/views/default/email/components/bookingSummary.txt.twig b/trunk/app/Resources/views/default/email/components/bookingSummary.txt.twig index 4259d2a6..6e3833ce 100644 --- a/trunk/app/Resources/views/default/email/components/bookingSummary.txt.twig +++ b/trunk/app/Resources/views/default/email/components/bookingSummary.txt.twig @@ -42,6 +42,14 @@ Nicht eingeschlossene, zubuchbare Leistungen: [o] {{ travel_program_service|raw }} {% endfor %} +===================================================================================== +Reise-Rücktrittskosten-Versicherung: +===================================================================================== +{% if(booking_request.travelCancellation == 1) %} + [x] Informationen angefordert +{% else %} + [o] Keine Informationen gewünscht +{% endif %} ===================================================================================== Reiseanmelder{% if booking_request.salutation == 2 %}in{% endif %} diff --git a/trunk/app/Resources/views/default/pages/booking.html.twig b/trunk/app/Resources/views/default/pages/booking.html.twig index f1e7e719..ae4a629a 100644 --- a/trunk/app/Resources/views/default/pages/booking.html.twig +++ b/trunk/app/Resources/views/default/pages/booking.html.twig @@ -110,27 +110,23 @@ {{ form_errors(form.tripleRoomCount) }} - + + + Reiseversicherung -
- - + {% if form.travelCancellation is defined %} +
+ {{ form_widget(form.travelCancellation) }} +
- - {% for insuranceForm in form.insurance %} - {% include 'default/components/booking/insurance.html.twig' with { - 'form': insuranceForm, - 'insurance': form.insurance.vars.choices[insuranceForm.vars.value].data - } %} - {% endfor %} - - {{ form_errors(form.insurance) }} + {% endif %} + + Zubuchbare Leistungen diff --git a/trunk/src/AppBundle/Controller/BookingController.php b/trunk/src/AppBundle/Controller/BookingController.php index 4c5a8331..f81715a9 100644 --- a/trunk/src/AppBundle/Controller/BookingController.php +++ b/trunk/src/AppBundle/Controller/BookingController.php @@ -79,6 +79,7 @@ class BookingController extends Controller $bookingPriceInfo = []; $totalPrice = $this->calculatePrice($travelDate, $bookingRequest, $htmlSummary, $bookingPriceInfo); + if ($action == '/buchen') { $breadcrumbEntries = Util::createBreadcrumb($travelProgramPage); @@ -92,7 +93,9 @@ class BookingController extends Controller $em->persist($booking); $em->flush(); + $crmBookingUrl = $this->get('app.booking_exporter')->process($bookingRequest, $travelDate, $bookingPriceInfo); + if (!$crmBookingUrl) { $crmBookingUrl = '[CRM-EXPORT FEHLGESCHLAGEN]'; @@ -102,6 +105,7 @@ class BookingController extends Controller $crmBookingUrl = preg_replace('/\\/api/', '', $crmBookingUrl).'/edit'; } + $this->get('mailer')->send(\Swift_Message::newInstance() ->setSubject('Ihr Buchungsauftrag bei STERN TOURS') ->setFrom('stern@stern-tours.de', 'STERN TOURS') @@ -118,6 +122,7 @@ class BookingController extends Controller ) ); + $this->get('mailer')->send(\Swift_Message::newInstance() ->setSubject('BUCHUNG: '. $travelProgram->getTitle() .'('. $travelDate->getName() .')') ->setFrom('stern@stern-tours.de', 'STERN TOURS') @@ -277,6 +282,9 @@ class BookingController extends Controller $possibleRooms = $this->getRooms($travelDate->getPrices(), $persons); + if($bookingRequest->getTravelCancellation()){ + + } if ($bookingRequest->getComfort()) { foreach ($possibleRooms as $room) @@ -349,6 +357,8 @@ class BookingController extends Controller Util::formatPrice($singleFullPrice - $singleDiscountPrice) .' pro Person]' ]; } + /* + Preis für reisekostenversicherung if ($bookingRequest->getInsurance() && $adultCount > 0) { $curAssessmentBasis = $insuranceAssessmentBasis + ($singleDiscountPrice ?? $singleFullPrice); @@ -378,7 +388,7 @@ class BookingController extends Controller 'count' => $adultCount, ]; } - } + }*/ } } diff --git a/trunk/src/AppBundle/Entity/BookingRequest.php b/trunk/src/AppBundle/Entity/BookingRequest.php index 2704994d..7358571a 100644 --- a/trunk/src/AppBundle/Entity/BookingRequest.php +++ b/trunk/src/AppBundle/Entity/BookingRequest.php @@ -39,6 +39,8 @@ class BookingRequest */ private $insurance; + private $travelCancellation; + private $comfort = false; private $travelOptions = []; @@ -257,6 +259,24 @@ class BookingRequest $this->insurance = $insurance; } + /** + * @return mixed + */ + public function getTravelCancellation() + { + return $this->travelCancellation; + } + + /** + * @param mixed $comfort + */ + public function setTravelCancellation($travelCancellation) + { + $this->travelCancellation = $travelCancellation; + } + + + /** * @return mixed */ diff --git a/trunk/src/AppBundle/Entity/TravelBooking.php b/trunk/src/AppBundle/Entity/TravelBooking.php index 9639e566..876de463 100644 --- a/trunk/src/AppBundle/Entity/TravelBooking.php +++ b/trunk/src/AppBundle/Entity/TravelBooking.php @@ -229,6 +229,13 @@ class TravelBooking */ private $insurances; + /** + * @var integer + * + * @ORM\Column(name="travel_cancellation", type="integer", nullable=true) + */ + private $travelCancellation; + /** * @var string * @@ -1054,6 +1061,31 @@ class TravelBooking return $ret; } + /** + * Set travelCancellation + * + * @param string $travelCancellation + * + * @return TravelBooking + */ + public function setTravelCancellation($travelCancellation) + { + $this->travelCancellation = $travelCancellation; + + return $this; + } + + /** + * Get travelCancellation + * + * @return string + */ + public function getTravelCancellation() + { + return $this->travelCancellation; + } + + /** * Set options * diff --git a/trunk/src/AppBundle/Entity/TravelBookingRepository.php b/trunk/src/AppBundle/Entity/TravelBookingRepository.php index 399cabcc..3cbc2ab8 100644 --- a/trunk/src/AppBundle/Entity/TravelBookingRepository.php +++ b/trunk/src/AppBundle/Entity/TravelBookingRepository.php @@ -40,6 +40,7 @@ class TravelBookingRepository extends \Doctrine\ORM\EntityRepository $ret->setSelectedChild1(0); $ret->setSelectedChild2(0); $ret->setSelectedChild3(0); + /* $insurance = $bookingRequest->getInsurance(); $ret->setInsuranceName($insurance ? $insurance->getName() : '0'); // #TODO Adapted from v2 if (empty($bookingPriceInfo['insurances'])) @@ -58,8 +59,8 @@ class TravelBookingRepository extends \Doctrine\ORM\EntityRepository ]; } $ret->setInsurances($insurances); - } - + }*/ + $ret->setTravelCancellation($bookingRequest->getTravelCancellation()); $ret->setParticipants($bookingRequest->getTravelers()); $ret->setParticipantsTotal($bookingRequest->getTravelerCount()); $ret->setRooms($bookingPriceInfo['rooms']); diff --git a/trunk/src/AppBundle/Form/BookingRequestType.php b/trunk/src/AppBundle/Form/BookingRequestType.php index 665f4883..825c0dea 100644 --- a/trunk/src/AppBundle/Form/BookingRequestType.php +++ b/trunk/src/AppBundle/Form/BookingRequestType.php @@ -171,7 +171,8 @@ class BookingRequestType extends AbstractType )] ]); - $insuranceChoices = []; + /* + $insuranceChoices = []; if ($travelProgram->getInsurance1()) { $insuranceChoices[$travelProgram->getInsurance1()->getName()] = $travelProgram->getInsurance1(); @@ -192,14 +193,17 @@ class BookingRequestType extends AbstractType ] ]); } + */ //$travelDate->getPrices()[0]->getPriceType() + $builder->add('travelCancellation', CheckboxType::class, ['required' => false]); if ($travelDate->hasComfortCategory()) { $builder->add('comfort', CheckboxType::class, ['required' => false]); } + $travelOptions = $travelProgram->getOptions(); if ($travelOptions instanceof Collection) {