<%= form_for(@payment, :url => { :action => :create }, :html => { :class => "form-horizontal" }) do |f| %> <%= f.hidden_field :account_id %> <%= hidden_field_tag :external, params[:external] %>
<% if @invoice.present? %> <%= f.hidden_field :target_invoice_id %>
<% end %> <% if can? :external_payment, Kaui::Payment %>
<%= label_tag :external, "External Payment?", :class => "control-label" %>
<% end %>
<%= f.label :purchased_amount, "Amount", :class => "control-label" %>
<%= f.text_field :purchased_amount, :id => 'payment_amount', :class => 'input-small' %>

<%= @account.currency %>

<%= label_tag :reason, "Reason", :class => "control-label" %>
<%= select_tag :reason, options_for_select(Kaui::Payment::SAMPLE_REASON_CODES) %>
<%= label_tag :comment, "Comment", :class => "control-label" %>
<%= text_area_tag :comment, "", :rows => 3, :class => 'input-xlarge' %>
<%= button_tag "Process Payment", :class =>"btn btn-primary" %> <%= link_to 'Back', :back, :class => 'btn' %>
<% end %> <%= javascript_tag do %> $(document).ready(function() { $("#payment_amount").keydown(function(event) { preventNonNumericValues(event); }); }); <% end %>