Merge pull request #941 from Safelite/defect/CSR-1083
CSR-1083 | Child part prices not included in service package quotes
This commit is contained in:
commit
9ba060b15b
1 changed files with 19 additions and 10 deletions
|
|
@ -64,17 +64,14 @@ export default {
|
|||
};
|
||||
},
|
||||
getTierOnePackagePrice(lineItems) {
|
||||
let totalPrice = 0;
|
||||
lineItems.forEach((lineItem) => {
|
||||
const partType = lineItem.partType.toUpperCase();
|
||||
if (
|
||||
partType != partTypeStrings.FRONT_WIPER &&
|
||||
partType != partTypeStrings.REAR_WIPER &&
|
||||
partType != partTypeStrings.RAIN_DEFENSE
|
||||
) {
|
||||
totalPrice += this.getTotalLineItemPrice(lineItem);
|
||||
}
|
||||
let lineItemsToPrice = lineItems.filter((lineItem) => {
|
||||
return (
|
||||
lineItem.partType != partTypeStrings.FRONT_WIPER &&
|
||||
lineItem.partType != partTypeStrings.REAR_WIPER &&
|
||||
lineItem.partType != partTypeStrings.RAIN_DEFENSE
|
||||
);
|
||||
});
|
||||
let totalPrice = this.getTotalPriceOfAllLineItemsAndChildParts(lineItemsToPrice);
|
||||
return totalPrice;
|
||||
},
|
||||
filterOutFees(lineItems) {
|
||||
|
|
@ -86,6 +83,18 @@ export default {
|
|||
});
|
||||
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) {
|
||||
return lineItem.kitPrice + lineItem.laborAmount + lineItem.sellingPrice;
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue