Skip to content

Commit

Permalink
take aptc into account when sorting by premium (#4285)
Browse files Browse the repository at this point in the history
* take aptc into account when sorting by premium

* use the new premium for sorting

* don't duplicate logic
  • Loading branch information
kristinmerbach authored and bbodine1 committed Aug 15, 2024
1 parent d0e33ce commit 5431db7
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions app/views/insured/plan_shoppings/_plan_details.html.erb
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
<% plan_carrier = Caches::MongoidCache.lookup(BenefitSponsors::Organizations::Organization.issuer_profiles, plan.issuer_profile_id) { plan.issuer_profile } %>
<% details_page = (defined? details_page) ? details_page : false %>
<% if @bs4 %>
<% if session[:elected_aptc] && session[:elected_aptc] != 0 %>
<% premium = shopping_group_premium(plan.total_employee_cost, plan.total_ehb_premium, plan.total_childcare_subsidy_amount, plan.can_use_aptc?) %>
<% else %>
<% premium = plan.total_employee_cost - plan.total_childcare_subsidy_amount %>
<% end %>

<div class="plan-card plan-row border my-2 rounded-lg"
data-plan-id="<%= plan.id %>"
data-plan-category="<%= plan.product_type ? plan.product_type.downcase : '' %>"
data-plan-metal-level="<%= plan.metal_level.downcase %>"
data-plan-metal-network="<%= plan.network&.downcase %>"
data-plan-metal-premium="<%= plan.total_employee_cost %>"
data-plan-metal-premium="<%= premium %>"
data-plan-metal-ehb-premium="<%= plan.total_ehb_premium %>"
data-plan-childcare-subsidy-eligible="<%= plan_childcare_subsidy_eligible(plan) %>"
data-plan-metal-deductible="<%= plan.deductible == 'Not Applicable' ? '$0' : plan.deductible %>"
Expand Down Expand Up @@ -87,12 +93,7 @@
<div class="col-md-2">
<div class="price-wrapper text-right">
<strong class="text-secondary"><%= l10n("premium") %></strong>
<% if session[:elected_aptc] && session[:elected_aptc] != 0 %>
<% premium = shopping_group_premium(plan.total_employee_cost, plan.total_ehb_premium, plan.total_childcare_subsidy_amount, plan.can_use_aptc?) %>
<p class="bold beta m-0"><%= number_to_currency(premium) %></p>
<% else %>
<p class="bold beta m-0"><%= number_to_currency(plan.total_employee_cost - plan.total_childcare_subsidy_amount) %></p>
<% end %>
<p class="bold beta m-0"><%= number_to_currency(premium) %></p>
<small class="weight-n">per <%= l10n("month") %></small>
</div>
</div>
Expand Down

0 comments on commit 5431db7

Please sign in to comment.