<%= form_tag do_record_payments_path, :class => 'form-horizontal' do %>
<%= label_tag :account_id, 'Account ID', :class => 'col-sm-2 control-label' %>
<%= text_field_tag :account_id, @account_id, :class => 'form-control', :readonly => !@account_id.nil?, :required => true %>
<%= label_tag :payment_amount, 'Amount Received', :class => 'col-sm-2 control-label' %>
<%= number_field_tag :payment_amount, nil, :step => :any, :id => 'payment_amount', :class => 'form-control', :required => true %>

Currency: <%= @currency %>

<%= label_tag :effective_date, 'Payment Date', :class => 'col-sm-2 control-label' %>
<%= text_field_tag :effective_date, Date.parse(Time.now.to_s).to_s, :class => 'form-control date-picker', :required => true %>
<%= label_tag :payment_reference_number, 'Payment Ref. #', :class => 'col-sm-2 control-label' %>
<%= text_field_tag :payment_reference_number, nil, :class => 'form-control', :required => true %>
<%= label_tag :deposit_type, 'Payment Mode', :class => 'col-sm-2 control-label' %>
<%= select_tag :deposit_type, options_for_select(Deposit.deposit_types), :class => 'form-control' %>
<% unless @account_id.nil? %> <%= render(:partial => 'invoices_table') %> <% end %>
<%= submit_tag 'Save', :id => 'submit-btn', :class => 'btn btn-default' %>
<% end %> <%= javascript_tag do %> $(document).ready(function() { $('#account_id').change(function() { $("#invoices").html("<%= j render(:partial => 'invoices_table') %>"); }); }); <% end %>