From f2fc50cd3e8fffb83af27682562839433f69d162 Mon Sep 17 00:00:00 2001 From: CarlNation <32103961+CarlNation@users.noreply.github.com> Date: Mon, 30 Oct 2023 11:20:43 -0400 Subject: [PATCH 1/4] CSR-1392 set amount due for PIA --- src/fmg-components/cart/cart.vue | 11 ----------- src/layouts/payment-method/payment-method.vue | 12 +++++++++++- src/layouts/payment/payment.vue | 6 ++---- src/mixins/base-mixin.js | 5 +++-- src/store/index.js | 1 - 5 files changed, 16 insertions(+), 19 deletions(-) diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index c48f48582..c38506f1c 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -129,8 +129,6 @@ export default { let vapsCartItemsForSelectedPackage = []; - console.log(this.cartItems); - console.log(packageContentTypes); this.cartItems.forEach((cartItem) => { packageContentTypes.forEach((vapType) => { if (vapType == cartItem.cartItemType) { @@ -153,17 +151,10 @@ export default { return vapsTypeName.Text; }, removeItem(cartItemType, category) { - console.log( - this.lineItems[category].filter( - (lineItemsToKeep) => lineItemsToKeep.cartItemType != cartItemType - ) - ); this.lineItems[category] = this.lineItems[category].filter( (lineItemsToKeep) => lineItemsToKeep.cartItemType != cartItemType ); - //console.log(`lineItemToDelete: ${lineItemIdToDelete}`) - this.$emit("update:modelValue", this.lineItems); }, }, @@ -269,8 +260,6 @@ export default { nonpackageCartItems() { const nonpackageCartItems = []; - console.log("packageCartItems"); - this.cartItems.forEach((cartItem) => { if (cartItem == this.recycleFeeCartItem || cartItem == this.mobileFeeCartItem) { return; diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index 59e17d92d..b7237d2b0 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -272,8 +272,18 @@ export default { false ); + // save lineitems as they now have salestax added + await this.dispatchStoreAction( + storeActions.SAVE_GLASS_PARTS, + this.lineItems.glassParts, + false + ); + await this.dispatchStoreAction( + storeActions.SAVE_SUPPORTING_ITEMS, + this.lineItems.supportingItems, + false + ); await this.dispatchStoreAction(storeActions.SAVE_VAPS, this.lineItems.vaps, false); - await this.dispatchStoreAction(storeActions.SAVE_PROMOS, this.lineItems.promos, false); if (this.paymentMethod == paymentMethods.LATER) { diff --git a/src/layouts/payment/payment.vue b/src/layouts/payment/payment.vue index 437fbe743..2b4121c98 100644 --- a/src/layouts/payment/payment.vue +++ b/src/layouts/payment/payment.vue @@ -419,12 +419,10 @@ export default { return itemsForPia; }, getAmountDue() { - return 1600; - //return baseMixin.methods.getAmountDue(store.getters.order.lineItems); + return baseMixin.methods.getAmountDue(store.getters.order.lineItems); }, getDisplayAmountDue() { - return "$1600.00"; - //return baseMixin.methods.getDisplayAmountDue(store.getters.order.lineItems); + return baseMixin.methods.getDisplayAmountDue(store.getters.order.lineItems); }, isPaypal() { if (this.getPaymentType() == "pp") { diff --git a/src/mixins/base-mixin.js b/src/mixins/base-mixin.js index 5a99a4960..1266d125b 100644 --- a/src/mixins/base-mixin.js +++ b/src/mixins/base-mixin.js @@ -114,7 +114,9 @@ export default { return totalPrice; }, getTotalLineItemPrice(lineItem) { - return lineItem.kitPrice + lineItem.laborAmount + lineItem.sellingPrice; + return ( + lineItem.kitPrice + lineItem.laborAmount + lineItem.sellingPrice + lineItem.salesTax + ); }, getDisplayAmountDue(lineItems) { return this.getAmountDue(lineItems).toLocaleString("en-US", { @@ -123,7 +125,6 @@ export default { }); }, getAmountDue(lineItems) { - // TODO: verify tax is included in lineitems var amountDue = 0; if (lineItems.glassParts) { amountDue = this.getTotalPriceOfAllLineItemsAndChildParts(lineItems.glassParts); diff --git a/src/store/index.js b/src/store/index.js index 6a9be935e..fa8add4bb 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1291,7 +1291,6 @@ export const actions = { }); syncLineItemIds(response.data, context.getters.order.lineItems.vaps); - console.log(response.data); return response; }, From deed0dfb5f1235847704fdbdb4893bab922c7732 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Mon, 30 Oct 2023 16:03:03 -0400 Subject: [PATCH 2/4] CSR-1392 set amount due for PIA --- src/constants/store-actions.js | 2 +- src/layouts/payment-method/payment-method.vue | 5 +++-- src/layouts/quote/quote.vue | 2 +- src/store/index.js | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/constants/store-actions.js b/src/constants/store-actions.js index bb2ef16a0..847b14477 100644 --- a/src/constants/store-actions.js +++ b/src/constants/store-actions.js @@ -73,7 +73,7 @@ const storeActions = { SAVE_VIN: "saveVin", SAVE_REGISTRATION_ADDRESS_LOOKUP: "saveRegistrationAddressLookup", SAVE_GLASS_PARTS: "saveGlassParts", - SAVE_GLASS_PART_PRICES: "saveGlassPartPrices", + SAVE_GLASS_PARTS_SUPPRESSING_STATE_RESETTING: "saveGlassPartsSuppressingStateResetting", SAVE_PART_QUESTION_ANSWERS: "savePartQuestionAnswers", RESET_MOLDING_AND_CAPABILITY_QUESTIONS_IF_NEEDED: "resetMoldingAndCapabilityQuestionAnswersIfNeeded", diff --git a/src/layouts/payment-method/payment-method.vue b/src/layouts/payment-method/payment-method.vue index aa82ecaf1..b147ec73f 100644 --- a/src/layouts/payment-method/payment-method.vue +++ b/src/layouts/payment-method/payment-method.vue @@ -271,12 +271,13 @@ export default { // save lineitems as they now have salestax added await this.dispatchStoreAction( - storeActions.SAVE_GLASS_PARTS, + storeActions.SAVE_GLASS_PARTS_SUPPRESSING_STATE_RESETTING, this.lineItems.glassParts, false ); + await this.dispatchStoreAction( - storeActions.SAVE_SUPPORTING_ITEMS, + storeActions.SAVE_SUPPORTING_ITEMS_SUPPRESSING_STATE_RESETTING, this.lineItems.supportingItems, false ); diff --git a/src/layouts/quote/quote.vue b/src/layouts/quote/quote.vue index 42916b47f..507532f4e 100644 --- a/src/layouts/quote/quote.vue +++ b/src/layouts/quote/quote.vue @@ -258,7 +258,7 @@ export default { if (this.pricedGlassParts.length > 0) { this.dispatchStoreAction( - this.storeActions.SAVE_GLASS_PART_PRICES, + this.storeActions.SAVE_GLASS_PARTS_SUPPRESSING_STATE_RESETTING, this.pricedGlassParts, false ); diff --git a/src/store/index.js b/src/store/index.js index 0e556059d..ab877f2b1 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -2381,7 +2381,7 @@ export const actions = { context.commit(storeMutations.UPDATE_GLASS_PARTS, parts); }, - saveGlassPartPrices(context, parts) { + saveGlassPartsSuppressingStateResetting(context, parts) { context.commit(storeMutations.UPDATE_GLASS_PARTS, parts); }, From 785a51fdcac725f84300d26eb51f850e6bac3386 Mon Sep 17 00:00:00 2001 From: hiteshkumar87 Date: Tue, 31 Oct 2023 13:43:45 +0530 Subject: [PATCH 3/4] customerPortalLoginToken customerPortalLoginToken --- src/constants/store-mutations.js | 1 + src/helpers/heritage-integration/order-helper.js | 1 + src/layouts/confirmation/confirmation.vue | 4 ++++ src/store/index.js | 7 +++++++ 4 files changed, 13 insertions(+) diff --git a/src/constants/store-mutations.js b/src/constants/store-mutations.js index b7ac47d38..4f1d4e395 100644 --- a/src/constants/store-mutations.js +++ b/src/constants/store-mutations.js @@ -53,6 +53,7 @@ const storeMutations = { UPDATE_IS_PIA: "updateIsPia", UPDATE_PIA_TYPE: "updatePiaType", WORK_ORDER_NUMBER: "updateWorkOrderNumber", + Customer_Portal_Login_Token: "updateCustomerPortalLoginToken", // EVENT BUS MUTATIONS ADD_EVENT_TO_BUS: "addEventToBus", diff --git a/src/helpers/heritage-integration/order-helper.js b/src/helpers/heritage-integration/order-helper.js index 01a5a780f..27bc735e3 100644 --- a/src/helpers/heritage-integration/order-helper.js +++ b/src/helpers/heritage-integration/order-helper.js @@ -162,6 +162,7 @@ async function saveSessionHelper( crmCustomerId: savedSessionInfo.data.crmCustomerId?.toString(), eon: savedSessionInfo.data.eon, workOrderNumber: savedSessionInfo.data.workOrderNumber, + customerPortalLoginToken: savedSessionInfo.data.customerPortalLoginToken, }, false ); diff --git a/src/layouts/confirmation/confirmation.vue b/src/layouts/confirmation/confirmation.vue index b958d5b9f..505f41bf0 100644 --- a/src/layouts/confirmation/confirmation.vue +++ b/src/layouts/confirmation/confirmation.vue @@ -94,9 +94,13 @@ export default { ScheduleConfirmationImage() { return this.getCmsContent("ScheduleConfirmationWidget", "Image"); }, + CustomerPortalLoginToken() { + return store.getters.order.customerPortalLoginToken; + }, ConfirmationEmailText() { return this.getCmsContent("ConfirmationEmailWidget", "BodyText") ?.replaceAll("{custom:MY_ACCOUNT_URL}", applicationConfig.MY_ACCOUNT) + ?.replaceAll("{custom:CUSTOMER_PORTAL_LOGIN_TOKEN}", this.CustomerPortalLoginToken) ?.replaceAll("<", "<") ?.replaceAll(">", ">"); }, diff --git a/src/store/index.js b/src/store/index.js index 0e556059d..aae6ba196 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -126,6 +126,7 @@ const getDefaultState = () => { referralCorrelationId: null, eon: null, workOrderNumber: null, + customerPortalLoginToken: null, }, applicationUser: { eventBus: [], @@ -245,6 +246,9 @@ export const mutations = { updateWorkOrderNumber(state, workOrderNumber) { state.order.workOrderNumber = workOrderNumber; }, + updateCustomerPortalLoginToken(state, customerPortalLoginToken) { + state.order.customerPortalLoginToken = customerPortalLoginToken; + }, updateCCToken(state, ccToken) { state.order.payment.ccToken.subscriptionId = ccToken.subscriptionId; state.order.payment.ccToken.expMonth = ccToken.expMonth; @@ -451,6 +455,7 @@ export const mutations = { state.order.referralDate = sessionInformation.order.referralDate; state.order.referralCorrelationId = sessionInformation.order.referralCorrelationId; state.order.eon = sessionInformation.order.eon; + state.order.customerPortalLoginToken = sessionInformation.order.CustomerPortalLoginToken; if (state.order.vehicle.vin !== sessionInformation.order.vehicle?.vin) { state.applicationUser.pageData[fmgPageValues.PART_QUESTIONS] = null; @@ -1014,6 +1019,7 @@ export const actions = { savedSessionId, crmCustomerId, workOrderNumber, + customerPortalLoginToken, } ) { context.commit(storeMutations.UPDATE_REFERRAL_NUMBER, referralNumber); @@ -1025,6 +1031,7 @@ export const actions = { context.commit(storeMutations.UPDATE_SAVED_SESSION_ID, savedSessionId); context.commit(storeMutations.UPDATE_CRM_CUSTOMER_ID, crmCustomerId); context.commit(storeMutations.WORK_ORDER_NUMBER, workOrderNumber); + context.commit(storeMutations.Customer_Portal_Login_Token, customerPortalLoginToken); }, logPageView( From c644bd4ef5e350188989904253cb8dc124f7ee0d Mon Sep 17 00:00:00 2001 From: CarlNation Date: Tue, 31 Oct 2023 08:17:00 -0400 Subject: [PATCH 4/4] CSR-1392 correct vaps amount check --- src/mixins/base-mixin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mixins/base-mixin.js b/src/mixins/base-mixin.js index 1266d125b..02f1ed960 100644 --- a/src/mixins/base-mixin.js +++ b/src/mixins/base-mixin.js @@ -134,7 +134,7 @@ export default { lineItems.supportingItems ); } - if (lineItems.supportingItems.vaps) { + if (lineItems.vaps) { amountDue += this.getTotalPriceOfAllLineItemsAndChildParts(lineItems.vaps); } return amountDue;