Skip to content

Commit

Permalink
aptc calculator adjust amount applied (#4286)
Browse files Browse the repository at this point in the history
adjust the max amount of aptc to account for if the aptc is higher than the premium
  • Loading branch information
kristinmerbach authored and bbodine1 committed Aug 29, 2024
1 parent 87744cc commit c7985fe
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app/views/insured/plan_shoppings/thankyou.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
<dt><%= l10n('insured.plan_shoppings.thankyou.total_credit') %>:</dt>
<dd><%= number_to_currency(@max_aptc, precision: 2) %></dd>
<dt><%= l10n('insured.plan_shoppings.thankyou.max_credit') %>:</dt>
<% per_plan_max = @plan.total_premium > @max_aptc ? @max_aptc : @plan.total_aptc_amount %>
<dd><%= number_to_currency(per_plan_max) %></dd>
<% max_credit = @plan.total_premium > @max_aptc ? @max_aptc : @plan.total_aptc_amount %>
<dd><%= number_to_currency(max_credit) %></dd>
</dl>
<p><%= l10n("insured.plan_shoppings.thankyou.aptc_instructions") %></p>
<%= hidden_field_tag :max_aptc, @max_aptc %>
<%= hidden_field_tag :max_aptc, max_credit %>
<%= hidden_field_tag :plan, @plan.id %>
<%= hidden_field_tag :enrollment, @enrollment.id %>
<%= hidden_field_tag :market_kind, @market_kind %>
Expand All @@ -46,20 +46,20 @@
<div class="mr-3">
<% min_aptc = is_ivl_osse_filter_eligible ? minimum_applied_aptc_pct_for_osse : 0 %>
<% step = is_ivl_osse_filter_eligible ? 1 : 1 %>
<% pct = @max_aptc > 0 ? (@elected_aptc/@max_aptc).round(2) : 0 %>
<% pct = max_credit > 0 ? (@elected_aptc/max_credit).round(2) : 0 %>
<label for="elected_aptc_pct" class="required"><%= l10n('insured.plan_shoppings.thankyou.percent_applied') %></label>
<input max="100" min="<%= min_aptc %>" name="elected_aptc_pct" id="elected_aptc_pct" step="<%= step %>" type="number" value="<%= number_with_precision(pct * 100, precision: 0) %>" class="w-100 thankyou">
</div>
<div class="mr-3">
<label for="elected_aptc_value" class="required"><%= l10n('insured.plan_shoppings.thankyou.amount_applied') %></label>
<input id="elected_aptc_value" max="<%= per_plan_max %>" type="number" value="<%= number_with_precision(@elected_aptc, precision: 2) %>" data-elected="<%= number_with_precision(@elected_aptc, precision: 2) %>" class="thankyou">
<input id="elected_aptc_value" max="<%= max_credit %>" type="number" value="<%= number_with_precision(@elected_aptc, precision: 2) %>" data-elected="<%= number_with_precision(@elected_aptc, precision: 2) %>" class="thankyou">
</div>
<div class="">
<button id="aptc_submit" class="short"><%= l10n('insured.plan_shoppings.thankyou.update_applied') %></button>
</div>
</div>
</div>
<p class="mt-4 bold"><span class="aptc-percentage"><%= pct * 100 %></span><%= l10n('insured.plan_shoppings.thankyou.aptc_numbers_1') %><span class="aptc-amount"><%= number_with_precision(@elected_aptc, precision: 2) %></span><%= l10n('insured.plan_shoppings.thankyou.aptc_numbers_2') %> <%= h(link_to l10n("how_is_this_calculated") + "?", "", data: {toggle: "modal", target: "#how_is_this_calculated"}) %></p>
<p class="mt-4 bold"><span class="aptc-percentage"><%= pct * 100 %></span><%= l10n('insured.plan_shoppings.thankyou.aptc_numbers_1') %><span class="aptc-amount"><%= number_with_precision(max_credit, precision: 2) %></span><%= l10n('insured.plan_shoppings.thankyou.aptc_numbers_2') %> <%= h(link_to l10n("how_is_this_calculated") + "?", "", data: {toggle: "modal", target: "#how_is_this_calculated"}) %></p>
<button class="outline" id="updateAptc"><%= l10n('insured.plan_shoppings.thankyou.update_amount') %></button>
</div>
<% end %>
Expand Down

0 comments on commit c7985fe

Please sign in to comment.