fix: incorrect calculation of total price in groups price calculator

addresses #8699m6vw6
This commit is contained in:
Björn Fromme
2025-07-01 17:02:05 +02:00
parent 600cf8f3cb
commit 9687febb2c
@@ -170,8 +170,8 @@
<td>{{ formatCurrency(priceBoard) }}</td>
</tr>
<tr class="odd:bg-zinc-100"
v-if="(priceBoard.EUR > 0 || priceBoard.CHF > 0) && (pricePax.undersubscription.EUR > 0 || pricePax.undersubscription.CHF > 0)">
<th class="text-left py-2">Verpflegungs-Aufschlag für Gruppen unter 50 Personen</th>
v-if="false === isSelfCatering && undersubscriptionLimit > 0">
<th class="text-left py-2">Verpflegungs-Aufschlag für Gruppen unter {{ undersubscriptionLimit }} Personen</th>
<td>{{ formatCurrency(pricePax.undersubscription) }}</td>
</tr>
<tr class="odd:bg-zinc-100"
@@ -619,7 +619,7 @@ export default {
isSelfCatering() {
let selectedBoard = this.selectedBoard
if (null === selectedBoard) {
return false
return true
}
if ('CH' === this.countryCode) {
return selectedBoard.price.CHF === 0
@@ -627,6 +627,15 @@ export default {
return selectedBoard.price.EUR === 0
}
},
undersubscriptionLimit() {
if (this.paxCount < 40) {
return 40
} else if (this.paxCount < 50) {
return 50
}
return 0
},
paxCount() {
// subtract number of children from pax for price calculation, but minimum 30 pax
return Math.max(this.selectedPax - this.childrenCount, 30)
@@ -671,12 +680,14 @@ export default {
}
}
}
if (false === this.isSelfCatering && this.paxCount < 40) {
undersubscription.EUR = this.paxCount * this.undersubscription30Eur * this.selectedRange.length
undersubscription.CHF = this.paxCount * this.undersubscription30Chf * this.selectedRange.length
} else if (false === this.isSelfCatering && this.paxCount < 50) {
undersubscription.EUR = this.paxCount * this.undersubscription40Eur * this.selectedRange.length
undersubscription.CHF = this.paxCount * this.undersubscription40Chf * this.selectedRange.length
if (false === this.isSelfCatering) {
if (this.paxCount < 40) {
undersubscription.EUR = this.paxCount * this.undersubscription30Eur * this.selectedRange.length
undersubscription.CHF = this.paxCount * this.undersubscription30Chf * this.selectedRange.length
} else if (this.paxCount < 50) {
undersubscription.EUR = this.paxCount * this.undersubscription40Eur * this.selectedRange.length
undersubscription.CHF = this.paxCount * this.undersubscription40Chf * this.selectedRange.length
}
}
return {base, additional, undersubscription}