Adding csv import
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
<th>Item</th>
|
||||
<th>Amount</th>
|
||||
</tr>
|
||||
<% @ipns.reverse!.each do |ipn| %>
|
||||
<% @ipns.sort_by(&:date_parsed).reverse!.each do |ipn| %>
|
||||
<tr>
|
||||
<td><%= ipn.payment_date %></td>
|
||||
<td><%= ipn.first_name %> <%= ipn.last_name %></td>
|
||||
|
||||
31
app/views/paypal_csvs/index.html.erb
Normal file
31
app/views/paypal_csvs/index.html.erb
Normal file
@@ -0,0 +1,31 @@
|
||||
<%= link_to "Upload CSV", new_paypal_csv_path %>
|
||||
<table>
|
||||
<tr>
|
||||
<th>Date</th>
|
||||
<th>Name</th>
|
||||
<th>Item</th>
|
||||
<th>Amount</th>
|
||||
</tr>
|
||||
<% @paypal_csvs.sort_by(&:date_parsed).reverse!.each do |paypal_csv| %>
|
||||
<tr>
|
||||
<td><%= paypal_csv.date %></td>
|
||||
<td><%= paypal_csv._name %></td>
|
||||
<td><%= paypal_csv._item_title %></td>
|
||||
<td>
|
||||
<% if paypal_csv._gross.blank? %>
|
||||
<%= paypal_csv._type %>
|
||||
<% else %>
|
||||
<%= paypal_csv._gross %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td>
|
||||
<% if paypal_csv.payment.present? %>
|
||||
<%= link_to "Linked Payment", paypal_csv.payment %>
|
||||
<% else %>
|
||||
<%= link_to "Try to link email '#{paypal_csv._from_email_address}' at membership level '#{paypal_csv._gross.to_i}'", link_paypal_csv_path(paypal_csv) %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= link_to "Details", paypal_csv %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
15
app/views/paypal_csvs/new.html.erb
Normal file
15
app/views/paypal_csvs/new.html.erb
Normal file
@@ -0,0 +1,15 @@
|
||||
<style type="text/css">
|
||||
label {
|
||||
width: 10em;
|
||||
display: inline-block;}
|
||||
</style>
|
||||
|
||||
<%= form_tag('/paypal_csvs', :multipart => true) do |f| %>
|
||||
<div class="field">
|
||||
<%= label_tag :file %>
|
||||
<%= file_field_tag :file %>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<%= submit_tag %>
|
||||
</div>
|
||||
<% end %>
|
||||
Reference in New Issue
Block a user