From 785c9fd1bf1052dca3bc8764368bef2ff200cf65 Mon Sep 17 00:00:00 2001 From: Adam Caouette Date: Tue, 3 Sep 2024 15:59:02 -0400 Subject: [PATCH] CSR-2182: remove recal prices from cash carts --- src/fmg-components/cart/cart.vue | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index 495973144..c042b3ca8 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -184,6 +184,7 @@ export default { allowItemRemoval: Boolean, recyclingModalCmsWidgetName: String, showAsPaid: Boolean, + isInsurance: Boolean, insuranceDeductible: Number, insuranceCompanyName: String, showInsuranceCoverageAs: String, @@ -299,6 +300,12 @@ export default { this.$emit("update:modelValue", newValue); }, }, + lineItemsWithoutRecal() { + if (!this.lineItems || this.lineItems.length < 1) return; + const lineItemsCopy = this.lineItems; + lineItemsCopy.supportingItems = baseMixin.methods.filterOutRecalibration(this.lineItems.supportingItems); + return lineItemsCopy; + }, showCoverageAsPending() { return this.showInsuranceCoverageAs === coverageStatus.PENDING; }, @@ -983,16 +990,23 @@ export default { return this.getCmsContent("SubtotalTextWidget", "Text"); }, 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() { - 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() { - if (this.showAsPaid) { - return 0; - } - return baseMixin.methods.getAmountDue(this.lineItems); + if (!this.lineItems || this.lineItems.length < 1) return; + if (this.showAsPaid) return 0; + return this.isInsurance + ? baseMixin.methods.getAmountDue(this.lineItems) + : baseMixin.methods.getAmountDue(this.lineItemsWithoutRecal); }, amountPaid() { if (!this.showAsPaid) {