mirror of
https://github.com/we-promise/sure.git
synced 2026-04-21 13:04:18 +00:00
Add default currency to price and fee fields (#1444)
* Add default currency to price and fee fields Set account currency as default currency instead of defaulting to USD. Signed-off-by: Neeraj Verma <github@smurfpandey.me> * Fix default currency issue --------- Signed-off-by: Neeraj Verma <github@smurfpandey.me>
This commit is contained in:
@@ -51,7 +51,7 @@
|
||||
<%= form.date_field :date, label: true, value: model.date || Date.current, required: true %>
|
||||
|
||||
<% unless %w[buy sell].include?(type) %>
|
||||
<%= form.money_field :amount, label: t(".amount"), value: model.amount, required: true %>
|
||||
<%= form.money_field :amount, label: t(".amount"), value: model.amount, required: true, default_currency: account&.currency %>
|
||||
<% end %>
|
||||
|
||||
<% if %w[deposit withdrawal].include?(type) %>
|
||||
@@ -60,8 +60,8 @@
|
||||
|
||||
<% if %w[buy sell].include?(type) %>
|
||||
<%= form.number_field :qty, label: t(".qty"), placeholder: "10", min: 0.000000000000000001, step: "any", required: true %>
|
||||
<%= form.money_field :price, label: t(".price"), step: "any", precision: 10, required: true %>
|
||||
<%= form.money_field :fee, label: t(".fee"), step: "any", min: 0 %>
|
||||
<%= form.money_field :price, label: t(".price"), step: "any", precision: 10, required: true, default_currency: account&.currency %>
|
||||
<%= form.money_field :fee, label: t(".fee"), step: "any", min: 0, default_currency: account&.currency %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user