Guest User

Untitled

a guest
Feb 19th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. def customer
  2. @customer = params[:name]
  3. @tickets = Rt::Ticket.customer_billables( :customer => params[:name] )
  4. @tickets = @tickets.sort {|a,b| b.resolved <=> a.resolved }
  5. @total_amount = @tickets.map { |t| t.amount.to_f }.sum.to_f || 0
  6. @total_hours = @tickets.map { |t| t.hours.to_f }.sum.to_f || 0
  7. @selected_tickets = params[:tickets].collect {|x| x.to_i} rescue [0]
  8. end
Add Comment
Please, Sign In to add comment