CSR-2237
CSR-2237 Added new getter that checks the 7777 and 9999 deductibles when determining if coverage is verified. Added the amount of vaps due to the amount due when using deductible/verified pricing.
This commit is contained in:
parent
62d550750f
commit
8ebd0cd306
3 changed files with 35 additions and 9 deletions
|
|
@ -626,13 +626,16 @@ export default {
|
||||||
},
|
},
|
||||||
showInsuranceCoverageAs() {
|
showInsuranceCoverageAs() {
|
||||||
if (!this.isInsurance) return null;
|
if (!this.isInsurance) return null;
|
||||||
|
|
||||||
if (this.isNoComp || this.isItac) {
|
if (this.isNoComp || this.isItac) {
|
||||||
return coverageStatus.NOCOMP;
|
return coverageStatus.NOCOMP;
|
||||||
} else {
|
|
||||||
return this.hasSubmittedOrder()
|
|
||||||
? this.getSubmittedOrder()?.payment.insuranceCoverage.coverageStatus
|
|
||||||
: this.$store.getters.payment.insuranceCoverage.coverageStatus;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.$store.getters.coverageIsVerified) {
|
||||||
|
return coverageStatus.VERIFIED;
|
||||||
|
}
|
||||||
|
|
||||||
|
return coverageStatus.PENDING;
|
||||||
},
|
},
|
||||||
currentDeductible() {
|
currentDeductible() {
|
||||||
return this.hasSubmittedOrder()
|
return this.hasSubmittedOrder()
|
||||||
|
|
|
||||||
|
|
@ -167,13 +167,18 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
const order = this.hasSubmittedOrder() ? this.getSubmittedOrder() : store.getters.order;
|
const order = this.hasSubmittedOrder() ? this.getSubmittedOrder() : store.getters.order;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
order.payment.insuranceCoverage.isVerified &&
|
store.getters.coverageIsVerified &&
|
||||||
!order.policy.isNoComp &&
|
!order.policy.isNoComp &&
|
||||||
!order.policy.isItac
|
!order.policy.isItac
|
||||||
) {
|
) {
|
||||||
amountDue = order.policy.currentDeductible;
|
amountDue = order.policy.currentDeductible;
|
||||||
|
if (lineItems.vaps) {
|
||||||
|
amountDue += this.getTotalPriceOfAllLineItemsAndChildParts(
|
||||||
|
lineItems.vaps,
|
||||||
|
includeTax
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ((amountDue * 100) / 100).toFixed(2);
|
return ((amountDue * 100) / 100).toFixed(2);
|
||||||
|
|
|
||||||
|
|
@ -774,6 +774,24 @@ export const getters = {
|
||||||
);
|
);
|
||||||
return !!nonWindshieldItems?.length;
|
return !!nonWindshieldItems?.length;
|
||||||
},
|
},
|
||||||
|
coverageIsVerified: (state) => {
|
||||||
|
let order;
|
||||||
|
if (window.sessionStorage.getItem("submittedOrder") !== null) {
|
||||||
|
order = JSON.parse(window.sessionStorage.getItem("submittedOrder"));
|
||||||
|
} else {
|
||||||
|
order = state.order;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
order.payment?.insuranceCoverage?.isVerified &&
|
||||||
|
order.policy?.currentDeductible != 9999 &&
|
||||||
|
order.policy?.currentDeductible != 7777
|
||||||
|
) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
},
|
||||||
isMobileAppointment: (state) => {
|
isMobileAppointment: (state) => {
|
||||||
return state.order.serviceLocation.appointmentType === AppointmentTypeStrings.MOBILE;
|
return state.order.serviceLocation.appointmentType === AppointmentTypeStrings.MOBILE;
|
||||||
},
|
},
|
||||||
|
|
@ -899,13 +917,13 @@ export const getters = {
|
||||||
isVerifiedAndDeductibleZeroConfirmed: (state) => {
|
isVerifiedAndDeductibleZeroConfirmed: (state) => {
|
||||||
// used as a CMS variable on /payment-method, needed for FunnelSubHeaderWidget on cart pages
|
// used as a CMS variable on /payment-method, needed for FunnelSubHeaderWidget on cart pages
|
||||||
if (
|
if (
|
||||||
(state.order.policy.currentDeductible === 0 ||
|
state.order.policy.currentDeductible === 0 &&
|
||||||
state.order.policy.currentDeductible > 0) &&
|
getters.coverageIsVerified(state) &&
|
||||||
state.order.payment.insuranceCoverage.coverageStatus === coverageStatus.VERIFIED &&
|
|
||||||
!state.order.policy.isNoComp
|
!state.order.policy.isNoComp
|
||||||
) {
|
) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
requiresVerifiedRedirecting: (state) => {
|
requiresVerifiedRedirecting: (state) => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue