mirror of
https://github.com/we-promise/sure.git
synced 2026-04-23 14:04:06 +00:00
Add tax treatment classification for investment accounts with international support (#693)
* Add tax treatment support for accounts, investments, and cryptos * Replace hardcoded region labels with I18n translations * Add I18n support for subtype labels with fallback to hardcoded values * fixed schema --------- Co-authored-by: luckyPipewrench <luckypipewrench@proton.me>
This commit is contained in:
17
app/views/accounts/_tax_treatment_badge.html.erb
Normal file
17
app/views/accounts/_tax_treatment_badge.html.erb
Normal file
@@ -0,0 +1,17 @@
|
||||
<%# locals: (account:) %>
|
||||
<%
|
||||
treatment = account.tax_treatment
|
||||
badge_classes = case treatment
|
||||
when :tax_exempt
|
||||
"bg-green-500/10 text-green-600 theme-dark:text-green-400"
|
||||
when :tax_deferred
|
||||
"bg-blue-500/10 text-blue-600 theme-dark:text-blue-400"
|
||||
when :tax_advantaged
|
||||
"bg-purple-500/10 text-purple-600 theme-dark:text-purple-400"
|
||||
else
|
||||
"bg-gray-500/10 text-secondary"
|
||||
end
|
||||
%>
|
||||
<span class="inline-flex items-center rounded-full px-2 py-0.5 text-xs font-medium <%= badge_classes %>" title="<%= t("accounts.tax_treatment_descriptions.#{treatment}") %>">
|
||||
<%= account.tax_treatment_label %>
|
||||
</span>
|
||||
@@ -9,6 +9,9 @@
|
||||
<div class="truncate">
|
||||
<div class="flex items-center gap-3">
|
||||
<h2 class="font-medium text-xl truncate <%= "animate-pulse" if account.syncing? %>"><%= title %></h2>
|
||||
<% if account.tax_treatment.present? %>
|
||||
<%= render partial: "accounts/tax_treatment_badge", locals: { account: account } %>
|
||||
<% end %>
|
||||
<% if account.draft? %>
|
||||
<%= render DS::Link.new(
|
||||
text: "Complete setup",
|
||||
|
||||
Reference in New Issue
Block a user