From 784c7a74d4e08ddb5417b501f9eca43c3e13ec05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Fri, 11 Apr 2025 10:27:28 +0200 Subject: [PATCH] wip: calculator adjustments --- .../Controller/GroupsPriceController.php | 2 ++ .../flexform_groups_price_calculator.xml | 26 +++++++++++++++++-- .../js/components/GroupsPriceCalculator.vue | 18 ++++++++++--- .../Private/Templates/GroupsPrice/Index.html | 2 ++ 4 files changed, 43 insertions(+), 5 deletions(-) diff --git a/public/typo3conf/ext/ep_products/Classes/Controller/GroupsPriceController.php b/public/typo3conf/ext/ep_products/Classes/Controller/GroupsPriceController.php index 49300c80..b2ee2d24 100644 --- a/public/typo3conf/ext/ep_products/Classes/Controller/GroupsPriceController.php +++ b/public/typo3conf/ext/ep_products/Classes/Controller/GroupsPriceController.php @@ -54,6 +54,8 @@ class GroupsPriceController extends ActionController $this->view->assign('runningCostsCHF', $this->settings['runningCostsCHF']); $this->view->assign('undersubscriptionEUR', $this->settings['undersubscriptionEUR']); $this->view->assign('undersubscriptionCHF', $this->settings['undersubscriptionCHF']); + $this->view->assign('undersubscriptionExtEUR', $this->settings['undersubscriptionExtEUR']); + $this->view->assign('undersubscriptionExtCHF', $this->settings['undersubscriptionExtCHF']); $this->view->assign('countryCode', $hotel->getCountry()->getCode()); $this->view->assign('configs', json_encode(array_values($configs), JSON_HEX_APOS)); $this->view->assign('boards', json_encode($hotel->getGroupsPriceBoards()->toArray(), JSON_HEX_APOS)); diff --git a/public/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_groups_price_calculator.xml b/public/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_groups_price_calculator.xml index 67cb1a72..49aed66c 100644 --- a/public/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_groups_price_calculator.xml +++ b/public/typo3conf/ext/ep_products/Configuration/FlexForms/flexform_groups_price_calculator.xml @@ -35,7 +35,7 @@ 0 - + input 5.0 @@ -46,7 +46,7 @@ 0 - + input 5.0 @@ -54,6 +54,28 @@ + + + 0 + + + input + 2.5 + double2,required + + + + + + 0 + + + input + 2.5 + double2,required + + + 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 37d28a19..8357a184 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 @@ -114,8 +114,9 @@ Gesamtpreis - {{ formatCurrency(priceTotal) }}
zzgl. vor Ort zu entrichtender - Ortstaxe + {{ formatCurrency(priceTotal) }} +
zzgl. vor Ort zu entrichtender Ortstaxe + @@ -299,6 +300,14 @@ export default { type: Number, default: 5.0, }, + undersubscriptionExtEur: { + type: Number, + default: 2.5, + }, + undersubscriptionExtChf: { + type: Number, + default: 2.5, + }, countryCode: { type: String, required: true @@ -505,9 +514,12 @@ export default { } } } - if (this.selectedBoard && this.selectedPax < 50) { + if (this.selectedBoard && this.selectedPax < 40) { undersubscription.EUR = this.selectedPax * this.undersubscriptionEur * this.selectedRange.length undersubscription.CHF = this.selectedPax * this.undersubscriptionChf * this.selectedRange.length + } else if (this.selectedBoard && this.selectedPax < 50) { + undersubscription.EUR = this.selectedPax * this.undersubscriptionExtEur * this.selectedRange.length + undersubscription.CHF = this.selectedPax * this.undersubscriptionExtChf * this.selectedRange.length } return {base, additional, undersubscription} diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/GroupsPrice/Index.html b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/GroupsPrice/Index.html index f656bc61..b91364ee 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/GroupsPrice/Index.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/GroupsPrice/Index.html @@ -17,6 +17,8 @@ running-costs-factor-chf="{runningCostsCHF}" undersubscription-eur="{undersubscriptionEUR}" undersubscription-chf="{undersubscriptionCHF}" + undersubscription-ext-eur="{undersubscriptionExtEUR}" + undersubscription-ext-chf="{undersubscriptionExtCHF}" country-code="{countryCode}" endpoint="{ep:uri.ajax(action: 'processForm', controller: 'AjaxGroupsPrice', pageUid: settings.defaultAjaxUid, arguments: '{hotel: hotel}')}" loader-uri="{f:uri.image(src: 'EXT:ep_theme/Resources/Public/images/ajax-loader-white.gif')}"