Merge pull request #1960 from Safelite/feature/CSR-2182-ajc
Feature/csr 2182 ajc
This commit is contained in:
commit
fede1fe980
3 changed files with 39 additions and 10 deletions
|
|
@ -140,7 +140,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
class="my-2 lh-1 applied-promo-tag"
|
class="my-2 lh-1 applied-promo-tag"
|
||||||
v-for="(promoCode, i) in this.getPromoCodeList()"
|
v-for="(promoCode, i) in getPromoCodeList"
|
||||||
:key="i">
|
:key="i">
|
||||||
<span class="caption"
|
<span class="caption"
|
||||||
>Promo code <span class="promo-code">{{ promoCode }}</span> applied
|
>Promo code <span class="promo-code">{{ promoCode }}</span> applied
|
||||||
|
|
@ -184,6 +184,7 @@ export default {
|
||||||
allowItemRemoval: Boolean,
|
allowItemRemoval: Boolean,
|
||||||
recyclingModalCmsWidgetName: String,
|
recyclingModalCmsWidgetName: String,
|
||||||
showAsPaid: Boolean,
|
showAsPaid: Boolean,
|
||||||
|
isInsurance: Boolean,
|
||||||
insuranceDeductible: Number,
|
insuranceDeductible: Number,
|
||||||
insuranceCompanyName: String,
|
insuranceCompanyName: String,
|
||||||
showInsuranceCoverageAs: String,
|
showInsuranceCoverageAs: String,
|
||||||
|
|
@ -283,6 +284,7 @@ export default {
|
||||||
(lineItemsToKeep) => lineItemsToKeep.cartItemType != cartItemType
|
(lineItemsToKeep) => lineItemsToKeep.cartItemType != cartItemType
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
getPromoCodeList() {
|
getPromoCodeList() {
|
||||||
if (this.$refs["promoModalQuestion"]) {
|
if (this.$refs["promoModalQuestion"]) {
|
||||||
return this.$refs["promoModalQuestion"].getPromoCodeList();
|
return this.$refs["promoModalQuestion"].getPromoCodeList();
|
||||||
|
|
@ -299,6 +301,14 @@ export default {
|
||||||
this.$emit("update:modelValue", newValue);
|
this.$emit("update:modelValue", newValue);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
lineItemsWithoutRecal() {
|
||||||
|
if (!this.lineItems || this.lineItems.length < 1) return;
|
||||||
|
const lineItemsCopy = deepClone(this.lineItems);
|
||||||
|
lineItemsCopy.supportingItems = baseMixin.methods.filterOutRecalibration(
|
||||||
|
lineItemsCopy.supportingItems
|
||||||
|
);
|
||||||
|
return lineItemsCopy;
|
||||||
|
},
|
||||||
showCoverageAsPending() {
|
showCoverageAsPending() {
|
||||||
return this.showInsuranceCoverageAs === coverageStatus.PENDING;
|
return this.showInsuranceCoverageAs === coverageStatus.PENDING;
|
||||||
},
|
},
|
||||||
|
|
@ -427,7 +437,14 @@ export default {
|
||||||
packagePrice() {
|
packagePrice() {
|
||||||
let packagePrice = 0;
|
let packagePrice = 0;
|
||||||
|
|
||||||
if (!this.showCoverageAsVerified && !this.showCoverageAsPending) {
|
if (!this.isInsurance) {
|
||||||
|
// CASH ONLY
|
||||||
|
packagePrice = baseMixin.methods.getTierOnePackagePrice(
|
||||||
|
baseMixin.methods.filterOutFees(
|
||||||
|
baseMixin.methods.filterOutRecalibration(this.availableLineItems)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
} else if (!this.showCoverageAsVerified && !this.showCoverageAsPending) {
|
||||||
packagePrice = baseMixin.methods.getTierOnePackagePrice(
|
packagePrice = baseMixin.methods.getTierOnePackagePrice(
|
||||||
baseMixin.methods.filterOutFees(this.availableLineItems)
|
baseMixin.methods.filterOutFees(this.availableLineItems)
|
||||||
);
|
);
|
||||||
|
|
@ -916,8 +933,6 @@ export default {
|
||||||
promoCartItems() {
|
promoCartItems() {
|
||||||
const promoCartItems = [];
|
const promoCartItems = [];
|
||||||
|
|
||||||
// clone the promos array
|
|
||||||
const promosClone = deepClone(this.promo);
|
|
||||||
// get unique promo codes
|
// get unique promo codes
|
||||||
const uniquePromoCodes = [
|
const uniquePromoCodes = [
|
||||||
...new Set(
|
...new Set(
|
||||||
|
|
@ -983,16 +998,23 @@ export default {
|
||||||
return this.getCmsContent("SubtotalTextWidget", "Text");
|
return this.getCmsContent("SubtotalTextWidget", "Text");
|
||||||
},
|
},
|
||||||
subTotal() {
|
subTotal() {
|
||||||
return baseMixin.methods.getSubTotal(this.lineItems);
|
if (!this.lineItems || this.lineItems.length < 1) return;
|
||||||
|
return this.isInsurance
|
||||||
|
? baseMixin.methods.getSubTotal(this.lineItems)
|
||||||
|
: baseMixin.methods.getSubTotal(this.lineItemsWithoutRecal);
|
||||||
},
|
},
|
||||||
salesTax() {
|
salesTax() {
|
||||||
return baseMixin.methods.getSalesTax(this.lineItems);
|
if (!this.lineItems || this.lineItems.length < 1) return;
|
||||||
|
return this.isInsurance
|
||||||
|
? baseMixin.methods.getSalesTax(this.lineItems)
|
||||||
|
: baseMixin.methods.getSalesTax(this.lineItemsWithoutRecal);
|
||||||
},
|
},
|
||||||
amountDue() {
|
amountDue() {
|
||||||
if (this.showAsPaid) {
|
if (!this.lineItems || this.lineItems.length < 1) return;
|
||||||
return 0;
|
if (this.showAsPaid) return 0;
|
||||||
}
|
return this.isInsurance
|
||||||
return baseMixin.methods.getAmountDue(this.lineItems);
|
? baseMixin.methods.getAmountDue(this.lineItems)
|
||||||
|
: baseMixin.methods.getAmountDue(this.lineItemsWithoutRecal);
|
||||||
},
|
},
|
||||||
amountPaid() {
|
amountPaid() {
|
||||||
if (!this.showAsPaid) {
|
if (!this.showAsPaid) {
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@
|
||||||
pageName="payment-method"
|
pageName="payment-method"
|
||||||
servicePackageOptionsCmsName="ServicePackageTitle"
|
servicePackageOptionsCmsName="ServicePackageTitle"
|
||||||
recyclingModalCmsWidgetName="RecycleModal"
|
recyclingModalCmsWidgetName="RecycleModal"
|
||||||
|
:isInsurance="isInsurance"
|
||||||
:insuranceDeductible="currentDeductible"
|
:insuranceDeductible="currentDeductible"
|
||||||
:insuranceCompanyName="insuranceCompanyName"
|
:insuranceCompanyName="insuranceCompanyName"
|
||||||
:showInsuranceCoverageAs="showInsuranceCoverageAs" />
|
:showInsuranceCoverageAs="showInsuranceCoverageAs" />
|
||||||
|
|
|
||||||
|
|
@ -102,6 +102,12 @@ export default {
|
||||||
});
|
});
|
||||||
return filteredLineItems;
|
return filteredLineItems;
|
||||||
},
|
},
|
||||||
|
filterOutRecalibration(lineItems) {
|
||||||
|
const filteredLineItems = lineItems.filter((item) => {
|
||||||
|
return item.partType != partTypeStrings.RECALIBRATION;
|
||||||
|
});
|
||||||
|
return filteredLineItems;
|
||||||
|
},
|
||||||
getTotalPriceOfAllLineItemsAndChildParts(lineItems, includeTax) {
|
getTotalPriceOfAllLineItemsAndChildParts(lineItems, includeTax) {
|
||||||
let totalPrice = 0;
|
let totalPrice = 0;
|
||||||
lineItems.forEach((lineItem) => {
|
lineItems.forEach((lineItem) => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue