CSR-2182: remove recal prices from cash carts

This commit is contained in:
Adam Caouette 2024-09-03 15:59:02 -04:00
parent 01d0c809fa
commit 785c9fd1bf

View file

@ -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,
@ -299,6 +300,12 @@ export default {
this.$emit("update:modelValue", newValue); 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() { showCoverageAsPending() {
return this.showInsuranceCoverageAs === coverageStatus.PENDING; return this.showInsuranceCoverageAs === coverageStatus.PENDING;
}, },
@ -983,16 +990,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) {