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

@@ -17,6 +17,7 @@
<% else %>
<%= link_to 'Certifications', certifications_path if can? :read, Certification %>
<% end %>
<%= link_to 'Payments', payments_path if can? :read, Payment %>
<%= link_to 'Door Logs', door_logs_path if can? :read, DoorLog %>
<%= link_to 'Computers', macs_path if user_signed_in? && (can? :read, Mac) %>
<% if user_signed_in? then %><%= link_to 'Profile', edit_user_registration_path %><% end %>

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 %>

View File

@@ -12,18 +12,22 @@
<p>
User Details: <%= link_to @url+user_path(@user), @url+user_path(@user) %>
</p>
<p>
<b>What skills, knowledge and experience do you bring to the community?</b>
<%= simple_format @user.current_skills %>
</p>
<p>
<b>What skills, knowledge and experiences are you looking for in HeatSync?</b>
<%= simple_format @user.desired_skills %>
</p>
<p>
<b>How'd you find out about HeatSync?</b>
<%= simple_format @user.marketing_source %>
</p>
<p>
<b>Member Level:</b>
<%= simple_format @user.member_level_string %>
</p>
<p>
<b>What skills, knowledge and experience do you bring to the community?</b>
<%= simple_format @user.current_skills %>
</p>
<p>
<b>What skills, knowledge and experiences are you looking for in HeatSync?</b>
<%= simple_format @user.desired_skills %>
</p>
<p>
<b>How'd you find out about HeatSync?</b>
<%= simple_format @user.marketing_source %>
</p>
</body>
</html>

View File

@@ -4,6 +4,7 @@ Please contact them at <%= @user.email %><%= " or "+@user.phone.to_s unless @use
new user orientation, waiver, welcome, payment help, etc.
User Details: <%= link_to @url+user_path(@user), @url+user_path(@user) %>
Member Level: <%= simple_format @user.member_level %>
What skills, knowledge and experience do you bring to the community?
<%= simple_format @user.current_skills %>

View File

@@ -65,6 +65,10 @@
<div class="field">
<%= render :partial => "/users/payment_methods", :locals => { :g => f } %>
</div>
<div class="field">
<%= f.label :payee %><br />
<%= f.text_field :payee%>
</div>
<div class="field">
<%= f.label :phone %><br />
<%= f.text_field :phone %>
@@ -81,10 +85,6 @@
<%= f.label :marketing_source, "How'd you find out about HeatSync?" %><br />
<%= f.text_area :marketing_source %>
</div>
<div class="field">
<%= f.label :member, "Member?" %><br />
<%= f.select :member, [[nil],["No",0],["Inactive",1],["Volunteer",10],["Associate",25],["Basic",50],["Plus",100]] %>
</div>
<div class="field">
<%= f.label :instructor, "Instructor?" %><br />
<%= f.check_box :instructor %>
@@ -93,6 +93,10 @@
<%= f.label :admin, "Admin?" %><br />
<%= f.check_box :admin %>
</div>
<div class="field">
<%= f.label :accountant, "Accountant?" %><br />
<%= f.check_box :accountant %>
</div>
<div class="field">
<%= f.label :hidden, "Hidden?" %><br />
<%= f.check_box :hidden %>

View File

@@ -8,8 +8,8 @@
<col />
<% if current_user.admin? then %><col /><% end %>
<col />
<% if current_user.admin? %><col /><% end %>
<col class="col_highlight" />
<% if current_user.admin? %><col />
<col class="col_highlight" /><% end %>
<col />
<col class="col_highlight" />
<col />
@@ -26,7 +26,7 @@
<th><a href="?sort=member">Member?</a></th>
<th><a href="?sort=card">Card?</a></th>
<th><a href="?sort=instructor">Instructor?</a></th>
<th><a href="?sort=admin">Admin?</a></th>
<% if current_user.admin? then %><th><a href="?sort=admin">Admin?</a></th><% end %>
<th></th>
<th></th>
</tr>
@@ -44,10 +44,10 @@
<%= unless user.orientation.blank? then raw("<span class='hoverinfo' title='"+user.orientation.strftime("%B %d %Y")+"'>&#x2713;</span>") end %>
</td><% end %>
<td><%= unless user.waiver.blank? then raw("<span class='hoverinfo' title='"+user.waiver.strftime("%B %d %Y")+"'>&#x2713;</span>") end %></td>
<td><%= raw(user.member_status) %></td>
<td><%= raw(user.member_status_symbol) %></td>
<td><%= unless user.cards.blank? then raw("<span class='iconinfo'>&#x2713;</span>") end %></td>
<td><%= if user.instructor? then raw("<span class='iconinfo'>&#x2713;</a>") end %></td>
<td><%= if user.admin? then raw("<span class='iconinfo'>&#x2713;</a>") end %></td>
<% if current_user.admin? then %><td><%= if user.admin? then raw("<span class='iconinfo'>&#x2713;</a>") end %></td><% end %>
<td><%= link_to 'Edit', edit_user_path(user) if can? :update, user %></td>
<td><%= link_to 'Destroy', user, :confirm => 'Are you sure? WARNING: THIS DOES NOT REMOVE THE USER FROM THE DOOR SYSTEM! DISABLE THEM FIRST.', :method => :delete if can? :destroy, user %></td>
</tr>

View File

@@ -12,7 +12,7 @@
<p>
<b>Current Member?</b>
<%= raw(@user.member_status) %>
<%= raw(@user.member_status_symbol) %>
</p>
<p>
@@ -20,12 +20,6 @@
<%= @user.instructor? %>
</p>
<p>
<b>Admin?</b>
<%= @user.admin? %>
</p>
<% if current_user.admin? then %>
<p>
<b>Email:</b>
@@ -56,6 +50,10 @@
<b>Payment Method:</b>
<%= @user.payment_method %>
</p>
<p>
<b>Payee:</b>
<%= @user.payee %>
</p>
<p>
<b>Phone:</b>
<%= @user.phone %>
@@ -94,5 +92,12 @@
<% if @user.certifications.blank? %><li>n/a</li><% end %>
</ul>
<% if current_user.admin? then %>
<p>
<b>Created:</b>
<%= @user.created_at %>
</p>
<% end %>
<% if can? :update, @user then %><%= link_to 'Edit', edit_user_path(@user) %> |<% end %>
<%= link_to 'Back', users_path %>