From 0eac480ad5f3c23f6d7de1455b50e99700b81019 Mon Sep 17 00:00:00 2001 From: adametz Date: Thu, 23 Aug 2018 13:03:57 +0000 Subject: [PATCH] fix Mail Summary Prices git-svn-id: http://78.47.251.156/svn/dev/sterntours-3@3452 f459cee4-fb09-11de-96c3-f9c5f16c3c76 --- .../email/components/bookingSummary.txt.twig | 33 ++++--------------- .../Controller/BookingController.php | 9 +++-- 2 files changed, 12 insertions(+), 30 deletions(-) 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 f7258f34..ad53302e 100644 --- a/trunk/app/Resources/views/default/email/components/bookingSummary.txt.twig +++ b/trunk/app/Resources/views/default/email/components/bookingSummary.txt.twig @@ -5,36 +5,15 @@ Reisedaten: Reiseprogramm: {{ travel_date.travelProgram.title }} ({{ travel_date.name }}) Kategorie: Standard Reisezeitraum: {{ travel_date.start|date }} - {{ travel_date.end|date }} -Abfahrts-/Abflugort: {{ booking_request.departure.name }} {{ booking_request.departure.extraCharge|number_format(2) }} € p.P. +Abfahrts-/Abflugort: {{ booking_request.departure.name }} -{% for room in booking_price_info['rooms'] %} -1x {{ room['name'] }} [Personen: {{ room.adults }} x {{ room['price']|number_format(2) }} € {% if room['children'] > 0 %} + Kind: {{ room['price_children']|number_format(2) }} € {% endif %}] -{% endfor %} - -{{ booking_request.departure.extraCharge < 0 ? 'Aufschlag' : 'Abzug' }} Abfahrts-/Abflugort {{ booking_request.departure.name }}{# -#} {{ (booking_request.travelerCount + booking_request.childrenCount) }} x {{ booking_request.departure.extraCharge|number_format(2) }} €: {{ - (booking_request.travelerCount * booking_request.departure.extraCharge)|number_format(2) }} € - -{% for insuranceInfo in booking_price_info['insurancesOut'] %} -{{ insuranceInfo['count'] }}x {{ insuranceInfo['label_first'] }} [ {{ insuranceInfo['label_last'] }} ] {{ insuranceInfo['value']|number_format(2) }} € -{% endfor %} - -{% for option in booking_request.travelOptions %} -{{ (booking_request.travelerCount + booking_request.childrenCount) }}x zugebuchte Leistung: {{ option.name }} [Erwachsener: {{ option.price|number_format(2) -}}€ ] -{% if option.priceChildren > 0 %}[Kind: {{ option.priceChildren|number_format(2) -}} €] {% endif %} - {{ ((booking_request.travelerCount * option.price) + (booking_request.childrenCount * option.priceChildren))|number_format(2) }} € -{% endfor %} - -{% for classOption in booking_price_info['classOptions'] %} -{{ classOption['count'] }}x {{ classOption['name'] }} {{ classOption['price']|number_format(2) }} €: {{ -(classOption['count'] * classOption['price'])|number_format(2) }} € -{% endfor %} - -{% for discount in booking_price_info['discount'] %} -{{ discount['count'] }}x {{ discount['label_first'] }} [ {{ discount['label_last'] }} ] {{ discount['value']|number_format(2) }} € -{% endfor %} +------------------------------------------------------------ + {% for summary_entry in summary %} + {{ summary_entry.value|number_format(2) }} € : {{ summary_entry.label|striptags }} + {% endfor %} +------------------------------------------------------------ Gesamtpreis: {{ booking_price_info['total']|number_format(2) }} € Anzahlung: {{ booking_price_info.deposit_total|number_format(2) }} € (ist sofort fällig) diff --git a/trunk/src/AppBundle/Controller/BookingController.php b/trunk/src/AppBundle/Controller/BookingController.php index dc4bea9d..515e6c75 100644 --- a/trunk/src/AppBundle/Controller/BookingController.php +++ b/trunk/src/AppBundle/Controller/BookingController.php @@ -135,8 +135,6 @@ 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') @@ -148,6 +146,8 @@ class BookingController extends Controller 'booking_price_info' => $bookingPriceInfo, 'travel_date' => $travelDate, 'breadcrumb_entries' => $breadcrumbEntries, + 'summary' => $htmlSummary, + ]), 'text/plain', 'utf-8' ) @@ -156,7 +156,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') - ->setTo("stern@stern-tours.de") + ->setTo("stern@stern-tours.de") ->setBody( $this->renderView('default/email/bookingServiceEmail.txt.twig', [ 'base_dir' => realpath($this->getParameter('kernel.root_dir').'/..').DIRECTORY_SEPARATOR, @@ -166,6 +166,8 @@ class BookingController extends Controller 'booking_price_info' => $bookingPriceInfo, 'travel_date' => $travelDate, 'breadcrumb_entries' => $breadcrumbEntries, + 'summary' => $htmlSummary, + ]), 'text/plain', 'utf-8' ) @@ -267,6 +269,7 @@ class BookingController extends Controller { $insuranceHtmlSummary = []; } + if (isset($outPriceInfo)) { $outPriceInfo['rooms'] = [];