2024-10-08 17:16:37 -04:00
|
|
|
<%# locals: (account:) %>
|
|
|
|
|
|
|
|
<div class="grid grid-cols-3 gap-2">
|
|
|
|
<%= summary_card title: t(".original_principal") do %>
|
2025-04-14 09:09:25 -04:00
|
|
|
<%= format_money account.loan.original_balance %>
|
2024-10-08 17:16:37 -04:00
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<%= summary_card title: t(".remaining_principal") do %>
|
2024-10-09 17:20:38 -04:00
|
|
|
<%= format_money account.balance_money %>
|
2024-10-08 17:16:37 -04:00
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<%= summary_card title: t(".interest_rate") do %>
|
|
|
|
<% if account.loan.interest_rate.present? %>
|
2025-05-16 10:24:32 -05:00
|
|
|
<%= number_to_percentage(account.loan.interest_rate, precision: 3) %>
|
2024-10-08 17:16:37 -04:00
|
|
|
<% 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? %>
|
2024-10-09 18:34:20 -04:00
|
|
|
<% if account.loan.term_months < 12 %>
|
|
|
|
<%= pluralize(account.loan.term_months, "month") %>
|
|
|
|
<% else %>
|
|
|
|
<%= pluralize(account.loan.term_months / 12, "year") %>
|
|
|
|
<% end %>
|
2024-10-08 17:16:37 -04:00
|
|
|
<% else %>
|
|
|
|
<%= t(".unknown") %>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<%= summary_card title: t(".type") do %>
|
|
|
|
<%= account.loan.rate_type&.titleize || t(".unknown") %>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
2024-10-18 14:37:42 -04:00
|
|
|
|
|
|
|
<div class="flex justify-center py-8">
|
2025-04-30 18:14:22 -04:00
|
|
|
<%= render LinkComponent.new(
|
|
|
|
text: "Edit loan details",
|
|
|
|
variant: "ghost",
|
|
|
|
href: edit_loan_path(account),
|
|
|
|
frame: :modal
|
|
|
|
) %>
|
2024-10-18 18:25:17 -04:00
|
|
|
</div>
|