feat: additional distinction in pax regarding undersubscription costs

closes #8698nahva
This commit is contained in:
Björn Fromme
2025-04-22 10:20:49 +02:00
parent 08c1147336
commit 24685b6cb8
3 changed files with 48 additions and 13 deletions
@@ -52,8 +52,10 @@ class GroupsPriceController extends ActionController
$this->view->assign('hotel', $hotel); $this->view->assign('hotel', $hotel);
$this->view->assign('runningCostsEUR', $this->settings['runningCostsEUR']); $this->view->assign('runningCostsEUR', $this->settings['runningCostsEUR']);
$this->view->assign('runningCostsCHF', $this->settings['runningCostsCHF']); $this->view->assign('runningCostsCHF', $this->settings['runningCostsCHF']);
$this->view->assign('undersubscriptionEUR', $this->settings['undersubscriptionEUR']); $this->view->assign('undersubscription30EUR', $this->settings['undersubscription30EUR']);
$this->view->assign('undersubscriptionCHF', $this->settings['undersubscriptionCHF']); $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('countryCode', $hotel->getCountry()->getCode());
$this->view->assign('configs', json_encode(array_values($configs), JSON_HEX_APOS)); $this->view->assign('configs', json_encode(array_values($configs), JSON_HEX_APOS));
$this->view->assign('boards', json_encode($hotel->getGroupsPriceBoards()->toArray(), JSON_HEX_APOS)); $this->view->assign('boards', json_encode($hotel->getGroupsPriceBoards()->toArray(), JSON_HEX_APOS));
@@ -32,28 +32,50 @@
</config> </config>
</TCEforms> </TCEforms>
</settings.runningCostsCHF> </settings.runningCostsCHF>
<settings.undersubscriptionEUR> <settings.undersubscription30EUR>
<TCEforms> <TCEforms>
<exclude>0</exclude> <exclude>0</exclude>
<label>Unterbelegung EUR</label> <label>Unterbelegung 30-39 Personen EUR</label>
<config> <config>
<type>input</type> <type>input</type>
<default>5.0</default> <default>5.0</default>
<eval>double2,required</eval> <eval>double2,required</eval>
</config> </config>
</TCEforms> </TCEforms>
</settings.undersubscriptionEUR> </settings.undersubscription30EUR>
<settings.undersubscriptionCHF> <settings.undersubscription30CHF>
<TCEforms> <TCEforms>
<exclude>0</exclude> <exclude>0</exclude>
<label>Unterbelegung CHF</label> <label>Unterbelegung 30-39 Personen CHF</label>
<config> <config>
<type>input</type> <type>input</type>
<default>5.0</default> <default>5.0</default>
<eval>double2,required</eval> <eval>double2,required</eval>
</config> </config>
</TCEforms> </TCEforms>
</settings.undersubscriptionCHF> </settings.undersubscription30CHF>
<settings.undersubscription40EUR>
<TCEforms>
<exclude>0</exclude>
<label>Unterbelegung 40-49 Personen EUR</label>
<config>
<type>input</type>
<default>2.5</default>
<eval>double2,required</eval>
</config>
</TCEforms>
</settings.undersubscription40EUR>
<settings.undersubscription40CHF>
<TCEforms>
<exclude>0</exclude>
<label>Unterbelegung 40-49 Personen CHF</label>
<config>
<type>input</type>
<default>2.5</default>
<eval>double2,required</eval>
</config>
</TCEforms>
</settings.undersubscription40CHF>
</el> </el>
</ROOT> </ROOT>
</sDEF> </sDEF>
@@ -294,14 +294,22 @@ export default {
type: Number, type: Number,
default: 2.9, default: 2.9,
}, },
undersubscriptionEur: { undersubscription30Eur: {
type: Number, type: Number,
default: 5.0, default: 5.0,
}, },
undersubscriptionChf: { undersubscription30Chf: {
type: Number, type: Number,
default: 5.0, default: 5.0,
}, },
undersubscription40Eur: {
type: Number,
default: 2.5,
},
undersubscription40Chf: {
type: Number,
default: 2.5,
},
countryCode: { countryCode: {
type: String, type: String,
required: true required: true
@@ -530,9 +538,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.EUR = this.selectedPax * this.undersubscription30Eur * this.selectedRange.length
undersubscription.CHF = this.selectedPax * this.undersubscriptionChf * 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} return {base, additional, undersubscription}