Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Allow amount without decimal places when specifying payment amount (#12372)

Damian Kaczmarczykda653c329589
diff --git a/admin/app/views/spree/admin/payments/new.html.erb b/admin/app/views/spree/admin/payments/new.html.erb
index 4428d6cdb4..0ac2a67e84 100644
--- a/admin/app/views/spree/admin/payments/new.html.erb
+++ b/admin/app/views/spree/admin/payments/new.html.erb
@@ -13,7 +13,7 @@
<div class="form-group mb-3">
<%= f.label :amount, Spree.t(:amount) %>
<div class="input-group">
- <%= f.number_field :amount, value: @order.total_minus_store_credits - @order.payment_total, max: @order.total_minus_store_credits - @order.payment_total, class: 'form-control', required: true %>
+ <%= f.number_field :amount, value: @order.total_minus_store_credits - @order.payment_total, max: @order.total_minus_store_credits - @order.payment_total, step: ".01", class: 'form-control', required: true %>
<div class="input-group-append">
<span class="input-group-text"><%= currency_symbol(@order.currency) %></span>
</div>