Prettified

This commit is contained in:
Leah Schumann 2023-10-30 15:48:32 -04:00
parent c73d2e2334
commit 5472b8b3f8

View file

@ -413,23 +413,24 @@ export default {
category: cartItemCategories.GLASS_PARTS, category: cartItemCategories.GLASS_PARTS,
cartItemType: cartItemTypes.GLASS_PARTS, cartItemType: cartItemTypes.GLASS_PARTS,
isDisplayed: false, isDisplayed: false,
subTotal: (lineItem.kitPrice ?? 0) + subTotal:
(lineItem.laborAmount ?? 0) + (lineItem.kitPrice ?? 0) +
(lineItem.sellingPrice ?? 0), (lineItem.laborAmount ?? 0) +
(lineItem.sellingPrice ?? 0),
salesTax: lineItem.salesTax ?? 0, salesTax: lineItem.salesTax ?? 0,
lineItems: [], lineItems: [],
}; };
if (lineItem.childParts?.length > 0) { if (lineItem.childParts?.length > 0) {
lineItem.childParts.forEach((childPartLineItem) => { lineItem.childParts.forEach((childPartLineItem) => {
cartItem.subTotal += (childPartLineItem.kitPrice ?? 0) + cartItem.subTotal +=
(childPartLineItem.laborAmount ?? 0) + (childPartLineItem.kitPrice ?? 0) +
(childPartLineItem.sellingPrice ?? 0); (childPartLineItem.laborAmount ?? 0) +
(childPartLineItem.sellingPrice ?? 0);
cartItem.salesTax += childPartLineItem.salesTax; cartItem.salesTax += childPartLineItem.salesTax;
}) });
} }
}); });
} }
@ -506,7 +507,11 @@ export default {
otherSupportingItemsCartItem() { otherSupportingItemsCartItem() {
let cartItem = null; let cartItem = null;
const otherSupportingItemsLineItems = this.supportingItems.filter(lineItem => lineItem.partNumber != partTypeStrings.MOBILE_FEE && lineItem.partNumber != partTypeStrings.RECYCLE_FEE); const otherSupportingItemsLineItems = this.supportingItems.filter(
(lineItem) =>
lineItem.partNumber != partTypeStrings.MOBILE_FEE &&
lineItem.partNumber != partTypeStrings.RECYCLE_FEE
);
if (otherSupportingItemsLineItems.length > 0) { if (otherSupportingItemsLineItems.length > 0) {
cartItem = { cartItem = {