mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 03:54:08 +00:00
fix: inverted Buy/Sell type selection by changing amount.negative to amount.positive in trade edit views (#952)
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<div id="<%= dom_id(entry, :header) %>">
|
||||
<%= tag.header class: "mb-4 space-y-1" do %>
|
||||
<span class="text-secondary text-sm">
|
||||
<%= entry.amount.negative? ? t(".buy") : t(".sell") %>
|
||||
<%= entry.amount.positive? ? t(".buy") : t(".sell") %>
|
||||
</span>
|
||||
|
||||
<div class="flex items-center gap-4">
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<div class="flex items-center gap-2">
|
||||
<%= 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,
|
||||
|
||||
Reference in New Issue
Block a user