CASH-152: get lowest selected package price on Schedule
This commit is contained in:
parent
51f0225e19
commit
2bd4d42f57
1 changed files with 34 additions and 1 deletions
|
|
@ -110,6 +110,10 @@ import { required } from "@/helpers/validation-rules";
|
|||
import store from "@/store";
|
||||
import experimentMixin from "@/mixins/experiment-mixin.js";
|
||||
import { experimentSettings } from "@/constants/experiments";
|
||||
import { getDisplayAmountDue } from "@/helpers/pricing-helper.js";
|
||||
import { getItemsWithoutRecalParts } from "@/helpers/recal-helper";
|
||||
import { partNumberStrings } from "@/constants/part-number-strings";
|
||||
import { deepClone } from "@/helpers/object-helper";
|
||||
|
||||
// DEFINE VALIDATION RULES
|
||||
defineRule("date-required", required(errorMessages.DATE_REQUIRED));
|
||||
|
|
@ -333,7 +337,36 @@ export default {
|
|||
);
|
||||
},
|
||||
showPricingByDay() {
|
||||
return !this.$store.getters.payment.isInsurance;
|
||||
return !this.$store.getters.payment.isInsurance && this.isPricingByDayExperiment;
|
||||
},
|
||||
lineItemsToBePriced() {
|
||||
const lineItems = deepClone(store.getters.order.lineItems);
|
||||
|
||||
const glassParts = (this.isRecalibrationOnOrder && this.shouldHideRecalibration) ?
|
||||
getItemsWithoutRecalParts(lineItems.glassParts) :
|
||||
lineItems.glassParts ?? [];
|
||||
|
||||
const supportingItemsWithoutFees = baseMixin.methods.filterOutCertainPartTypesOrNumbers(lineItems.supportingItems, {partNumbersToRemove: [partNumberStrings.RECYCLE_FEE]});
|
||||
|
||||
return {
|
||||
glassParts: glassParts,
|
||||
supportingItems: supportingItemsWithoutFees,
|
||||
vaps: lineItems.vaps ?? [],
|
||||
promos: lineItems.promos ?? [],
|
||||
};
|
||||
},
|
||||
lowestPrice() {
|
||||
return getDisplayAmountDue(this.lineItemsToBePriced, false); // passing false here so IncludeTax is false
|
||||
},
|
||||
isRecalibrationOnOrder() {
|
||||
return store.getters.isRecalibrationOnOrder;
|
||||
},
|
||||
shouldHideRecalibration() {
|
||||
return (
|
||||
experimentMixin.methods
|
||||
.getSettingValue(experimentSettings.RECAL_PRICE_REMOVE)
|
||||
?.toLowerCase() === "true" && this.isRecalibrationOnOrder
|
||||
);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
|
|
|||
Loading…
Reference in a new issue