Skip to content

Commit

Permalink
Add to-pay column to spreadsheet and list also unpaid users to xls re…
Browse files Browse the repository at this point in the history
…port
  • Loading branch information
TomNaessens committed May 5, 2015
1 parent b7392f1 commit 6b18d17
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/models/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ def generate_xls
xls = Spreadsheet::Workbook.new
sheet = xls.create_worksheet

sheet.update_row 0, "Naam", "Email", "Studentnummer", "Ticket", "Comment"
registrations.select(&:is_paid).each.with_index do |reg, i|
sheet.update_row i + 1, reg.name, reg.email, reg.student_number, reg.access_levels.first.name, reg.comment
sheet.update_row 0, "Naam", "Email", "Studentnummer", "Ticket", "Comment", "Te betalen"
registrations.each.with_index do |reg, i|
sheet.update_row i + 1, reg.name, reg.email, reg.student_number, reg.access_levels.first.name, reg.comment, reg.to_pay
end
data = Tempfile.new(["export", ".xls"])

Expand Down

0 comments on commit 6b18d17

Please sign in to comment.