diff --git a/trunk/app/Resources/views/default/components/header.html.twig b/trunk/app/Resources/views/default/components/header.html.twig index 24d4a65d..140db329 100644 --- a/trunk/app/Resources/views/default/components/header.html.twig +++ b/trunk/app/Resources/views/default/components/header.html.twig @@ -101,7 +101,7 @@
| Raum-Nr. | +Zimmertyp | Geschlecht | Vorname | Nachname | -Geburtsdatum (TT.MM.JJJJ) | +Geburtsdatum | diff --git a/trunk/app/Resources/views/default/pages/bookingConfirmation.html.twig b/trunk/app/Resources/views/default/pages/bookingConfirmation.html.twig index 6295df90..138936b5 100644 --- a/trunk/app/Resources/views/default/pages/bookingConfirmation.html.twig +++ b/trunk/app/Resources/views/default/pages/bookingConfirmation.html.twig @@ -121,7 +121,13 @@ |
|---|---|---|---|---|---|---|
| Anrede | -{{ booking.salutation }} | ++ {% if booking.salutation == 1 %} + Herr + {% elseif booking.salutation == 2 %} + Frau + {% endif %} + | ||||
| Vorname | @@ -203,7 +209,11 @@- {{ participant.sex }} + {% if participant.sex == 1 %} + männlich + {% elseif participant.sex == 2 %} + weiblich + {% endif %} |
{{ participant.firstName }}
diff --git a/trunk/app/Resources/views/default/pages/cms/travelProgram.html.twig b/trunk/app/Resources/views/default/pages/cms/travelProgram.html.twig
index 385482dd..d327ec26 100644
--- a/trunk/app/Resources/views/default/pages/cms/travelProgram.html.twig
+++ b/trunk/app/Resources/views/default/pages/cms/travelProgram.html.twig
@@ -25,7 +25,7 @@
{% endif %}
-
+
@@ -121,11 +127,6 @@
#}
-
-
- PDF herunterladen
-
-
{{ travel_program.htmlDescription|raw|keywords }}
{% if travel_program.advices is not empty %}
diff --git a/trunk/src/AppBundle/Controller/BookingController.php b/trunk/src/AppBundle/Controller/BookingController.php
index de1594ec..0fda1ac8 100644
--- a/trunk/src/AppBundle/Controller/BookingController.php
+++ b/trunk/src/AppBundle/Controller/BookingController.php
@@ -64,9 +64,7 @@ class BookingController extends Controller
$bookingRequest = new BookingRequest();
if ($request->getMethod() != 'POST')
{
- $bookingRequest->setDoubleRoomCount(1);
- $bookingRequest->setRoomCount(2);
- $bookingRequest->setDeparture($travelDate->getDepartures()[0]);
+ $bookingRequest->setRoomCount(0);
}
$form = $this->createForm(BookingRequestType::class, $bookingRequest, [
'travel_date' => $travelDate,
@@ -86,8 +84,6 @@ class BookingController extends Controller
$breadcrumbEntries = Util::createBreadcrumb($travelProgramPage);
$breadcrumbEntries[] = new BreadcrumbEntry('Buchen');
-
-
if ($request->getMethod() == 'POST' && $form->isValid())
{
$booking = $this->getDoctrine()->getRepository('AppBundle:TravelBooking')->createFromBookingRequest(
@@ -95,7 +91,6 @@ class BookingController extends Controller
$em = $this->getDoctrine()->getManager();
$em->persist($booking);
$em->flush();
-
$crmBookingUrl = $this->get('app.booking_exporter')->process($bookingRequest, $travelDate, $bookingPriceInfo);
$crmBookingUrl = preg_replace('/\\/api/', '', $crmBookingUrl) .'/edit';
@@ -133,7 +128,6 @@ class BookingController extends Controller
'text/plain', 'utf-8'
)
);
-
// #TODO This will lead to multiple bookings due to multiple form submission. Redirect instead!
return $this->render('default/pages/bookingConfirmation.html.twig', [
@@ -185,6 +179,15 @@ class BookingController extends Controller
throw new \Exception('Unknow BookingController action: '. $action);
}
+ private function calcNumTravelerLabel($number)
+ {
+ $ret = 0;
+ if($number > 0)
+ $ret = 1;
+
+ return $ret;
+ }
+
public function calculatePrice(TravelDate $travelDate, BookingRequest $bookingRequest, &$outHtmlSummary = null,
&$outPriceInfo = null)
{
@@ -207,29 +210,33 @@ class BookingController extends Controller
$outPriceInfo['classOptions'] = [];
}
- $departure = Util\DepartureUtil::limitIndividualArrivalPrice($bookingRequest->getDeparture(),
- $travelDate->getFlightPrice());
- if (isset($outPriceInfo))
+ if($bookingRequest->getDeparture() != null)
{
- $outPriceInfo['departure'] = $departure;
- }
-
- if ($departure->getExtraCharge() != 0)
- {
- $insuranceAssessmentBasis += $departure->getExtraCharge();
- $a = $travelerCount * $departure->getExtraCharge();
- $ret += $a;
- if (isset($outHtmlSummary))
+ $departure = Util\DepartureUtil::limitIndividualArrivalPrice($bookingRequest->getDeparture(),
+ $travelDate->getFlightPrice());
+ if (isset($outPriceInfo))
{
- $outHtmlSummary[] = [
- 'value' => $a,
- 'label' => ($departure->getExtraCharge() > 0 ? 'Aufschlag' : 'Abzug') .
- ' für Abfahrts-/Abflugort "'. $departure->getName() .'" ['. $travelerCount .' x '.
- Util::formatPrice($departure->getExtraCharge()) .' pro Person]'
- ];
+ $outPriceInfo['departure'] = $departure;
+ }
+
+ if ($departure->getExtraCharge() != 0)
+ {
+ $insuranceAssessmentBasis += $departure->getExtraCharge();
+ $a = $travelerCount * $departure->getExtraCharge();
+ $ret += $a;
+ if (isset($outHtmlSummary))
+ {
+ $outHtmlSummary[] = [
+ 'value' => $a,
+ 'label' => ($departure->getExtraCharge() > 0 ? 'Aufschlag' : 'Abzug') .
+ ' für Abfahrts-/Abflugort "'. $departure->getName() .'" ['. $this->calcNumTravelerLabel($travelerCount) .' x '.
+ Util::formatPrice($departure->getExtraCharge()) .' pro Person]'
+ ];
+ }
}
}
+
foreach ($bookingRequest->getTravelOptions() as $travelOption)
{
$insuranceAssessmentBasis += $travelOption->getPrice();
@@ -239,7 +246,7 @@ class BookingController extends Controller
{
$outHtmlSummary[] = [
'value' => $a,
- 'label' => $travelOption->getName() .' ['. $travelerCount .' x '.
+ 'label' => $travelOption->getName() .' ['. $this->calcNumTravelerLabel($travelerCount) .' x '.
Util::formatPrice($travelOption->getPrice()) .' pro Person]'
];
}
@@ -274,7 +281,7 @@ class BookingController extends Controller
{
$outHtmlSummary[] = [
'value' => $a,
- 'label' => 'Komfort-Kategorie ['. $travelerCount .' x '.
+ 'label' => 'Komfort-Kategorie ['. $this->calcNumTravelerLabel($travelerCount) .' x '.
Util::formatPrice($room['price']->getEffectiveComfortPrice()) .' pro Person]'
];
}
@@ -315,14 +322,14 @@ class BookingController extends Controller
if (isset($outHtmlSummary))
{
- $label = $room['priceType']->getName() .' ['. $adultCount .' x '.
+ $label = $room['priceType']->getName() .' ['. $this->calcNumTravelerLabel($adultCount) .' x '.
Util::formatPrice($singleFullPrice) .' pro Person]';
if ($room['persons']['children'] != 0)
{
- $label .= ', Kinder: '. $room['persons']['children'] .' x '.
+ $label .= ', Kinder: '. $this->calcNumTravelerLabel($room['persons']['children']) .' x '.
Util::formatPrice($room['price']->getEffectiveChildPrice()) .'';
+ $label .= ']';
}
- $label .= ']';
$outHtmlSummary[] = [
'value' => $roomPrice,
'label' => $label
@@ -331,7 +338,7 @@ class BookingController extends Controller
{
$outHtmlSummary[] = [
'value' => $discount,
- 'label' => 'Rabatt ['. $adultCount .'x '.
+ 'label' => 'Rabatt ['. $this->calcNumTravelerLabel($adultCount) .'x '.
Util::formatPrice($singleFullPrice - $singleDiscountPrice) .' pro Person]'
];
}
@@ -351,7 +358,7 @@ class BookingController extends Controller
$insuranceHtmlSummary[] = [
'value' => $a,
'label' => 'RV '. $bookingRequest->getInsurance()->getName() .' ('.
- $insurancePrice->getCode() .') ['. $adultCount .' x '.
+ $insurancePrice->getCode() .') ['. $this->calcNumTravelerLabel($adultCount) .' x '.
Util::formatPrice($insurancePriceValue) . ' pro Person]'
];
}
@@ -398,47 +405,56 @@ class BookingController extends Controller
if($priceTypeId == 1 && $persons['singleRoomPersons'] > 0)
{
- $currentPersons = [
- 'total' => $persons['singleRoomPersons'],
- 'adults' => $persons['singleRoomPersons'],
- 'children' => 0 //TODO
- ];
+ for($i = 0; $i < $persons['singleRoomPersons']; $i++)
+ {
+ $currentPersons = [
+ 'total' => 1,
+ 'adults' => 1,
+ 'children' => 0 //TODO
+ ];
- $ret[] = [
- 'priceType' => $priceType,
- 'persons' => $currentPersons,
- 'price' => $price
- ];
+ $ret[] = [
+ 'priceType' => $priceType,
+ 'persons' => $currentPersons,
+ 'price' => $price
+ ];
+ }
}
if($priceTypeId == 3 && $persons['doubleRoomPersons'] > 0)
{
- $currentPersons = [
- 'total' => $persons['doubleRoomPersons'],
- 'adults' => $persons['doubleRoomPersons'],
- 'children' => 0
- ];
+ for($j = 0; $j < ($persons['doubleRoomPersons'] / 2); $j++)
+ {
+ $currentPersons = [
+ 'total' => 2,
+ 'adults' => 2,
+ 'children' => 0
+ ];
- $ret[] = [
- 'priceType' => $priceType,
- 'persons' => $currentPersons,
- 'price' => $price
- ];
+ $ret[] = [
+ 'priceType' => $priceType,
+ 'persons' => $currentPersons,
+ 'price' => $price
+ ];
+ }
}
if($priceTypeId == 5 && $persons['tripleRoomPersons'] > 0)
{
- $currentPersons = [
- 'total' => $persons['tripleRoomPersons'],
- 'adults' => $persons['tripleRoomPersons'],
- 'children' => 0
- ];
+ for($k = 0; $k < ($persons['tripleRoomPersons'] / 3); $k++)
+ {
+ $currentPersons = [
+ 'total' => 3,
+ 'adults' => 3,
+ 'children' => 0
+ ];
- $ret[] = [
- 'priceType' => $priceType,
- 'persons' => $currentPersons,
- 'price' => $price
- ];
+ $ret[] = [
+ 'priceType' => $priceType,
+ 'persons' => $currentPersons,
+ 'price' => $price
+ ];
+ }
}
}
diff --git a/trunk/src/AppBundle/Entity/BookingRequest.php b/trunk/src/AppBundle/Entity/BookingRequest.php
index 97e02f5f..2704994d 100644
--- a/trunk/src/AppBundle/Entity/BookingRequest.php
+++ b/trunk/src/AppBundle/Entity/BookingRequest.php
@@ -555,6 +555,27 @@ class BookingRequest
// falls man es braucht, nachziehen und oder umstrukturieren (booking.html.twig)
}
+ public function getOccupiedRooms()
+ {
+ $allRooms = [];
+ for($i = 0; $i < $this->singleRoomCount; $i++)
+ {
+ $allRooms[] = $this->singleRooms[$i];
+ //$allRooms = array_push($allRooms, $this->singleRooms[$i]);
+ }
+ for($i = 0; $i < $this->doubleRoomCount; $i++)
+ {
+ $allRooms[] = $this->doubleRooms[$i];
+ //$allRooms = array_push($allRooms, $this->doubleRooms[$i]);
+ }
+ for($i = 0; $i < $this->tripleRoomCount; $i++)
+ {
+ $allRooms[] = $this->tripleRooms[$i];
+ //$allRooms = array_push($allRooms, $this->tripleRooms[$i]);
+ }
+ return $allRooms;
+ }
+
/*
public function addTraveler(Traveler $traveler)
diff --git a/trunk/src/AppBundle/Entity/TravelBooking.php b/trunk/src/AppBundle/Entity/TravelBooking.php
index 50b989d4..9639e566 100644
--- a/trunk/src/AppBundle/Entity/TravelBooking.php
+++ b/trunk/src/AppBundle/Entity/TravelBooking.php
@@ -895,7 +895,7 @@ class TravelBooking
'gender' => $traveler->getSex(),
'first_name' => $traveler->getFirstName(),
'last_name' => $traveler->getLastName(),
- 'birthday' => $traveler->getBirthDate()->format('d.m.Y')
+ 'birthday' => $traveler->getBirthDate()
];
}
diff --git a/trunk/src/AppBundle/Entity/Traveler.php b/trunk/src/AppBundle/Entity/Traveler.php
index e9b74d02..f11d4b1c 100644
--- a/trunk/src/AppBundle/Entity/Traveler.php
+++ b/trunk/src/AppBundle/Entity/Traveler.php
@@ -31,7 +31,6 @@ class Traveler
private $lastName;
/**
- * @var \DateTime $birthDate
* @Assert\NotBlank()
*/
private $birthDate;
@@ -85,7 +84,7 @@ class Traveler
}
/**
- * @return \DateTime
+ * @return string
*/
public function getBirthDate()
{
@@ -93,7 +92,7 @@ class Traveler
}
/**
- * @param \DateTime $birthDate
+ * @param string $birthDate
*/
public function setBirthDate($birthDate)
{
diff --git a/trunk/src/AppBundle/Export/BookingSternToursCrmExporter.php b/trunk/src/AppBundle/Export/BookingSternToursCrmExporter.php
index 97e52e93..13555e68 100644
--- a/trunk/src/AppBundle/Export/BookingSternToursCrmExporter.php
+++ b/trunk/src/AppBundle/Export/BookingSternToursCrmExporter.php
@@ -266,7 +266,7 @@ class BookingSternToursCrmExporter extends SternToursCrmExporter
'participant_salutation_id' => $bookingRequest->getTravelers()[0]->getSex(),
'participant_name' => $bookingRequest->getTravelers()[0]->getLastName(),
'participant_firstname' => $bookingRequest->getTravelers()[0]->getFirstName(),
- 'participant_birthdate' => $bookingRequest->getTravelers()[0]->getBirthDate()->format('Y-m-d'),
+ 'participant_birthdate' => $bookingRequest->getTravelers()[0]->getBirthDate(),
]]);
if (!$resp['success'])
@@ -282,7 +282,7 @@ class BookingSternToursCrmExporter extends SternToursCrmExporter
'participant_salutation_id' => $traveler->getSex(),
'participant_name' => $traveler->getLastName(),
'participant_firstname' => $traveler->getFirstName(),
- 'participant_birthdate' => $traveler->getBirthDate()->format('Y-m-d'),
+ 'participant_birthdate' => $traveler->getBirthDate(),
]], true);
return $resp['success'];
}
diff --git a/trunk/src/AppBundle/Form/TravelerType.php b/trunk/src/AppBundle/Form/TravelerType.php
index 9de342d6..fe9e8ef3 100644
--- a/trunk/src/AppBundle/Form/TravelerType.php
+++ b/trunk/src/AppBundle/Form/TravelerType.php
@@ -50,11 +50,7 @@ class TravelerType extends AbstractType
])
->add('firstName')
->add('lastName')
- ->add('birthDate', StPlainDateType::class, [
- 'widget' => 'single_text',
- 'format' => 'dd.MM.yyyy',
- 'required' => true,
- ])
+ ->add('birthDate')
;
}
}
\ No newline at end of file
diff --git a/trunk/src/AppBundle/Resources/assets/less/includes/responsive.less b/trunk/src/AppBundle/Resources/assets/less/includes/responsive.less
index 92e39d89..a785569d 100644
--- a/trunk/src/AppBundle/Resources/assets/less/includes/responsive.less
+++ b/trunk/src/AppBundle/Resources/assets/less/includes/responsive.less
@@ -235,6 +235,13 @@
.btn-over-slider {
top:110px;
}
+ .btn-over-slider-bottom {
+ top:320px;
+ }
+ .st-slider-booking-btn-bottom{
+ background-color: #777777 !important;
+ }
+
.price-over-slider {
top: 115px;
}
diff --git a/trunk/src/AppBundle/Resources/assets/less/includes/shortcodes.less b/trunk/src/AppBundle/Resources/assets/less/includes/shortcodes.less
index de82e134..d9ff90ce 100644
--- a/trunk/src/AppBundle/Resources/assets/less/includes/shortcodes.less
+++ b/trunk/src/AppBundle/Resources/assets/less/includes/shortcodes.less
@@ -58,6 +58,13 @@
}
}
+.btn-over-slider-bottom {
+ top: 280px !important;
+}
+.st-slider-booking-btn-bottom{
+ background-color: #777777 !important;
+}
+
.price-over-slider {
position: absolute; left: 15px; top:75px; z-index: 1000;
.cprice{
diff --git a/trunk/src/AppBundle/Resources/public/css/custom.css b/trunk/src/AppBundle/Resources/public/css/custom.css
index bdd8f40a..0cd4e478 100644
--- a/trunk/src/AppBundle/Resources/public/css/custom.css
+++ b/trunk/src/AppBundle/Resources/public/css/custom.css
@@ -1121,6 +1121,12 @@ a[id^="video_"]:before,
-moz-box-shadow: 0px 0px 8px 5px rgba(255, 255, 255, 0.4);
box-shadow: 0px 0px 8px 5px rgba(255, 255, 255, 0.4);
}
+.btn-over-slider-bottom {
+ top: 280px !important;
+}
+.st-slider-booking-btn-bottom {
+ background-color: #777777 !important;
+}
.price-over-slider {
position: absolute;
left: 15px;
@@ -1964,7 +1970,7 @@ body.modal-open {
background-color: #f6f6f6;
}
#page-header {
- background: url(images/page-header.jpg) no-repeat scroll center center / cover rgba(0, 0, 0, 0);
+ background: url('images/page-header.jpg') no-repeat scroll center center / cover rgba(0, 0, 0, 0);
display: block;
padding: 70px 0;
position: relative;
@@ -3717,6 +3723,12 @@ a,
.btn-over-slider {
top: 110px;
}
+ .btn-over-slider-bottom {
+ top: 320px;
+ }
+ .st-slider-booking-btn-bottom {
+ background-color: #777777 !important;
+ }
.price-over-slider {
top: 115px;
}
diff --git a/trunk/src/AppBundle/Resources/public/js/booking.js b/trunk/src/AppBundle/Resources/public/js/booking.js
index 751164d3..51c707db 100644
--- a/trunk/src/AppBundle/Resources/public/js/booking.js
+++ b/trunk/src/AppBundle/Resources/public/js/booking.js
@@ -55,7 +55,8 @@ $(document).ready(function() {
var roomIndexSelector = travelerSelector+' .st-traveller-index';
var currentRoomIndex = $(travelerSelector).attr("data-room-index");
$(travelerSelector).show().find('input,select').prop('required', true);
- $(roomIndexSelector).text(currentRoomIndex);
+ //$(roomIndexSelector).text(currentRoomIndex);
+ $(roomIndexSelector).text("Einzelzimmer");
}
}
@@ -68,7 +69,8 @@ $(document).ready(function() {
var roomIndexSelector = travelerSelector+' .st-traveller-index';
var currentRoomIndex = $(travelerSelector).attr("data-room-index");
$(travelerSelector).show().find('input,select').prop('required', true);
- $(roomIndexSelector).text(currentRoomIndex - offset);
+ //$(roomIndexSelector).text(currentRoomIndex - offset);
+ $(roomIndexSelector).text("Doppelzimmer");
}
}
@@ -81,7 +83,8 @@ $(document).ready(function() {
var roomIndexSelector = travelerSelector+' .st-traveller-index';
var currentRoomIndex = $(travelerSelector).attr("data-room-index");
$(travelerSelector).show().find('input,select').prop('required', true);
- $(roomIndexSelector).text(currentRoomIndex - offset);
+ //$(roomIndexSelector).text(currentRoomIndex - offset);
+ $(roomIndexSelector).text("Dreibettzimmer");
}
}
|