Merge pull request #2372 from Safelite/release/CASH-414-for-CASH-152

CASH-414 for CASH-152: Fix to ensure upcharge is excluded from base price
This commit is contained in:
CarlNation 2025-03-21 08:36:29 -04:00 committed by GitHub
commit d365390938
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 3 deletions

View file

@ -5,6 +5,7 @@ const partNumberStrings = {
DONATION: "DONATION",
// Fees
RECYCLE_FEE: "RECYCLE FEE",
PRICING_BY_DAY_UPCHARGE: "PREMAPPT GEN",
};
export { partNumberStrings };

View file

@ -250,9 +250,15 @@ export default {
isRecalibrationOnOrder && shouldHideRecalibration
? getItemsWithoutRecalParts(lineItems.glassParts)
: (lineItems.glassParts ?? []);
const supportingItemsFromStore = lineItems?.supportingItems;
const supportingItemsWithoutFees = baseMixin.methods.filterOutCertainPartTypesOrNumbers(
lineItems.supportingItems,
{ partNumbersToRemove: [partNumberStrings.RECYCLE_FEE] }
{
partNumbersToRemove: [
partNumberStrings.RECYCLE_FEE,
partNumberStrings.PRICING_BY_DAY_UPCHARGE,
],
}
);
const lineItemsToBePriced = {
glassParts: glassParts,
@ -266,8 +272,8 @@ export default {
// Check to see if includePricingByDayUpcharge should already be set (based on order lineItems)
let includePricingByDayUpcharge = false;
if (supportingItemsWithoutFees) {
const pricingByDayUpchargeFeeIndex = supportingItemsWithoutFees.findIndex(
if (supportingItemsFromStore) {
const pricingByDayUpchargeFeeIndex = supportingItemsFromStore?.findIndex(
(item) => item.partType == PRICING_BY_DAY_PART_TYPE
);
if (pricingByDayUpchargeFeeIndex > -1) {