fix: adopt changes in price calculator to email

This commit is contained in:
Björn Fromme
2025-02-28 11:26:29 +01:00
parent 061781155e
commit 1c412bbe28
5 changed files with 26 additions and 27 deletions
@@ -87,7 +87,10 @@ class AjaxGroupsPriceController extends ActionController
];
try {
$selectedOptions = $this->groupsPriceOptionRepository->findByUids($groupsPriceInquiry->getOptions());
$options = $this->groupsPriceOptionRepository->findByUids($groupsPriceInquiry->getOptions());
$selectedOptions = array_map(function ($option) {
return $option->getTitle();
}, $options);
}
catch (InvalidQueryException $e) {
$selectedOptions = [];
@@ -105,9 +108,6 @@ class AjaxGroupsPriceController extends ActionController
'dateFrom' => $groupsPriceInquiry->getDateFrom(),
'dateTo' => $groupsPriceInquiry->getDateTo(),
'pax' => $groupsPriceInquiry->getPax(),
'paxGroup1' => $groupsPriceInquiry->getPaxGroup1(),
'paxGroup2' => $groupsPriceInquiry->getPaxGroup2(),
'paxGroup3' => $groupsPriceInquiry->getPaxGroup3(),
'options' => $selectedOptions,
'board' => $groupsPriceInquiry->getBoard(),
'summary' => $groupsPriceInquiry->getSummary(),
@@ -166,7 +166,6 @@ return [
'price_additional_person' => [
'exclude' => false,
'label' => 'Preis weitere Person',
'description' => 'ohne Jokercard, alle Altersgruppen',
'config' => [
'type' => 'input',
'size' => 8,
@@ -176,7 +175,6 @@ return [
'price_additional_person_chf' => [
'exclude' => false,
'label' => 'Preis weitere Person in CHF',
'description' => 'ohne Jokercard, alle Altersgruppen',
'config' => [
'type' => 'input',
'size' => 8,
@@ -83,32 +83,32 @@
<td>{{ formatCurrency(pricePax.base) }}</td>
</tr>
<tr class="odd:bg-zinc-100"
v-if="pricePax.additional.EUR > 0">
v-if="pricePax.additional.EUR > 0 || pricePax.additional.CHF > 0">
<th class="text-left py-2">Aufpreis Personenzahl</th>
<td>{{ formatCurrency(pricePax.additional) }}</td>
</tr>
<tr class="odd:bg-zinc-100"
v-if="priceShortTerm.EUR > 0">
v-if="priceShortTerm.EUR > 0 || priceShortTerm.CHF > 0">
<th class="text-left py-2">Aufpreis Kurzzeit</th>
<td>{{ formatCurrency(priceShortTerm) }}</td>
</tr>
<tr class="odd:bg-zinc-100"
v-if="selectedOptions.length > 0">
<th class="text-left py-2">Zusatzleistungen</th>
<td>{{ formatCurrency(priceOptions) }}</td>
v-for="selectedOption in selectedOptions">
<th class="text-left py-2">{{ selectedOption.title }}</th>
<td>{{ formatCurrency(optionPrice(selectedOption)) }}</td>
</tr>
<tr class="odd:bg-zinc-100"
v-if="priceBoard.EUR > 0">
v-if="priceBoard.EUR > 0 || priceBoard.CHF > 0">
<th class="text-left py-2">Verpflegung</th>
<td>{{ formatCurrency(priceBoard) }}</td>
</tr>
<tr class="odd:bg-zinc-100"
v-if="pricePax.undersubscription.EUR > 0">
v-if="pricePax.undersubscription.EUR > 0 || pricePax.undersubscription.CHF > 0">
<th class="text-left py-2">Kleingruppen-Verpflegungszuschlag</th>
<td>{{ formatCurrency(pricePax.undersubscription) }}</td>
</tr>
<tr class="odd:bg-zinc-100"
v-if="priceRunningCosts.EUR > 0">
v-if="priceRunningCosts.EUR > 0 || priceRunningCosts.CHF > 0">
<th class="text-left py-2">Strom- und Abfallgebühren</th>
<td>{{ formatCurrency(priceRunningCosts) }}</td>
</tr>
@@ -143,7 +143,7 @@
v-show="formErrors.name"
v-html="formErrors.name"></div>
</div>
<div :class="{ 'has-error': formErrors.name }">
<div :class="{ 'has-error': formErrors.address }">
<label class="font-bold mb-2">
Adresse*
</label>
@@ -370,6 +370,14 @@ export default {
return ` (${this.formatCurrency(option.price)})`
},
optionPrice(option) {
let factor = true === option.ignoreWithBoard && this.selectedBoard ? -1 : 1
return {
EUR: option.price.EUR * factor,
CHF: option.price.CHF * factor,
}
},
initSelectableRanges() {
let enabledDates = [];
for (let config of this.configs) {
@@ -417,7 +425,7 @@ export default {
'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][options]': this.formatCurrency(this.priceOptions),
'tx_epproducts_ajax[groupsPriceInquiry][summary][board]': this.formatCurrency(this.priceBoard),
'tx_epproducts_ajax[groupsPriceInquiry][summary][runningCosts]': this.formatCurrency(this.priceRunningCosts),
'tx_epproducts_ajax[groupsPriceInquiry][summary][total]': this.formatCurrency(this.priceTotal),
@@ -550,16 +558,9 @@ export default {
return price
},
priceRunningCosts() {
let CHF = 0
// calculate CHF price when pax price in CHF is available since CHF prices may not be provided via CMS yet
if (0 < this.pricePax.base.CHF) {
CHF = this.nightsCount * this.selectedPax * this.runningCostsFactorChf
}
return {
EUR: this.nightsCount * this.selectedPax * this.runningCostsFactorEur,
CHF
CHF: this.nightsCount * this.selectedPax * this.runningCostsFactorChf,
}
},
priceTotal() {
@@ -84,10 +84,10 @@
<trans-unit id="tx_eptheme.message.name.1221560718">
<source>Bitte angeben</source>
</trans-unit>
<trans-unit id="tx_eptheme.message.group.1221560910">
<trans-unit id="tx_eptheme.message.group.1221560718">
<source>Bitte angeben</source>
</trans-unit>
<trans-unit id="tx_eptheme.message.address.1221560910">
<trans-unit id="tx_eptheme.message.address.1221560718">
<source>Bitte angeben</source>
</trans-unit>
<trans-unit id="tx_eptheme.message.phone.1221560718">
@@ -74,7 +74,7 @@
<f:then>
<ul>
<f:for each="{options}" as="option">
<li>{option.title}</li>
<li>{option}</li>
</f:for>
</ul>
</f:then>