Merge pull request #1553 from Safelite/feature/CSR-1757
Feature/csr 1757
This commit is contained in:
commit
6125d8a00e
4 changed files with 50 additions and 0 deletions
|
|
@ -9,6 +9,7 @@ const cartItemTypes = {
|
||||||
MOBILE_FEE: "MOBILE FEE",
|
MOBILE_FEE: "MOBILE FEE",
|
||||||
PROMOS: "PROMOS",
|
PROMOS: "PROMOS",
|
||||||
EARLY_BIRD: "EARLY BIRD",
|
EARLY_BIRD: "EARLY BIRD",
|
||||||
|
SUPPLIES_REPAIR: "SUPPLIES-REPAIR",
|
||||||
};
|
};
|
||||||
|
|
||||||
export { cartItemTypes };
|
export { cartItemTypes };
|
||||||
|
|
|
||||||
|
|
@ -227,6 +227,10 @@ export default {
|
||||||
cartItems.push(this.recycleFeeCartItem);
|
cartItems.push(this.recycleFeeCartItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.suppliesRepairCartItem) {
|
||||||
|
cartItems.push(this.suppliesRepairCartItem);
|
||||||
|
}
|
||||||
|
|
||||||
if (this.mobileFeeCartItem) {
|
if (this.mobileFeeCartItem) {
|
||||||
cartItems.push(this.mobileFeeCartItem);
|
cartItems.push(this.mobileFeeCartItem);
|
||||||
}
|
}
|
||||||
|
|
@ -508,6 +512,45 @@ export default {
|
||||||
|
|
||||||
return cartItem;
|
return cartItem;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
suppliesRepairCartItemName() {
|
||||||
|
return this.getCmsContent("SuppliesRepairTextWidget", "Text");
|
||||||
|
},
|
||||||
|
suppliesRepairCartItem() {
|
||||||
|
let cartItem = null;
|
||||||
|
|
||||||
|
const suppliesRepairLineItem = this.supportingItems.find(
|
||||||
|
(supportingItem) =>
|
||||||
|
supportingItem.partType == partTypeStrings.REPAIR_FEE &&
|
||||||
|
supportingItem.partNumber != "WSREPAIR"
|
||||||
|
);
|
||||||
|
|
||||||
|
if (suppliesRepairLineItem) {
|
||||||
|
cartItem = {
|
||||||
|
name: this.suppliesRepairCartItemName,
|
||||||
|
category: cartItemCategories.SUPPORTING_ITEMS,
|
||||||
|
cartItemType: cartItemTypes.SUPPLIES_REPAIR,
|
||||||
|
isDisplayed: true,
|
||||||
|
isRemovable: false,
|
||||||
|
subTotal: 0,
|
||||||
|
salesTax: 0,
|
||||||
|
lineItems: [],
|
||||||
|
};
|
||||||
|
|
||||||
|
suppliesRepairLineItem.cartItemType = cartItem.cartItemType;
|
||||||
|
cartItem.lineItems.push(suppliesRepairLineItem);
|
||||||
|
|
||||||
|
cartItem.subTotal +=
|
||||||
|
(suppliesRepairLineItem.kitPrice ?? 0) +
|
||||||
|
(suppliesRepairLineItem.laborAmount ?? 0) +
|
||||||
|
(suppliesRepairLineItem.sellingPrice ?? 0);
|
||||||
|
|
||||||
|
cartItem.salesTax = suppliesRepairLineItem.salesTax ?? 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return cartItem;
|
||||||
|
},
|
||||||
|
|
||||||
mobileFeeCartItemName() {
|
mobileFeeCartItemName() {
|
||||||
return this.getCmsContent("MobileServiceTextWidget", "Text");
|
return this.getCmsContent("MobileServiceTextWidget", "Text");
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -323,6 +323,9 @@ export default {
|
||||||
);
|
);
|
||||||
|
|
||||||
const newValidatedPromos = validatePromoResponse?.orderPromos ?? [];
|
const newValidatedPromos = validatePromoResponse?.orderPromos ?? [];
|
||||||
|
newValidatedPromos.push(
|
||||||
|
...(revalidatePromoResponse ? revalidatePromoResponse.promoLineItems : [])
|
||||||
|
);
|
||||||
|
|
||||||
pricedLineItemsToTax.push(...newValidatedPromos);
|
pricedLineItemsToTax.push(...newValidatedPromos);
|
||||||
// End of promo logic
|
// End of promo logic
|
||||||
|
|
|
||||||
|
|
@ -149,6 +149,9 @@ export default {
|
||||||
if (lineItems.vaps) {
|
if (lineItems.vaps) {
|
||||||
amountDue += this.getTotalPriceOfAllLineItemsAndChildParts(lineItems.vaps, true);
|
amountDue += this.getTotalPriceOfAllLineItemsAndChildParts(lineItems.vaps, true);
|
||||||
}
|
}
|
||||||
|
if (lineItems.promos) {
|
||||||
|
amountDue += this.getTotalPriceOfAllLineItemsAndChildParts(lineItems.promos, true);
|
||||||
|
}
|
||||||
return ((amountDue * 100) / 100).toFixed(2);
|
return ((amountDue * 100) / 100).toFixed(2);
|
||||||
},
|
},
|
||||||
scrollToPageTop() {
|
scrollToPageTop() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue