Merge branch 'develop' into feature/stimulus
This commit is contained in:
+22
-10
@@ -36,13 +36,13 @@
|
||||
</div>
|
||||
<div class="form-group" v-show="boards.length > 0 && !submitted">
|
||||
<label>Optionale Verpflegungsleistungen</label>
|
||||
<select class="form-control" v-model="selectedBoard" v-if="selectedPax >= 30">
|
||||
<select class="form-control" v-model="selectedBoard" v-if="totalPax >= 30">
|
||||
<option :value="null">Keine Auswahl</option>
|
||||
<option v-for="board of boards" :value="board" :key="board.uid">{{ board.title }}
|
||||
({{ formatCurrency(board.price) }} pro Person und Nacht)
|
||||
</option>
|
||||
</select>
|
||||
<div v-show="selectedPax < 30">
|
||||
<div v-show="totalPax < 30">
|
||||
<span class="label label-warning">Erst ab 30 Personen buchbar.</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -170,7 +170,20 @@ export default {
|
||||
optionsJson: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
runningCostsFactor: {
|
||||
type: Number,
|
||||
default: 1.7,
|
||||
},
|
||||
shortTermFactors: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {
|
||||
2: 0.2,
|
||||
3: 0.1,
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -242,7 +255,7 @@ export default {
|
||||
this.selectedRange = range;
|
||||
},
|
||||
onPaxUpdated() {
|
||||
if (this.selectedPax < 30) {
|
||||
if (this.totalPax < 30) {
|
||||
this.selectedBoard = null;
|
||||
}
|
||||
},
|
||||
@@ -373,11 +386,10 @@ export default {
|
||||
priceShortTerm() {
|
||||
let price = 0;
|
||||
const totalPricePax = (this.pricePax.base + this.pricePax.additional);
|
||||
if (2 === this.nightsCount) {
|
||||
price = totalPricePax * 0.2;
|
||||
}
|
||||
if (3 === this.nightsCount) {
|
||||
price = totalPricePax * 0.1;
|
||||
for (let [nights, factor] of Object.entries(this.shortTermFactors)) {
|
||||
if (nights === this.nightsCount) {
|
||||
price = totalPricePax * factor;
|
||||
}
|
||||
}
|
||||
return price;
|
||||
},
|
||||
@@ -385,7 +397,7 @@ export default {
|
||||
if (this.selectedBoard) {
|
||||
return 0;
|
||||
}
|
||||
return this.nightsCount * this.totalPax * 1.7;
|
||||
return this.nightsCount * this.totalPax * this.runningCostsFactor;
|
||||
},
|
||||
priceTotal() {
|
||||
return this.pricePax.base + this.pricePax.additional + this.priceOptions
|
||||
|
||||
Reference in New Issue
Block a user