CASH-2180: Filter out QPD parts
This commit is contained in:
parent
f04c3c607c
commit
35cb35100e
1 changed files with 7 additions and 11 deletions
|
|
@ -59,7 +59,6 @@ import store from "@/store";
|
||||||
import { flushSaveSessionQueue } from "@/helpers/heritage-integration/order-helper";
|
import { flushSaveSessionQueue } from "@/helpers/heritage-integration/order-helper";
|
||||||
import { errorMessages } from "@/constants/error-messages";
|
import { errorMessages } from "@/constants/error-messages";
|
||||||
import { required, regex } from "@/helpers/validation-rules";
|
import { required, regex } from "@/helpers/validation-rules";
|
||||||
import { partTypeStrings } from "@/constants/part-type-strings";
|
|
||||||
|
|
||||||
defineRule("insurance-company-required", required(errorMessages.INSURANCE_COMPANY_REQUIRED));
|
defineRule("insurance-company-required", required(errorMessages.INSURANCE_COMPANY_REQUIRED));
|
||||||
|
|
||||||
|
|
@ -198,17 +197,14 @@ export default {
|
||||||
},
|
},
|
||||||
removeQPDLineItemIfExists() {
|
removeQPDLineItemIfExists() {
|
||||||
const lineItems = deepClone(store.getters.order.lineItems);
|
const lineItems = deepClone(store.getters.order.lineItems);
|
||||||
const removeQPDpartIndex = lineItems?.supportingItems.findIndex(
|
lineItems.supportingItems = baseMixin.methods.filterOutQuotePageDiscountPart(
|
||||||
(item) => item.partType == partTypeStrings.QUOTE_PAGE_DISCOUNT
|
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() {
|
unmounted() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue