From 14d4fa02b58ddf819f01bddd0d9ce0889ab941e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Wed, 28 May 2025 09:54:58 +0200 Subject: [PATCH] fix: incorrect calculation of undersubscription costs --- .../js/components/GroupsPriceCalculator.vue | 31 ++++++++---- .../Private/Layouts/Email/SystemEmail.html | 4 ++ .../Private/Templates/Email/GroupsPrice.html | 50 +++++++++++++++---- 3 files changed, 65 insertions(+), 20 deletions(-) diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/GroupsPriceCalculator.vue b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/GroupsPriceCalculator.vue index 9e6fb430..8395f3de 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/GroupsPriceCalculator.vue +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/components/GroupsPriceCalculator.vue @@ -412,14 +412,14 @@ export default { childrenCount: 0, selectedOptions: [], selectedBoard: null, - name: null, - email: null, - phone: null, - remarks: null, - group: null, - street: null, - postcode: null, - city: null, + name: '', + email: '', + phone: '', + remarks: '', + group: '', + street: '', + postcode: '', + city: '', mode: 'booking', confirmation: false, termsUrls: { @@ -569,6 +569,17 @@ export default { }, }, computed: { + isSelfCatering() { + let selectedBoard = this.selectedBoard + if (null === selectedBoard) { + return false + } + if ('CH' === this.countryCode) { + return selectedBoard.price.CHF === 0 + } else { + return selectedBoard.price.EUR === 0 + } + }, paxCount() { // subtract number of children from pax for price calculation, but minimum 30 pax return Math.max(this.selectedPax - this.childrenCount, 30) @@ -613,10 +624,10 @@ export default { } } } - if (this.selectedBoard && this.paxCount < 40) { + if (false === this.isSelfCatering && this.paxCount < 40) { undersubscription.EUR = this.paxCount * this.undersubscription30Eur * this.selectedRange.length undersubscription.CHF = this.paxCount * this.undersubscription30Chf * this.selectedRange.length - } else if (this.selectedBoard && this.paxCount < 50) { + } else if (false === this.isSelfCatering && this.paxCount < 50) { undersubscription.EUR = this.paxCount * this.undersubscription40Eur * this.selectedRange.length undersubscription.CHF = this.paxCount * this.undersubscription40Chf * this.selectedRange.length } diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Layouts/Email/SystemEmail.html b/public/typo3conf/ext/ep_theme/Resources/Private/Layouts/Email/SystemEmail.html index 829dd037..bd3f29f4 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Layouts/Email/SystemEmail.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Layouts/Email/SystemEmail.html @@ -264,6 +264,10 @@ font-weight:normal; text-decoration:underline; } + table.data th, + table.data td { + vertical-align: top; + } @media only screen and (min-width:768px){ .templateContainer { width:600px !important; diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Email/GroupsPrice.html b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Email/GroupsPrice.html index 25b977fc..ccd94c13 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Email/GroupsPrice.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/Email/GroupsPrice.html @@ -13,7 +13,7 @@

Anfrage Gruppenhaus vom

- +
- +
Art @@ -94,25 +94,55 @@ + + - +
Kostenübersicht - Grundpreis: {summary.paxBase}
- Aufpreis Personen: {summary.paxAdditional -> v:or(alternative: '-')}
- Verpflegung: {summary.board -> v:or(alternative: '-')}
- Kleingruppen-Verpflegungszuschlag: {summary.undersubscription -> v:or(alternative: '-')}
- Aufpreis Kurzzeit: {summary.shortTerm -> v:or(alternative: '-')}
- Zusatzleistungen: {summary.options}
- Strom- und Abfallgebühren: {summary.runningCosts -> v:or(alternative: '-')}
- Gesamtpreis: {summary.total} +
    +
  • + Grundpreis: {summary.paxBase} +
  • +
  • + Aufpreis Personen: {summary.paxAdditional -> v:or(alternative: '-')} +
  • +
  • + Verpflegung: {summary.board -> v:or(alternative: '-')} +
  • +
  • + Kleingruppen-Verpflegungszuschlag: {summary.undersubscription -> v:or(alternative: '-')} +
  • +
  • + Aufpreis Kurzzeit: {summary.shortTerm -> v:or(alternative: '-')} +
  • +
  • + Zusatzleistungen: {summary.options} +
  • +
  • + Strom- und Abfallgebühren: {summary.runningCosts -> v:or(alternative: '-')} +
  • +
  • + Gesamtpreis: {summary.total} +
  • +
Bemerkungen/Wünsche{remarks -> v:or(alternative: '-') -> f:format.nl2br()} + + + {remarks -> f:format.nl2br()} + + + - + + +