CSR-2237 move vaps and promos below deductible pricing to make sure it is added into the amount due and also avoid code duplication
This commit is contained in:
CarlNation 2024-09-30 06:22:52 -04:00
parent 2b69271d4d
commit 92e0e6e60d

View file

@ -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);