fix: proper handling of chf prices and included services
closes #8698d0hxe
This commit is contained in:
+4
-7
@@ -336,9 +336,6 @@ export default {
|
||||
selectedTo: null,
|
||||
selectedRange: [],
|
||||
selectedPax: 30,
|
||||
selectedPaxGroup1: 0,
|
||||
selectedPaxGroup2: 0,
|
||||
selectedPaxGroup3: 30,
|
||||
selectedOptions: [],
|
||||
selectedBoard: null,
|
||||
name: null,
|
||||
@@ -355,7 +352,7 @@ export default {
|
||||
formatCurrency({ EUR, CHF }) {
|
||||
let price
|
||||
|
||||
if ('CH' === this.countryCode && 0 < CHF) {
|
||||
if ('CH' === this.countryCode) {
|
||||
let formatter = new Intl.NumberFormat('de-DE', {
|
||||
style: 'currency',
|
||||
currency: 'CHF',
|
||||
@@ -385,7 +382,7 @@ export default {
|
||||
return ` (${this.formatCurrency(option.price)})`
|
||||
},
|
||||
optionPrice(option) {
|
||||
let factor = true === option.ignoreWithBoard && this.selectedBoard ? -1 : 1
|
||||
let factor = (true === option.ignoreWithBoard && this.selectedBoard) ? 0 : 1
|
||||
|
||||
return {
|
||||
EUR: option.price.EUR * factor,
|
||||
@@ -529,8 +526,8 @@ export default {
|
||||
let optionPriceEUR = option.price.EUR
|
||||
let optionPriceCHF = option.price.CHF
|
||||
if (true === option.ignoreWithBoard && this.selectedBoard) {
|
||||
optionPriceEUR = -optionPriceEUR
|
||||
optionPriceCHF = -optionPriceCHF
|
||||
optionPriceEUR = 0
|
||||
optionPriceCHF = 0
|
||||
}
|
||||
if (1 === option.type) {
|
||||
price.EUR += optionPriceEUR;
|
||||
|
||||
Reference in New Issue
Block a user