CASH-415
CASH-415 do not get the pricing by day part or price it when insurance or in the control variation of the experiment
This commit is contained in:
parent
d365390938
commit
9f3b901ce2
1 changed files with 27 additions and 26 deletions
|
|
@ -306,7 +306,7 @@ export default {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Get pricingByDayUpcharge needed for Pricing By Day
|
// Get pricingByDayUpcharge needed for Pricing By Day
|
||||||
const pricingByDayUpchargePartPromise = getPricingByDayPartWithPrice();
|
const pricingByDayUpchargePartPromise = showPricingByDay ? getPricingByDayPartWithPrice() : null;
|
||||||
|
|
||||||
const premiumFeePromise = baseMixin.methods.dispatchStoreActionWithLogging(
|
const premiumFeePromise = baseMixin.methods.dispatchStoreActionWithLogging(
|
||||||
storeActions.GET_MOBILE_PREMIUM_FEE,
|
storeActions.GET_MOBILE_PREMIUM_FEE,
|
||||||
|
|
@ -354,10 +354,7 @@ export default {
|
||||||
|
|
||||||
const resultMap = await settleAllPromises(promiseResultMap);
|
const resultMap = await settleAllPromises(promiseResultMap);
|
||||||
|
|
||||||
const pricingByDayUpcharge = await baseMixin.methods.getTotalLineItemPrice(
|
const pricingByDayUpcharge = showPricingByDay ? await baseMixin.methods.getTotalLineItemPrice(resultMap.pricingByDayUpchargePart,false) : null;
|
||||||
resultMap.pricingByDayUpchargePart,
|
|
||||||
false
|
|
||||||
);
|
|
||||||
|
|
||||||
const datePickerInitialData = resultMap.datePickerInitialData;
|
const datePickerInitialData = resultMap.datePickerInitialData;
|
||||||
datePickerInitialData.pricingByDayBasePrice = pricingByDayBasePrice;
|
datePickerInitialData.pricingByDayBasePrice = pricingByDayBasePrice;
|
||||||
|
|
@ -626,24 +623,26 @@ export default {
|
||||||
const supportingItems = this.getSupportingItems();
|
const supportingItems = this.getSupportingItems();
|
||||||
|
|
||||||
// if we have a pricing by day upcharge, then save/update supporting items with it
|
// if we have a pricing by day upcharge, then save/update supporting items with it
|
||||||
const pricingByDayUpchargeFeeIndex = supportingItems?.findIndex(
|
if (this.showPricingByDay) {
|
||||||
(item) => item.partType == PRICING_BY_DAY_PART_TYPE
|
const pricingByDayUpchargeFeeIndex = supportingItems?.findIndex(
|
||||||
);
|
(item) => item.partType == PRICING_BY_DAY_PART_TYPE
|
||||||
|
);
|
||||||
|
|
||||||
if (this.includePricingByDayUpcharge) {
|
if (this.includePricingByDayUpcharge) {
|
||||||
if (pricingByDayUpchargeFeeIndex > -1) {
|
if (pricingByDayUpchargeFeeIndex > -1) {
|
||||||
supportingItems[pricingByDayUpchargeFeeIndex].laborAmount =
|
supportingItems[pricingByDayUpchargeFeeIndex].laborAmount =
|
||||||
this.pricingByDayUpchargeLineItem.laborAmount;
|
this.pricingByDayUpchargeLineItem.laborAmount;
|
||||||
supportingItems[pricingByDayUpchargeFeeIndex].sellingPrice =
|
supportingItems[pricingByDayUpchargeFeeIndex].sellingPrice =
|
||||||
this.pricingByDayUpchargeLineItem.sellingPrice;
|
this.pricingByDayUpchargeLineItem.sellingPrice;
|
||||||
supportingItems[pricingByDayUpchargeFeeIndex].kitPrice =
|
supportingItems[pricingByDayUpchargeFeeIndex].kitPrice =
|
||||||
this.pricingByDayUpchargeLineItem.kitPrice;
|
this.pricingByDayUpchargeLineItem.kitPrice;
|
||||||
|
} else {
|
||||||
|
supportingItems.push(this.pricingByDayUpchargeLineItem);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
supportingItems.push(this.pricingByDayUpchargeLineItem);
|
if (pricingByDayUpchargeFeeIndex >= 0) {
|
||||||
}
|
supportingItems.splice(pricingByDayUpchargeFeeIndex, 1);
|
||||||
} else {
|
}
|
||||||
if (pricingByDayUpchargeFeeIndex >= 0) {
|
|
||||||
supportingItems.splice(pricingByDayUpchargeFeeIndex, 1);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -672,12 +671,14 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
// if it's not a mobile and/or premium early bird, then make sure we remove any that may have been added
|
// if it's not a mobile and/or premium early bird, then make sure we remove any that may have been added
|
||||||
const removePremiumFeeIndex = supportingItems.findIndex(
|
if (this.showPricingByDay) {
|
||||||
(item) => item.partType == PREMIUM_FEE_PART_TYPE
|
const removePremiumFeeIndex = supportingItems.findIndex(
|
||||||
);
|
(item) => item.partType == PREMIUM_FEE_PART_TYPE
|
||||||
|
);
|
||||||
|
|
||||||
if (removePremiumFeeIndex >= 0) {
|
if (removePremiumFeeIndex >= 0) {
|
||||||
supportingItems.splice(removePremiumFeeIndex, 1);
|
supportingItems.splice(removePremiumFeeIndex, 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue