mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-02 20:15:22 +02:00
42 lines
1.2 KiB
Text
42 lines
1.2 KiB
Text
|
<%# locals: (account:) %>
|
||
|
|
||
|
<div class="grid grid-cols-3 gap-2">
|
||
|
<%= summary_card title: t(".original_principal") do %>
|
||
|
<%= format_money account.original_balance %>
|
||
|
<% end %>
|
||
|
|
||
|
<%= summary_card title: t(".remaining_principal") do %>
|
||
|
<%= format_money account.balance %>
|
||
|
<% end %>
|
||
|
|
||
|
<%= summary_card title: t(".interest_rate") do %>
|
||
|
<% if account.loan.interest_rate.present? %>
|
||
|
<%= number_to_percentage(account.loan.interest_rate, precision: 2) %>
|
||
|
<% else %>
|
||
|
<%= t(".unknown") %>
|
||
|
<% end %>
|
||
|
<% end %>
|
||
|
|
||
|
<%= summary_card title: t(".monthly_payment") do %>
|
||
|
<% if account.loan.rate_type.present? && account.loan.rate_type != 'fixed' %>
|
||
|
<%= t(".not_applicable") %>
|
||
|
<% elsif account.loan.rate_type == 'fixed' && account.loan.monthly_payment.present? %>
|
||
|
<%= format_money(account.loan.monthly_payment) %>
|
||
|
<% else %>
|
||
|
<%= t(".unknown") %>
|
||
|
<% end %>
|
||
|
<% end %>
|
||
|
|
||
|
<%= summary_card title: t(".term") do %>
|
||
|
<% if account.loan.term_months.present? %>
|
||
|
<%= pluralize(account.loan.term_months / 12, "year") %>
|
||
|
<% else %>
|
||
|
<%= t(".unknown") %>
|
||
|
<% end %>
|
||
|
<% end %>
|
||
|
|
||
|
<%= summary_card title: t(".type") do %>
|
||
|
<%= account.loan.rate_type&.titleize || t(".unknown") %>
|
||
|
<% end %>
|
||
|
</div>
|