CSR-1742: refactoring logic out of markup, part 2

This commit is contained in:
Adam Caouette 2024-05-03 10:15:09 -04:00
parent f943a3648d
commit 7d67941493

View file

@ -11,7 +11,7 @@
class="col d-flex justify-content-between py-0">
<span class="label">{{ amountDueText }}</span>
<span class="label amount-due">{{
getLineItemAmount("", amountDue, showCoverageAsPending)
getLineItemAmount(amountDue, showCoverageAsPending)
}}</span>
</a>
</div>
@ -23,7 +23,6 @@
<span>
{{
getLineItemAmount(
"",
deductibleLineItem.subTotal,
showCoverageAsPending
)
@ -35,12 +34,12 @@
<div class="service-type">
<textBlock :cmsWidgetName="servicePackageTitleWidget" />
<span>
{{ getLineItemAmount("", packagePrice) }}
{{ getLineItemAmount(packagePrice) }}
</span>
<span
v-if="packagePriceWithoutDiscount > packagePrice"
class="struck-out-price">
{{ getLineItemAmount("", packagePriceWithoutDiscount) }}
{{ getLineItemAmount(packagePriceWithoutDiscount) }}
</span>
</div>
@ -100,26 +99,28 @@
!showCoverageAsVerified ||
(showCoverageAsVerified && !cartItem.isCoveredByInsurance)
"
>{{ getLineItemAmount(cartItem.category, cartItem.subTotal) }}</span
>{{
getLineItemAmount(cartItem.subTotal, null, cartItem.category)
}}</span
>
</div>
<!-- Sub total, sales tax, total columns -->
<div class="sub-total">
<span>{{ subtotalText }}</span>
<span>{{ getLineItemAmount("", subTotal, showCoverageAsPending) }}</span>
<span>{{ getLineItemAmount(subTotal, showCoverageAsPending) }}</span>
</div>
<div class="sales-tax">
<span>{{ salesTaxText }}</span>
<span>{{ getLineItemAmount("", salesTax) }}</span>
<span>{{ getLineItemAmount(salesTax) }}</span>
</div>
<div v-if="showAsPaid" class="amount-paid">
<span>{{ amountPaidText }}</span>
<span>{{ getLineItemAmount("", amountPaid) }}</span>
<span>{{ getLineItemAmount(amountPaid) }}</span>
</div>
<div class="amount-due">
<span>{{ amountDueText }}</span>
<span>{{ getLineItemAmount("", amountDue, showCoverageAsPending) }}</span>
<span>{{ getLineItemAmount(amountDue, showCoverageAsPending) }}</span>
</div>
</div>
<div
@ -262,7 +263,7 @@ export default {
return vapsTypeName.Text;
},
getLineItemAmount(category, amount, useVerifyingText) {
getLineItemAmount(amount, useVerifyingText, category) {
if (useVerifyingText) return this.verifyingCoverageText;
return category == "promos"
? "(" + this.currencyFormatter.format(amount * -1) + ")"