Merge branch 'develop' into feature/CSR-1977-ajc

This commit is contained in:
Adam Caouette 2024-03-18 11:38:40 -04:00
commit 636f8476af
8 changed files with 42 additions and 8 deletions

View file

@ -103,6 +103,7 @@
class="small mt-4"
v-model="lineItems"
:addableVaps="availableVaps"
:pageName="pageName"
modalWidgetName="PromoModalWidget" />
</div>
</div>
@ -145,6 +146,7 @@ export default {
damage: Object,
servicePackageOptionsCmsName: String,
availableVaps: Object,
pageName: String,
allowItemRemoval: Boolean,
recyclingModalCmsWidgetName: String,
showAsPaid: Boolean,

View file

@ -129,6 +129,11 @@ export async function navigateToHeritageFunnel({ shouldSaveSession, pageNameToLo
heritageParms["forceEndToEndInsurance"] = true;
}
// if they are going to heritage and already have a policy number then this is a nav back flow
if (store.getters.policy.policyNumber) {
heritageParms["insuranceNavBack"] = true;
}
router.navigateToExternalUrl(externalUrls.HERITAGE_FUNNEL, heritageParms);
}

View file

@ -166,6 +166,7 @@ async function saveSessionHelper(
customerPortalLoginToken: savedSessionInfo.data.customerPortalLoginToken,
lockToken: savedSessionInfo.data.lockToken,
settledTenderAmount: savedSessionInfo.data.settledTenderAmount,
billToAccountNumber: savedSessionInfo.data.billToAccountNumber,
},
false
);

View file

@ -119,6 +119,7 @@ export default {
return {
searchableInsuranceCompanyList: [],
originalList: [],
selectedParentAccount: "",
};
},
methods: {
@ -142,8 +143,11 @@ export default {
// Go back to Quote page
this.$router.navigateWithoutSaving(this.navigationScenarios.CLICKED_BACK, this.$route);
},
forwardButtonAction() {
this.dispatchStoreAction(
async forwardButtonAction() {
// await any pending save-sessions. if you don't, we will save the new parent account into vuex and then a pending async save-session response overwrites it
await store.getters.applicationUser.saveSessionPromise;
await this.dispatchStoreAction(
this.storeActions.SAVE_PARENT_ACCOUNT_NUMBER,
this.selectedParentAccount,
false
@ -156,12 +160,12 @@ export default {
});
},
selectParentAccountNumber(parentAccountName) {
if (!this.insuranceCompanyList) {
if (!this.searchableInsuranceCompanyList) {
console.error("No insurance companies found");
return;
}
var selectedItem = this.insuranceCompanyList.filter((item) => {
var selectedItem = this.searchableInsuranceCompanyList.filter((item) => {
return item.accountName === parentAccountName;
});

View file

@ -26,6 +26,7 @@
:availableVaps="availableVaps"
:allowItemRemoval="true"
v-model="lineItems"
pageName="payment-method"
servicePackageOptionsCmsName="ServicePackageTitle"
recyclingModalCmsWidgetName="RecycleModal" />

View file

@ -29,6 +29,8 @@
<script>
import { splitCopyOnCMSPlaceHolder } from "@/helpers/cms-content-helper";
import baseMixin from "@/mixins/base-mixin.js";
import { getPromosThatMatchLineItemsOnOrder } from "@/helpers/promotions-helper";
import { getArrayOfAllLineItems } from "@/store";
const INLINE_IMAGE_TOKEN = "custom:inlineImage";
const AFTERPAY_PRICE_TOKEN = "custom:afterpayPrice";
@ -50,7 +52,9 @@ export default {
name: "afterpay-modal-banner",
props: {
cmsWidgetName: String,
availableLineItems: Array,
lineItems: Array,
activePromos: null,
},
data() {
return {};
@ -62,7 +66,7 @@ export default {
},
computed: {
nullSafeLineItems() {
return this.lineItems ?? [];
return this.availableLineItems ?? [];
},
imageUrl() {
return this.getCmsContent(this.cmsWidgetName, "Image");
@ -77,10 +81,23 @@ export default {
return this.getCmsContent(this.cmsWidgetName, "SubheaderText");
},
afterpayPrice() {
const price = baseMixin.methods.getTierOnePackagePrice(
let price = baseMixin.methods.getTierOnePackagePrice(
baseMixin.methods.filterOutFees(this.nullSafeLineItems)
);
let vapsLineItemsForSelectedPackage = this.lineItems.vaps;
vapsLineItemsForSelectedPackage.forEach((lineItem) => {
price += baseMixin.methods.getTotalLineItemPrice(lineItem);
});
if (this.activePromos) {
let allLineItems = getArrayOfAllLineItems(this.lineItems);
const promos = getPromosThatMatchLineItemsOnOrder(this.activePromos, allLineItems);
promos.forEach((promo) => {
price += baseMixin.methods.getTotalLineItemPrice(promo);
});
}
const adjusted = (price / 4).toFixed(2);
return `$${adjusted}`;

View file

@ -37,7 +37,9 @@
<afterpayModalBanner
v-if="!isInsuranceSelected"
cmsWidgetName="AfterpayModalWidget"
:lineItems="availableLineItems" />
:activePromos="lineItems.promos"
:availableLineItems="availableLineItems"
:lineItems="lineItems" />
<promoModalQuestion
class="small mt-4"

View file

@ -1069,6 +1069,7 @@ export const actions = {
customerPortalLoginToken,
lockToken,
settledTenderAmount,
billToAccountNumber,
}
) {
context.commit(storeMutations.UPDATE_REFERRAL_NUMBER, referralNumber);
@ -1084,6 +1085,7 @@ export const actions = {
context.commit(storeMutations.LOCK_TOKEN, lockToken);
context.commit(storeMutations.Customer_Portal_Login_Token, customerPortalLoginToken);
context.commit(storeMutations.UPDATE_SETTLED_TENDER_AMOUNT, settledTenderAmount);
context.commit(storeMutations.UPDATE_BILL_TO_ACCT_NUMBER, billToAccountNumber);
},
logPageView(
@ -2827,7 +2829,7 @@ export function mapTaxedLineItemsToStoreFormat(availableLineItems, storeLineItem
return lineItems;
}
function getArrayOfAllLineItems(lineItems) {
export function getArrayOfAllLineItems(lineItems) {
let consolidatedLineItemsArray = [];
if (lineItems.glassParts != null)