Listing Chip Transactions for <%= @lab_group_name%> and <%= @chip_type_name%>

<%= link_to 'Chip Inventory Home', :controller => 'inventory', :action=>'index'%> <%= link_if_staff_or_admin 'New chip_transaction', :action => 'new' %> <%= link_if_staff_or_admin 'Enter an Inventory Check', :controller => 'inventory_checks', :action => 'new', :expected => @totals['chips'], :lab_group_id => session[:lab_group_id], :chip_type_id => session[:chip_type_id] %>

Totals

<% @total_column_human_names = ['Acquired','Used','Traded or Sold','Borrowed(In)', 'Returned(Out)','Borrowed(Out)','Returned(In)','Current Number of Chips'] %> <% for column_name in @total_column_human_names %> <% end %> <% @total_column_names = ['acquired','used','traded_sold','borrowed_in', 'returned_out','borrowed_out','returned_in','chips'] %> <% for column_name in @total_column_names %> <% end %>
<%= column_name %>
<%=h @totals[column_name] %>
<% if @totals['owed_out'] != 0 %>

This group owes <%=h @totals['owed_out'] %> chips to other groups

<% end %> <% if @totals['owed_in'] != 0 %>

Other groups owe <%=h @totals['owed_in'] %> chips to this group

<% end %>

Individual Transactions

<% authorized?(:action => 'edit'){ %><% } %> <% authorized?(:action => 'destroy'){ %><% } %> <% for chip_transaction in @chip_transactions %> <% authorized?(:action => 'edit'){ %><% } %> <% authorized?(:action => 'edit'){ %><% } %> <% end %>
Date Description Acquired Used Traded or Sold Borrowed(In) Returned(Out) Borrowed(Out) Returned(In)EditDestroy
<%=h chip_transaction.date %> <%=h chip_transaction.description %> <%=h chip_transaction.acquired %> <%=h chip_transaction.used %> <%=h chip_transaction.traded_sold %> <%=h chip_transaction.borrowed_in %> <%=h chip_transaction.returned_out %> <%=h chip_transaction.borrowed_out %> <%=h chip_transaction.returned_in %><%= link_to 'Edit', :action => 'edit', :id => chip_transaction %><%= link_to 'Destroy', { :action => 'destroy', :id => chip_transaction }, :confirm => 'Are you sure?' %>