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",
|
||||
PROMOS: "PROMOS",
|
||||
EARLY_BIRD: "EARLY BIRD",
|
||||
SUPPLIES_REPAIR: "SUPPLIES-REPAIR",
|
||||
};
|
||||
|
||||
export { cartItemTypes };
|
||||
|
|
|
|||
|
|
@ -227,6 +227,10 @@ export default {
|
|||
cartItems.push(this.recycleFeeCartItem);
|
||||
}
|
||||
|
||||
if (this.suppliesRepairCartItem) {
|
||||
cartItems.push(this.suppliesRepairCartItem);
|
||||
}
|
||||
|
||||
if (this.mobileFeeCartItem) {
|
||||
cartItems.push(this.mobileFeeCartItem);
|
||||
}
|
||||
|
|
@ -508,6 +512,45 @@ export default {
|
|||
|
||||
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() {
|
||||
return this.getCmsContent("MobileServiceTextWidget", "Text");
|
||||
},
|
||||
|
|
|
|||
|
|
@ -323,6 +323,9 @@ export default {
|
|||
);
|
||||
|
||||
const newValidatedPromos = validatePromoResponse?.orderPromos ?? [];
|
||||
newValidatedPromos.push(
|
||||
...(revalidatePromoResponse ? revalidatePromoResponse.promoLineItems : [])
|
||||
);
|
||||
|
||||
pricedLineItemsToTax.push(...newValidatedPromos);
|
||||
// End of promo logic
|
||||
|
|
|
|||
|
|
@ -149,6 +149,9 @@ export default {
|
|||
if (lineItems.vaps) {
|
||||
amountDue += this.getTotalPriceOfAllLineItemsAndChildParts(lineItems.vaps, true);
|
||||
}
|
||||
if (lineItems.promos) {
|
||||
amountDue += this.getTotalPriceOfAllLineItemsAndChildParts(lineItems.promos, true);
|
||||
}
|
||||
return ((amountDue * 100) / 100).toFixed(2);
|
||||
},
|
||||
scrollToPageTop() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue