Skip to content

Commit

Permalink
Add will call report.
Browse files Browse the repository at this point in the history
  • Loading branch information
scrozier committed Mar 3, 2012
1 parent e7cf449 commit 3141a4f
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 4 deletions.
10 changes: 6 additions & 4 deletions app/controllers/admin/reports_controller.rb
@@ -1,11 +1,13 @@
class Admin::ReportsController < ApplicationController

def reservations
@concert = Concert.find(params[:id])
before_filter :find_concert

def will_call_list
render :layout => 'printed_ticket'
end

def memorials
def find_concert
@concert = Concert.find(params[:id])
end

end
3 changes: 3 additions & 0 deletions app/views/admin/menu.html.haml
Expand Up @@ -6,6 +6,9 @@
%h2 Reservations by concert
- for concert in Concert.order(:date_and_time).all
%p= link_to "#{concert.name}, #{pretty_date(concert.date_and_time)}", admin_reservations_report_path(concert.id)
%h2 Will call list by concert
- for concert in Concert.order(:date_and_time).all
%p= link_to "#{concert.name}, #{pretty_date(concert.date_and_time)}", admin_will_call_list_path(concert.id)
%h2 Enter walk-up patrons
- for concert in Concert.order(:date_and_time).all
%p= link_to "#{concert.name}, #{pretty_date(concert.date_and_time)}", admin_enter_walkups_path(concert.id)
Expand Down
24 changes: 24 additions & 0 deletions app/views/admin/reports/will_call_list.html.haml
@@ -0,0 +1,24 @@
%h1 Reservations
- total_tickets = 0
- total_donations = BigDecimal.new('0')
%h2= @concert.name
%table
%thead
%tr
%th Patron
%th{:style => 'text-align:right'} Tickets
%tbody
- for reservation in @concert.reservations.includes(:patron).order('patrons.last_name, patrons.first_name')
- patron = reservation.patron
- total_tickets += reservation.number_of_tickets if reservation.number_of_tickets
%tr
%td{:style => 'vertical-align:baseline'}
%span{:style => 'font-size:2.0em; font-weight:bold'}
= patron.pretty_last_name
= patron.first_name
%td{:style => 'text-align:right'}= reservation.number_of_tickets
%tr
%td
%h1 Totals
%td{:style => 'text-align:right'}
%h1= total_tickets
1 change: 1 addition & 0 deletions config/routes.rb
Expand Up @@ -12,6 +12,7 @@
namespace :admin do
resources :concerts
match 'reservations/report/:id' => 'reports#reservations', :as => :reservations_report
match 'will_call/report/:id' => 'reports#will_call_list', :as => :will_call_list
match 'memorials/report/:id' => 'reports#memorials', :as => :memorials_report
match 'enter_walkups/:id' => 'miscellaneous#enter_walkups', :as => :enter_walkups
match 'add_walkup' => 'miscellaneous#add_walkup'
Expand Down

0 comments on commit 3141a4f

Please sign in to comment.