diff --git a/app/views/trades/_header.html.erb b/app/views/trades/_header.html.erb index c35f56896..68976a392 100644 --- a/app/views/trades/_header.html.erb +++ b/app/views/trades/_header.html.erb @@ -3,7 +3,7 @@
<%= tag.header class: "mb-4 space-y-1" do %> - <%= entry.amount.negative? ? t(".buy") : t(".sell") %> + <%= entry.amount.positive? ? t(".buy") : t(".sell") %>
diff --git a/app/views/trades/show.html.erb b/app/views/trades/show.html.erb index 75c36f527..31f49fe27 100644 --- a/app/views/trades/show.html.erb +++ b/app/views/trades/show.html.erb @@ -22,7 +22,7 @@
<%= f.select :nature, [[t(".buy"), "outflow"], [t(".sell"), "inflow"]], - { container_class: "w-1/3", label: t(".type_label"), selected: @entry.amount.negative? ? "outflow" : "inflow" }, + { container_class: "w-1/3", label: t(".type_label"), selected: @entry.amount.positive? ? "outflow" : "inflow" }, { data: { "auto-submit-form-target": "auto" }, disabled: @entry.linked? } %> <%= f.fields_for :entryable do |ef| %> <%= ef.number_field :qty,