CSR-2179: refactor to protect against missing supportingItems
This commit is contained in:
parent
f6f048cdca
commit
76b85d2064
1 changed files with 8 additions and 4 deletions
|
|
@ -303,12 +303,11 @@ export default {
|
||||||
},
|
},
|
||||||
lineItemsWithoutRecal() {
|
lineItemsWithoutRecal() {
|
||||||
if (!this.lineItems || this.lineItems.length < 1) return;
|
if (!this.lineItems || this.lineItems.length < 1) return;
|
||||||
if (!this.lineItems.supportingItems) return this.lineItems;
|
|
||||||
|
|
||||||
const lineItemsCopy = deepClone(this.lineItems);
|
const lineItemsCopy = deepClone(this.lineItems);
|
||||||
lineItemsCopy.supportingItems = baseMixin.methods.filterOutRecalibration(
|
lineItemsCopy.supportingItems = lineItemsCopy.supportingItems ? baseMixin.methods.filterOutRecalibration(
|
||||||
lineItemsCopy.supportingItems
|
lineItemsCopy?.supportingItems
|
||||||
);
|
) : [];
|
||||||
return lineItemsCopy;
|
return lineItemsCopy;
|
||||||
},
|
},
|
||||||
showCoverageAsPending() {
|
showCoverageAsPending() {
|
||||||
|
|
@ -1000,6 +999,11 @@ export default {
|
||||||
},
|
},
|
||||||
subTotal() {
|
subTotal() {
|
||||||
if (!this.lineItems || this.lineItems.length < 1) return;
|
if (!this.lineItems || this.lineItems.length < 1) return;
|
||||||
|
if (this.isInsurance || !this.shouldHideRecalibration) {
|
||||||
|
console.log(" first this.lineItems: ", this.lineItems)
|
||||||
|
} else {
|
||||||
|
console.log(" 2nd this.lineItemsWithoutRecal: ", this.lineItemsWithoutRecal)
|
||||||
|
}
|
||||||
return this.isInsurance || !this.shouldHideRecalibration
|
return this.isInsurance || !this.shouldHideRecalibration
|
||||||
? baseMixin.methods.getSubTotal(this.lineItems) // calculate with recal (if on order)
|
? baseMixin.methods.getSubTotal(this.lineItems) // calculate with recal (if on order)
|
||||||
: baseMixin.methods.getSubTotal(this.lineItemsWithoutRecal); // calculated without recal
|
: baseMixin.methods.getSubTotal(this.lineItemsWithoutRecal); // calculated without recal
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue