From d91ad2a2f7848c3bfc030c77d48d4c4a85ca1db3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Wed, 27 Apr 2022 13:25:51 +0200 Subject: [PATCH] Add undersubscription surcharge calculation to groups price MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For small groups consisting of less than 50 pax a surcharge of 5€ per pax will be added, when a board selection is made. --- .../Assets/js/components/GroupsPriceCalculator.vue | 12 +++++++++++- .../Private/Templates/Email/GroupsPrice.html | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) 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 0be68694..3af00292 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 @@ -127,6 +127,11 @@ Verpflegung {{ formatCurrency(priceBoard) }} + + Kleingruppen-Verpflegungszuschlag + {{ formatCurrency(pricePax.undersubscription) }} + Strom- und Abfallgebühren @@ -345,6 +350,7 @@ export default { 'tx_epproducts_ajax[groupsPriceInquiry][paxGroup3]': this.includesBonusCard ? this.selectedPaxGroup3 : '', 'tx_epproducts_ajax[groupsPriceInquiry][summary][paxBase]': this.formatCurrency(this.pricePax.base), 'tx_epproducts_ajax[groupsPriceInquiry][summary][paxAdditional]': this.formatCurrency(this.pricePax.additional), + 'tx_epproducts_ajax[groupsPriceInquiry][summary][undersubscription]': this.formatCurrency(this.pricePax.undersubscription), 'tx_epproducts_ajax[groupsPriceInquiry][summary][shortTerm]': this.formatCurrency(this.priceShortTerm), 'tx_epproducts_ajax[groupsPriceInquiry][summary][options]': this.priceOptions, 'tx_epproducts_ajax[groupsPriceInquiry][summary][board]': this.formatCurrency(this.priceBoard), @@ -402,6 +408,7 @@ export default { pricePax() { let base = 0 let additional = 0 + let undersubscription = 0 for (let date of this.selectedRange) { for (let config of this.configs) { if (date >= dayjs(config.dateFrom) && date < dayjs(config.dateTo)) { @@ -432,7 +439,10 @@ export default { } } } - return {base, additional}; + if (this.selectedBoard && this.totalPax < 50) { + undersubscription = this.totalPax * 5 + } + return {base, additional, undersubscription}; }, totalPax() { return this.includesBonusCard ? this.selectedPaxGroup1 + this.selectedPaxGroup2 + this.selectedPaxGroup3 : this.selectedPax 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 a91a90dc..15673173 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 @@ -75,6 +75,7 @@ Grundpreis: {summary.paxBase}
Aufpreis Personen: {summary.paxAdditional -> 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: '-')}