From fa9adade46d8ec3747a83ef0058d492a17b9cf51 Mon Sep 17 00:00:00 2001 From: Sneha Date: Mon, 18 Nov 2024 10:51:00 +0530 Subject: [PATCH] Update quote.vue Removing discount line item for insurance --- src/layouts/quote/quote.vue | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/layouts/quote/quote.vue b/src/layouts/quote/quote.vue index a2ed0f542..25826714c 100644 --- a/src/layouts/quote/quote.vue +++ b/src/layouts/quote/quote.vue @@ -533,11 +533,23 @@ export default { false ); } - this.dispatchStoreAction( - this.storeActions.SAVE_SUPPORTING_ITEMS, - this.lineItems.supportingItems, - false - ); + if (this.isInsuranceSelected && this.isServicePackageDiscountOnOrder) { + let supportingItems = this.lineItems.supportingItems; + supportingItems = supportingItems.filter((item) => { + return item.partType != this.servicePackageDiscountParts[0].partType; + }); + this.dispatchStoreAction( + this.storeActions.SAVE_SUPPORTING_ITEMS, + supportingItems, + false + ); + } else { + this.dispatchStoreAction( + this.storeActions.SAVE_SUPPORTING_ITEMS, + this.lineItems.supportingItems, + false + ); + } this.dispatchStoreAction(this.storeActions.SAVE_VAPS, this.lineItems.vaps, false); this.dispatchStoreAction( storeActions.SAVE_ACTIVE_AND_OR_INACTIVE_PROMOS,