Merging from develop

This commit is contained in:
Leah Schumann 2024-05-24 06:58:03 -04:00
commit a3f82617e9
3 changed files with 58 additions and 72 deletions

View file

@ -915,48 +915,16 @@ export default {
return this.getCmsContent("SubtotalTextWidget", "Text"); return this.getCmsContent("SubtotalTextWidget", "Text");
}, },
subTotal() { subTotal() {
let subTotal = 0; return baseMixin.methods.getSubTotal(this.lineItems);
if (this.showCoverageAsVerified || this.showCoverageAsPending) {
// only include items NOT covered by insurance
this.cartItems.forEach((cartItem) => {
if (!cartItem.isCoveredByInsurance) {
subTotal += cartItem.subTotal ?? 0;
}
});
// add deductible amount still to pay
subTotal += this.deductibleLineItem.subTotal ?? 0;
} else {
this.cartItems.forEach((cartItem) => {
subTotal += cartItem.subTotal ?? 0;
});
}
return subTotal;
}, },
salesTax() { salesTax() {
let salesTax = 0; return baseMixin.methods.getSalesTax(this.lineItems);
if (this.showCoverageAsVerified || this.showCoverageAsPending) {
// only include items NOT covered by insurance
this.cartItems.forEach((cartItem) => {
if (!cartItem.isCoveredByInsurance) {
salesTax += cartItem.salesTax ?? 0;
}
});
} else {
this.cartItems.forEach((cartItem) => {
salesTax += cartItem.salesTax ?? 0;
});
}
return salesTax;
}, },
amountDue() { amountDue() {
if (this.showAsPaid) { if (this.showAsPaid) {
return 0; return 0;
} }
return this.subTotal + this.salesTax; return baseMixin.methods.getAmountDue(this.lineItems);
}, },
amountPaid() { amountPaid() {
if (!this.showAsPaid) { if (!this.showAsPaid) {

View file

@ -132,27 +132,32 @@ export default {
currency: "USD", currency: "USD",
}); });
}, },
getAmountDue(lineItems) { getAmountDue(lineItems, includeTax = true) {
var amountDue = 0; var amountDue = 0;
if (lineItems.glassParts) { if (lineItems.glassParts) {
amountDue += this.getTotalPriceOfAllLineItemsAndChildParts( amountDue += this.getTotalPriceOfAllLineItemsAndChildParts(
lineItems.glassParts, lineItems.glassParts,
true includeTax
); );
} }
if (lineItems.supportingItems) { if (lineItems.supportingItems) {
amountDue += this.getTotalPriceOfAllLineItemsAndChildParts( amountDue += this.getTotalPriceOfAllLineItemsAndChildParts(
lineItems.supportingItems, lineItems.supportingItems,
true includeTax
); );
} }
if (lineItems.vaps) { if (lineItems.vaps) {
amountDue += this.getTotalPriceOfAllLineItemsAndChildParts(lineItems.vaps, true); amountDue += this.getTotalPriceOfAllLineItemsAndChildParts(
lineItems.vaps,
includeTax
);
} }
if (lineItems.promos) { if (lineItems.promos) {
amountDue += this.getTotalPriceOfAllLineItemsAndChildParts(lineItems.promos, true); amountDue += this.getTotalPriceOfAllLineItemsAndChildParts(
lineItems.promos,
includeTax
);
} }
if ( if (
store.getters.payment.insuranceCoverage.isVerified && store.getters.payment.insuranceCoverage.isVerified &&
!store.getters.policy.isNoComp && !store.getters.policy.isNoComp &&
@ -163,6 +168,17 @@ export default {
return ((amountDue * 100) / 100).toFixed(2); return ((amountDue * 100) / 100).toFixed(2);
}, },
getSubTotal(lineItems) {
// this is amountDue without sales tax
return this.getAmountDue(lineItems, false);
},
getSalesTax(lineItems) {
// this is amountDue minus subTotal
return (
((this.getAmountDue(lineItems) - this.getSubTotal(lineItems)) * 100) /
100
).toFixed(2);
},
scrollToPageTop() { scrollToPageTop() {
const container = document.getElementsByClassName("page-container-grouped-styles")[0]; const container = document.getElementsByClassName("page-container-grouped-styles")[0];
container.scrollTo({ top: 0, left: 0, behavior: "smooth" }); container.scrollTo({ top: 0, left: 0, behavior: "smooth" });

View file

@ -26,44 +26,46 @@ export default {
<style lang="scss"> <style lang="scss">
.form-check { .form-check {
position: relative; &.ui-radio {
position: relative;
.form-check-input { .form-check-input {
border: 1px solid $gray-500; border: 1px solid $gray-500;
border-radius: 50%; border-radius: 50%;
margin-right: 0.5rem; margin-right: 0.5rem;
opacity: 1; opacity: 1;
height: 1em; height: 1em;
width: 1em; width: 1em;
&:checked { &:checked {
background-color: $white; background-color: $white;
background-size: 71%; background-size: 71%;
background-position: center; background-position: center;
border: 1px solid $blue; border: 1px solid $blue;
background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50' xml:space='preserve'%3e%3ccircle cx='25' cy='25' r='25' fill='%231574A1'/%3e%3c/svg%3e"); background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50' xml:space='preserve'%3e%3ccircle cx='25' cy='25' r='25' fill='%231574A1'/%3e%3c/svg%3e");
+ .form-check-label { + .form-check-label {
p { p {
font-weight: 500; font-weight: 500;
font-size: 0.875rem; font-size: 0.875rem;
color: $black; color: $black;
}
} }
} }
&:focus {
box-shadow: 0 0 0 2.5px $blue;
}
} }
&:focus {
box-shadow: 0 0 0 2.5px $blue;
}
}
&:hover { &:hover {
.form-check-input:not(:checked) { .form-check-input:not(:checked) {
box-shadow: 0 0 0 4px $blue-300; box-shadow: 0 0 0 4px $blue-300;
}
}
p {
font-weight: 400;
font-size: 0.875rem;
color: $gray-600;
} }
}
p {
font-weight: 400;
font-size: 0.875rem;
color: $gray-600;
} }
} }
</style> </style>