diff --git a/src/layouts/coverage-statement/coverage-statement.vue b/src/layouts/coverage-statement/coverage-statement.vue index ca4229e9..c40ce285 100644 --- a/src/layouts/coverage-statement/coverage-statement.vue +++ b/src/layouts/coverage-statement/coverage-statement.vue @@ -171,7 +171,8 @@ export default { ]; let pricingResults = []; - if (useMainStore().order.policy.policyLookupSuccessful) { + if (useMainStore().order.policy.policyLookupSuccessful && useMainStore().order.vehicle.policyVehicleId) { + await useMainStore().getFinalDeductible(); pricingResults = await useMainStore().getPriceOrderItems(availableLineItems) .catch((err) => { const errorPageData = { @@ -187,7 +188,6 @@ export default { useMainStore().updatePageData({ page: issPageValues.BAILOUT_PAGE, data: errorPageData }); next(`/?issPage=${issPageValues.BAILOUT_PAGE}`); }); - await useMainStore().getFinalDeductible(); } // Call the "next" function to complete the transition to this page. @@ -357,6 +357,7 @@ export default { async initializeComponent() { useMainStore().updatePolicyITACFlag(this.verifiedITAC); if (this.policyLookupSuccessful + && useMainStore().order.vehicle.policyVehicleId && useMainStore().isClaimRegistrationRequired && (this.coveredAndServicePriceAboveOrEqualDeductible || this.verifiedITAC)) { await useMainStore().registerClaim()?.catch(() => {}); diff --git a/src/store/index.js b/src/store/index.js index 2977af52..2f870abc 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -897,8 +897,7 @@ export const useMainStore = defineStore({ } const ctuToUse = this.order.serviceLocation.zipCodeCtu; const availableLineItemsFormattedForRequest = getLineItemQueryStringForPricing(availableLineItems); - const { policy } = this.order; - const deductibleToUse = this.damage.isRepair ? policy.deductible.repair : policy.deductible.replace; + const deductibleToUse = this.order.currentDeductible; let queryString = `ParentAccountNumber=${this.order.accountNumber}` @@ -1396,8 +1395,8 @@ export const useMainStore = defineStore({ this.order.policy.endorsements = vehicle?.endorsements; // TODO logic should be more complicated later on - this.order.originalDeductible = parseFloat(vehicle.deductible); - this.order.currentDeductible = parseFloat(vehicle.deductible); + this.order.originalDeductible = vehicle.deductible; + this.order.currentDeductible = vehicle.deductible; this.resetSupportingItemsState(); this.resetVapsState();