From f04c3c607cb7b91be1f491f18e2f9e451a5abcee Mon Sep 17 00:00:00 2001 From: Chris Redelinghuys Date: Thu, 15 Jan 2026 14:45:42 -0500 Subject: [PATCH 1/3] CASH-2180: Remove QPD parts for insurance orders --- .../insurance-company/insurance-company.vue | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/layouts/insurance-company/insurance-company.vue b/src/layouts/insurance-company/insurance-company.vue index 21c62078a..0ec8fd5e9 100644 --- a/src/layouts/insurance-company/insurance-company.vue +++ b/src/layouts/insurance-company/insurance-company.vue @@ -59,6 +59,7 @@ import store from "@/store"; import { flushSaveSessionQueue } from "@/helpers/heritage-integration/order-helper"; import { errorMessages } from "@/constants/error-messages"; import { required, regex } from "@/helpers/validation-rules"; +import { partTypeStrings } from "@/constants/part-type-strings"; defineRule("insurance-company-required", required(errorMessages.INSURANCE_COMPANY_REQUIRED)); @@ -164,6 +165,8 @@ export default { // 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 flushSaveSessionQueue(); + this.removeQPDLineItemIfExists(); + await this.dispatchStoreAction( this.storeActions.SAVE_PARENT_ACCOUNT_NUMBER, this.parentAccountNumber.toString(), @@ -193,6 +196,20 @@ export default { handlePageShow() { window.location.reload(); }, + removeQPDLineItemIfExists() { + const lineItems = deepClone(store.getters.order.lineItems); + const removeQPDpartIndex = lineItems?.supportingItems.findIndex( + (item) => item.partType == partTypeStrings.QUOTE_PAGE_DISCOUNT + ); + if (removeQPDpartIndex >= 0) { + lineItems.supportingItems.splice(removeQPDpartIndex, 1); + baseMixin.methods.dispatchStoreAction( + storeActions.SAVE_SUPPORTING_ITEMS_SUPPRESSING_STATE_RESETTING, + lineItems.supportingItems, + false + ); + } + }, }, unmounted() { window.removeEventListener("pageshow", this.handlePageShow); From 35cb35100e259a2f4abc7683950f6631aa016902 Mon Sep 17 00:00:00 2001 From: Chris Redelinghuys Date: Thu, 15 Jan 2026 15:35:59 -0500 Subject: [PATCH 2/3] CASH-2180: Filter out QPD parts --- .../insurance-company/insurance-company.vue | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/layouts/insurance-company/insurance-company.vue b/src/layouts/insurance-company/insurance-company.vue index 0ec8fd5e9..4da99fec9 100644 --- a/src/layouts/insurance-company/insurance-company.vue +++ b/src/layouts/insurance-company/insurance-company.vue @@ -59,7 +59,6 @@ import store from "@/store"; import { flushSaveSessionQueue } from "@/helpers/heritage-integration/order-helper"; import { errorMessages } from "@/constants/error-messages"; import { required, regex } from "@/helpers/validation-rules"; -import { partTypeStrings } from "@/constants/part-type-strings"; defineRule("insurance-company-required", required(errorMessages.INSURANCE_COMPANY_REQUIRED)); @@ -198,17 +197,14 @@ export default { }, removeQPDLineItemIfExists() { const lineItems = deepClone(store.getters.order.lineItems); - const removeQPDpartIndex = lineItems?.supportingItems.findIndex( - (item) => item.partType == partTypeStrings.QUOTE_PAGE_DISCOUNT + lineItems.supportingItems = baseMixin.methods.filterOutQuotePageDiscountPart( + lineItems.supportingItems + ); + baseMixin.methods.dispatchStoreAction( + storeActions.SAVE_SUPPORTING_ITEMS_SUPPRESSING_STATE_RESETTING, + lineItems.supportingItems, + false ); - if (removeQPDpartIndex >= 0) { - lineItems.supportingItems.splice(removeQPDpartIndex, 1); - baseMixin.methods.dispatchStoreAction( - storeActions.SAVE_SUPPORTING_ITEMS_SUPPRESSING_STATE_RESETTING, - lineItems.supportingItems, - false - ); - } }, }, unmounted() { From 570b70465959d69dd0b099b1dd764ab58343e269 Mon Sep 17 00:00:00 2001 From: Chris Redelinghuys Date: Thu, 15 Jan 2026 15:52:08 -0500 Subject: [PATCH 3/3] CASH-2180: Make asynchronous --- src/layouts/insurance-company/insurance-company.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/layouts/insurance-company/insurance-company.vue b/src/layouts/insurance-company/insurance-company.vue index 4da99fec9..1455847bd 100644 --- a/src/layouts/insurance-company/insurance-company.vue +++ b/src/layouts/insurance-company/insurance-company.vue @@ -164,7 +164,7 @@ export default { // 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 flushSaveSessionQueue(); - this.removeQPDLineItemIfExists(); + await this.removeQPDLineItemIfExists(); await this.dispatchStoreAction( this.storeActions.SAVE_PARENT_ACCOUNT_NUMBER, @@ -195,12 +195,12 @@ export default { handlePageShow() { window.location.reload(); }, - removeQPDLineItemIfExists() { + async removeQPDLineItemIfExists() { const lineItems = deepClone(store.getters.order.lineItems); lineItems.supportingItems = baseMixin.methods.filterOutQuotePageDiscountPart( lineItems.supportingItems ); - baseMixin.methods.dispatchStoreAction( + await baseMixin.methods.dispatchStoreAction( storeActions.SAVE_SUPPORTING_ITEMS_SUPPRESSING_STATE_RESETTING, lineItems.supportingItems, false