CSR-2186 hide mobile line item when 0

CSR-2186 hide mobile line item when 0
This commit is contained in:
CarlNation 2024-08-23 13:30:46 -04:00
parent 95c6e0c0aa
commit 914edd39a9

View file

@ -769,7 +769,12 @@ export default {
(lineItem) => lineItem.partType == partTypeStrings.MOBILE_FEE (lineItem) => lineItem.partType == partTypeStrings.MOBILE_FEE
); );
if (mobileFeeLineItem) { var mobileTotal =
(mobileFeeLineItem?.kitPrice ?? 0) +
(mobileFeeLineItem?.laborAmount ?? 0) +
(mobileFeeLineItem?.sellingPrice ?? 0);
if (mobileFeeLineItem && mobileTotal > 0) {
cartItem = { cartItem = {
name: this.mobileFeeCartItemName, name: this.mobileFeeCartItemName,
category: cartItemCategories.SUPPORTING_ITEMS, category: cartItemCategories.SUPPORTING_ITEMS,
@ -785,10 +790,7 @@ export default {
}; };
mobileFeeLineItem.cartItemType = cartItem.cartItemType; mobileFeeLineItem.cartItemType = cartItem.cartItemType;
cartItem.lineItems.push(mobileFeeLineItem); cartItem.lineItems.push(mobileFeeLineItem);
cartItem.subTotal += cartItem.subTotal += mobileTotal;
(mobileFeeLineItem.kitPrice ?? 0) +
(mobileFeeLineItem.laborAmount ?? 0) +
(mobileFeeLineItem.sellingPrice ?? 0);
cartItem.salesTax += mobileFeeLineItem.salesTax ?? 0; cartItem.salesTax += mobileFeeLineItem.salesTax ?? 0;
} }
return cartItem; return cartItem;