<%= form_for @payment, :url => {:action => :create}, :html => {:class => 'form-horizontal'} do |f| %> <%= f.hidden_field :account_id %> <%= f.hidden_field :target_invoice_id %> <% if can? :external_payment, Kaui::Payment %>
<%= label_tag :external do %> <%= check_box_tag :external %>External? <% end %>
<% end %>
<%= f.label :purchased_amount, 'Amount', :class => 'col-sm-3 control-label' %>
<%= f.text_field :purchased_amount, :id => 'payment_amount', :class => 'form-control' %>

Currency: <%= @invoice.present? ? @invoice.currency : @account.currency %>

<%= f.label :payment_method_id, 'Payment Method', :class => 'col-sm-3 control-label' %>
<%= f.collection_select :payment_method_id, @payment_methods, :payment_method_id, Proc.new { |pm| "#{pm.plugin_name} (#{pm.payment_method_id})" }, {:include_blank => true}, :class => 'form-control' %>

Leave blank to use account's default

<%= label_tag :reason, 'Reason', :class => 'col-sm-3 control-label' %>
<%= select_tag :reason, options_for_select(Kaui::Payment::SAMPLE_REASON_CODES), :class => 'form-control' %>
<%= label_tag :comment, 'Comment', :class => 'col-sm-3 control-label' %>
<%= text_area_tag :comment, nil, :rows => 3, :class => 'form-control' %>
<%= submit_tag 'Save', :class => 'btn btn-default' %>
<% end %> <%= javascript_tag do %> $(document).ready(function() { $("#payment_amount").keydown(function(event) { preventNonNumericValues(event); }); }); <% end %>