From 92e0e6e60d63bdce3aa49f399e92993454fa31d8 Mon Sep 17 00:00:00 2001 From: CarlNation Date: Mon, 30 Sep 2024 06:22:52 -0400 Subject: [PATCH] CSR-2237 CSR-2237 move vaps and promos below deductible pricing to make sure it is added into the amount due and also avoid code duplication --- src/mixins/base-mixin.js | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/src/mixins/base-mixin.js b/src/mixins/base-mixin.js index fdf1261e0..e30663fea 100644 --- a/src/mixins/base-mixin.js +++ b/src/mixins/base-mixin.js @@ -145,24 +145,13 @@ export default { includeTax ); } + if (lineItems.supportingItems) { amountDue += this.getTotalPriceOfAllLineItemsAndChildParts( lineItems.supportingItems, includeTax ); } - if (lineItems.vaps) { - amountDue += this.getTotalPriceOfAllLineItemsAndChildParts( - lineItems.vaps, - includeTax - ); - } - if (lineItems.promos) { - amountDue += this.getTotalPriceOfAllLineItemsAndChildParts( - lineItems.promos, - includeTax - ); - } const order = this.hasSubmittedOrder() ? this.getSubmittedOrder() : store.getters.order; if ( @@ -171,12 +160,20 @@ export default { !order.policy.isItac ) { amountDue = order.policy.currentDeductible; - if (lineItems.vaps) { - amountDue += this.getTotalPriceOfAllLineItemsAndChildParts( - lineItems.vaps, - includeTax - ); - } + } + + if (lineItems.vaps) { + amountDue += this.getTotalPriceOfAllLineItemsAndChildParts( + lineItems.vaps, + includeTax + ); + } + + if (lineItems.promos) { + amountDue += this.getTotalPriceOfAllLineItemsAndChildParts( + lineItems.promos, + includeTax + ); } return ((amountDue * 100) / 100).toFixed(2);