CSR-2253
CSR-2253 default option threshold on save quote email
This commit is contained in:
parent
b8b816abb7
commit
1c55729af5
1 changed files with 31 additions and 22 deletions
|
|
@ -299,8 +299,9 @@ export default {
|
|||
|
||||
const getIsInsuranceSelectedValue = (availableLineItems, insuranceThreshold) => {
|
||||
const serviceLocationState = store.getters.order.serviceLocation.state;
|
||||
// Override if coming back from QuoteDetails. Remove override after Quote release
|
||||
const isInsuranceOverrideValue = to.query?.isInsurance;
|
||||
|
||||
// usually true when returning from heritage but can be false when returning from heritage on a save quote
|
||||
const isInsuranceFromQueryString = to.query?.isInsurance;
|
||||
const defaultIsInsuranceSelectedValue = store.getters.order.payment.isInsurance;
|
||||
const hideRecalCost =
|
||||
experimentMixin.methods
|
||||
|
|
@ -311,34 +312,42 @@ export default {
|
|||
if (
|
||||
serviceLocationState != null &&
|
||||
payWithInsuranceStates.find((item) => item === serviceLocationState)
|
||||
)
|
||||
) {
|
||||
return true;
|
||||
else if (isInsuranceOverrideValue != null) {
|
||||
return isInsuranceOverrideValue == "true";
|
||||
} else if (defaultIsInsuranceSelectedValue != null) {
|
||||
return defaultIsInsuranceSelectedValue;
|
||||
} else {
|
||||
if (availableLineItems) {
|
||||
const lineItemsForCalculatingPrice = hideRecalCost
|
||||
? baseMixin.methods.filterOutFees(
|
||||
baseMixin.methods.filterOutRecalibration(availableLineItems) // Strip out recal before filtering out fees
|
||||
)
|
||||
: baseMixin.methods.filterOutFees(availableLineItems);
|
||||
|
||||
return (
|
||||
baseMixin.methods.getTierOnePackagePrice(lineItemsForCalculatingPrice) >
|
||||
insuranceThreshold
|
||||
); // compare base price vs arbitrary threshold (representing insurance price)
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
if (defaultIsInsuranceSelectedValue != null) {
|
||||
return defaultIsInsuranceSelectedValue;
|
||||
}
|
||||
|
||||
if (availableLineItems) {
|
||||
const lineItemsForCalculatingPrice = hideRecalCost
|
||||
? baseMixin.methods.filterOutFees(
|
||||
baseMixin.methods.filterOutRecalibration(availableLineItems) // Strip out recal before filtering out fees
|
||||
)
|
||||
: baseMixin.methods.filterOutFees(availableLineItems);
|
||||
|
||||
if (isInsuranceFromQueryString != null) {
|
||||
if (isInsuranceFromQueryString == "true") {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
baseMixin.methods.getTierOnePackagePrice(lineItemsForCalculatingPrice) >
|
||||
insuranceThreshold
|
||||
); // compare base price vs arbitrary threshold (representing insurance price)
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
let thresholdToUse = INSURANCE_TAB_TO_DISPLAY_THRESHOLD_DEFAULT;
|
||||
let internalThreshold = experimentMixin.methods.getSettingValue(
|
||||
experimentSettings.INSURANCE_TAB_TO_DISPLAY_THRESHOLD_INTERNAL
|
||||
);
|
||||
const isExternalParameter = store.getters.externalParameterState?.isExternalParameter;
|
||||
console.log("parm:" + isExternalParameter);
|
||||
|
||||
if (isExternalParameter === externalParameterStatus.NOT_SET) {
|
||||
// there are no active or inactive external parameters; use internal threshold
|
||||
|
|
|
|||
Loading…
Reference in a new issue