From 24685b6cb893030a405cfae4204738c4fbbf969a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Tue, 22 Apr 2025 10:20:49 +0200 Subject: [PATCH] feat: additional distinction in pax regarding undersubscription costs closes #8698nahva --- .../Controller/GroupsPriceController.php | 6 ++-- .../flexform_groups_price_calculator.xml | 34 +++++++++++++++---- .../js/components/GroupsPriceCalculator.vue | 21 +++++++++--- 3 files changed, 48 insertions(+), 13 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..e68a4fca 100644 --- a/public/typo3conf/ext/ep_products/Classes/Controller/GroupsPriceController.php +++ b/public/typo3conf/ext/ep_products/Classes/Controller/GroupsPriceController.php @@ -52,8 +52,10 @@ class GroupsPriceController extends ActionController $this->view->assign('hotel', $hotel); $this->view->assign('runningCostsEUR', $this->settings['runningCostsEUR']); $this->view->assign('runningCostsCHF', $this->settings['runningCostsCHF']); - $this->view->assign('undersubscriptionEUR', $this->settings['undersubscriptionEUR']); - $this->view->assign('undersubscriptionCHF', $this->settings['undersubscriptionCHF']); + $this->view->assign('undersubscription30EUR', $this->settings['undersubscription30EUR']); + $this->view->assign('undersubscription30CHF', $this->settings['undersubscription30CHF']); + $this->view->assign('undersubscription40EUR', $this->settings['undersubscription40EUR']); + $this->view->assign('undersubscription40CHF', $this->settings['undersubscription40CHF']); $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..f8c607c3 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 @@ -32,28 +32,50 @@ - + 0 - + input 5.0 double2,required - - + + 0 - + input 5.0 double2,required - + + + + 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 a291d6f3..e659cadc 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 @@ -294,14 +294,22 @@ export default { type: Number, default: 2.9, }, - undersubscriptionEur: { + undersubscription30Eur: { type: Number, default: 5.0, }, - undersubscriptionChf: { + undersubscription30Chf: { type: Number, default: 5.0, }, + undersubscription40Eur: { + type: Number, + default: 2.5, + }, + undersubscription40Chf: { + type: Number, + default: 2.5, + }, countryCode: { type: String, required: true @@ -530,9 +538,12 @@ export default { } } } - if (this.selectedBoard && this.selectedPax < 50) { - undersubscription.EUR = this.selectedPax * this.undersubscriptionEur * this.selectedRange.length - undersubscription.CHF = this.selectedPax * this.undersubscriptionChf * this.selectedRange.length + if (this.selectedBoard && this.selectedPax < 40) { + undersubscription.EUR = this.selectedPax * this.undersubscription30Eur * this.selectedRange.length + undersubscription.CHF = this.selectedPax * this.undersubscription30Chf * this.selectedRange.length + } else if (this.selectedBoard && this.selectedPax < 50) { + undersubscription.EUR = this.selectedPax * this.undersubscription40Eur * this.selectedRange.length + undersubscription.CHF = this.selectedPax * this.undersubscription40Chf * this.selectedRange.length } return {base, additional, undersubscription}