<%= form_for(@credit, :url => { :action => :create }, :html => { :class => "form-horizontal" }) do |f| %> <%= f.hidden_field :account_id %>
<% if @invoice.present? %> <%= f.hidden_field :invoice_id %>
<% end %>
<%= f.label :credit_amount, "Credit amount", :class => "control-label" %>
<%= f.text_field :credit_amount, :id => 'credit_amount', :class => 'input-small' %>

<%= @account.currency %>

<%= f.label :effective_date, 'Effective Date:', :class => "control-label" %>
<%= f.text_field :effective_date, :class => 'input-xlarge date-picker' %>
<%= label_tag :reason, "Reason", :class => "control-label" %>
<%= select_tag :reason, options_for_select(Kaui::Credit::SAMPLE_REASON_CODES) %>
<%= label_tag :comment, "Comment", :class => "control-label" %>
<%= text_area_tag :comment, "", :rows => 3, :class => 'input-xlarge' %>
<%= button_tag "Create credit", :class =>"btn btn-primary" %> <%= link_to 'Back', :back, :class => 'btn' %>
<% end %> <%= javascript_tag do %> $(document).ready(function() { $("#credit_amount").keydown(function(event) { preventNonNumericValues(event); }); }); <% end %>