Final reverts
This commit is contained in:
parent
24966fdf64
commit
2842011af6
2 changed files with 3 additions and 7 deletions
|
|
@ -26,7 +26,6 @@ export default {
|
|||
if (singlePart) {
|
||||
reducedGlassParts.push({
|
||||
partNumber: singlePart.partNumber,
|
||||
safelitePartNumber: singlePart.safelitePartNumber,
|
||||
description: singlePart.description,
|
||||
color: singlePart.color,
|
||||
partType: singlePart.partType,
|
||||
|
|
|
|||
|
|
@ -1079,7 +1079,6 @@ export const useMainStore = defineStore({
|
|||
return availableLineItems;
|
||||
},
|
||||
|
||||
// NOTE: The endpoint requires that safelite part numbers be used!!
|
||||
async getITACPriceOrderItems(availableLineItems) {
|
||||
const { policy, vehicle, contactInfo, serviceLocation, insuranceCoverage } = this.order;
|
||||
const response = await globalMethods
|
||||
|
|
@ -2768,24 +2767,22 @@ function convertGlassPieceNamingFromApi(glassArray) {
|
|||
return glassArray;
|
||||
}
|
||||
|
||||
// Note this is used for both the insurance and the itac endpoints, so it needs to deal with safelite or nags part numbers
|
||||
function addPricesToLineItems(lineItems, pricingLineItems) {
|
||||
const partOffset = {};
|
||||
const partNumberPropertyToCompare = 'partNumber';
|
||||
|
||||
lineItems.forEach((lineItem) => {
|
||||
if (lineItem.childParts) {
|
||||
addPricesToLineItems(lineItem.childParts, pricingLineItems);
|
||||
}
|
||||
const partNumberToCompare = lineItem[partNumberPropertyToCompare];
|
||||
const { partNumber } = lineItem;
|
||||
|
||||
const pricedIndex = findLineItemIndex(pricingLineItems, partNumberToCompare, partOffset[partNumberToCompare] ?? 0);
|
||||
const pricedIndex = findLineItemIndex(pricingLineItems, partNumber, partOffset[partNumber] ?? 0);
|
||||
if (pricedIndex !== -1) {
|
||||
const pricedLineItem = pricingLineItems[pricedIndex];
|
||||
lineItem.laborAmount = pricedLineItem.laborAmount;
|
||||
lineItem.sellingPrice = pricedLineItem.sellingPrice;
|
||||
lineItem.kitPrice = pricedLineItem.kitPrice;
|
||||
partOffset[partNumberToCompare] = pricedIndex + 1;
|
||||
partOffset[partNumber] = pricedIndex + 1;
|
||||
}
|
||||
});
|
||||
return lineItems;
|
||||
|
|
|
|||
Loading…
Reference in a new issue