Adding payments

This commit is contained in:
2013-02-12 01:58:17 -07:00
parent 3fb774d057
commit ed75ea0e90
29 changed files with 447 additions and 60 deletions

View File

@@ -0,0 +1,25 @@
<%= form_for(@payment) do |f| %>
<% if @payment.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@payment.errors.count, "error") %> prohibited this payment from being saved:</h2>
<ul>
<% @payment.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="field">
<%= f.label :user_id, "User" %><br />
<%= collection_select(:payment, :user_id, @users, :id, :name_with_payee_and_member_level) %>
</div>
<div class="field">
<%= f.label :date, "Paid for month beginning" %><br />
<%= f.date_select :date %>
</div>
<div class="actions">
<%= f.submit %>
</div>
<% end %>

View File

@@ -0,0 +1,6 @@
<h1>Editing payment</h1>
<%= render 'form' %>
<%= link_to 'Show', @payment %> |
<%= link_to 'Back', payments_path %>

View File

@@ -0,0 +1,24 @@
<h1>Listing payments</h1>
<%= link_to 'New Payment', new_payment_path %>
<br />
<table>
<tr>
<th>User</th>
<th>Paid for month <br/>beginning</th>
<th></th>
<th></th>
<th></th>
</tr>
<% @payments.each do |payment| %>
<tr>
<td><%= link_to payment.user.name_with_payee_and_member_level, payment.user unless payment.user.blank? %></td>
<td><%= payment.human_date %></td>
<td><%= link_to 'Details', payment %></td>
<td><%= link_to 'Edit', edit_payment_path(payment) %></td>
</tr>
<% end %>
</table>

View File

@@ -0,0 +1,5 @@
<h1>New payment</h1>
<%= render 'form' %>
<%= link_to 'Back', payments_path %>

View File

@@ -0,0 +1,29 @@
<p>
<b>User:</b>
<%= @payment.user.name_with_payee_and_member_level unless @payment.user.blank? %>
</p>
<p>
<b>Paid for month beginning:</b>
<%= @payment.date %>
</p>
<p>
<b>Last Modified by:</b>
<%= user = @users.find{|u| u.id == @payment.created_by}; link_to user.name, user unless user.blank? %>
</p>
<p>
<b>Created date:</b>
<%= @payment.created_at %>
</p>
<p>
<b>Updated date:</b>
<%= @payment.updated_at %>
</p>
<%= link_to 'Edit', edit_payment_path(@payment) %> |
<%= link_to 'Destroy', @payment, :confirm => 'Are you sure you want to destroy this payment?', :method => :delete if can? :destroy, @payment %> |
<%= link_to 'Back', payments_path %>