CSR-1083 | Child part prices not included in service package quotes
This commit is contained in:
parent
b8696a37d9
commit
c3b113d301
1 changed files with 15 additions and 10 deletions
|
|
@ -64,17 +64,12 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
getTierOnePackagePrice(lineItems) {
|
getTierOnePackagePrice(lineItems) {
|
||||||
let totalPrice = 0;
|
let lineItemsToPrice = lineItems.filter(lineItem => {
|
||||||
lineItems.forEach((lineItem) => {
|
return lineItem.partType != partTypeStrings.FRONT_WIPER &&
|
||||||
const partType = lineItem.partType.toUpperCase();
|
lineItem.partType != partTypeStrings.REAR_WIPER &&
|
||||||
if (
|
lineItem.partType != partTypeStrings.RAIN_DEFENSE
|
||||||
partType != partTypeStrings.FRONT_WIPER &&
|
|
||||||
partType != partTypeStrings.REAR_WIPER &&
|
|
||||||
partType != partTypeStrings.RAIN_DEFENSE
|
|
||||||
) {
|
|
||||||
totalPrice += this.getTotalLineItemPrice(lineItem);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
let totalPrice = this.getTotalPriceOfAllLineItemsAndChildParts(lineItemsToPrice);
|
||||||
return totalPrice;
|
return totalPrice;
|
||||||
},
|
},
|
||||||
filterOutFees(lineItems) {
|
filterOutFees(lineItems) {
|
||||||
|
|
@ -86,6 +81,16 @@ export default {
|
||||||
});
|
});
|
||||||
return filteredLineItems;
|
return filteredLineItems;
|
||||||
},
|
},
|
||||||
|
getTotalPriceOfAllLineItemsAndChildParts(lineItems) {
|
||||||
|
let totalPrice = 0;
|
||||||
|
lineItems.forEach((lineItem) => {
|
||||||
|
totalPrice += this.getTotalLineItemPrice(lineItem);
|
||||||
|
if (lineItem.childParts) {
|
||||||
|
totalPrice += this.getTotalPriceOfAllLineItemsAndChildParts(lineItem.childParts);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return totalPrice;
|
||||||
|
},
|
||||||
getTotalLineItemPrice(lineItem) {
|
getTotalLineItemPrice(lineItem) {
|
||||||
return lineItem.kitPrice + lineItem.laborAmount + lineItem.sellingPrice;
|
return lineItem.kitPrice + lineItem.laborAmount + lineItem.sellingPrice;
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue