do not pass null items to getTotalPrice logic
This commit is contained in:
CarlNation 2023-10-11 10:02:54 -04:00
parent ca77f1742b
commit e6fc6635c4
2 changed files with 7 additions and 5 deletions

View file

@ -7,7 +7,7 @@
@click="toggleClass()">
<div class="col d-flex justify-content-between">
<span class="label">Amount Due</span
><span class="label amount-due">${{ amountDue }}</span>
><span class="label amount-due">{{ amountDue }}</span>
</div>
</div>
<div class="price-table">
@ -123,7 +123,7 @@ export default {
return price;
},
getAmountDue() {
return baseMixin.methods.getAmountDue(this.storeLineItems);
return baseMixin.methods.getDisplayAmountDue(this.storeLineItems);
},
removeItem(item) {
this.$emit("cart-remove", item);

View file

@ -128,9 +128,11 @@ export default {
const itemsClone = { ...lineItems };
delete itemsClone.serverData;
for (var propertyName in itemsClone) {
amountDue += this.getTotalPriceOfAllLineItemsAndChildParts(
itemsClone[propertyName]
);
if (itemsClone[propertyName]){
amountDue += this.getTotalPriceOfAllLineItemsAndChildParts(
itemsClone[propertyName]
);
}
}
return amountDue;
},