Buchung Reisekostenversicherung raus, dafür Info Checkbox rein

+ DB travel_booking + travel_cancellation int 1

git-svn-id: http://78.47.251.156/svn/dev/sterntours-3@3370 f459cee4-fb09-11de-96c3-f9c5f16c3c76
This commit is contained in:
adametz 2018-02-22 10:51:25 +00:00
parent db05f3aa17
commit dbb34b1af1
7 changed files with 91 additions and 20 deletions

View file

@ -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 %}

View file

@ -110,27 +110,23 @@
{{ form_errors(form.tripleRoomCount) }}
</td>
</tr>
<tr>
<tr>
<td>Reiseversicherung</td>
<td>
<div class="radio">
<input id="st-no-insurance-opt" type="radio" value=""
name="{{ form.insurance.vars.full_name }}"
{% if form.insurance.vars.value == '' %}checked{% endif %}
>
<label for="st-no-insurance-opt">keine Reiseversicherung</label>
{% if form.travelCancellation is defined %}
<div class="checkbox">
{{ form_widget(form.travelCancellation) }}
<label for="{{ form.travelCancellation.vars.id }}">
STERN TOURS GmbH empfiehlt generell den Abschluss einer Reise-Rücktrittskosten-Versicherung und einer Auslands-Reisekrankenversicherung mit Rücktransport. Wenn Sie eine Versicherung wünschen, dann teilen Sie uns das bitte hier ("JA" auswählen) mit und wir senden Ihnen alle Informationen per Email zu.
</label>
</div>
{% 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 %}
</td>
</tr>
<tr>
<td>Zubuchbare Leistungen</td>
<td>

View file

@ -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]</strong>'
];
}
/*
Preis für reisekostenversicherung
if ($bookingRequest->getInsurance() && $adultCount > 0)
{
$curAssessmentBasis = $insuranceAssessmentBasis + ($singleDiscountPrice ?? $singleFullPrice);
@ -378,7 +388,7 @@ class BookingController extends Controller
'count' => $adultCount,
];
}
}
}*/
}
}

View file

@ -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
*/

View file

@ -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
*

View file

@ -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']);

View file

@ -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)
{