lk | adds ability to print multiple receipts for freecyclery clients

This commit is contained in:
Louis Knapp
2016-05-07 10:14:30 -05:00
parent bbc84247b4
commit 2ca3ae21a8
10 changed files with 147 additions and 35 deletions
+13
View File
@@ -31,6 +31,15 @@ class ClientsController < ApplicationController
end
end
def print_select
@clients = Client.includes(:bike).where.not(bike_id: nil).order(application_date: :desc).paginate(:page => params[:page], :per_page => 30)
end
def print_receipts
client_ids = print_params.map{|key, value| key if value == "1"}.compact
@clients = Client.find(client_ids)
end
private
def set_client
@client = Client.find(params[:id])
@@ -60,4 +69,8 @@ class ClientsController < ApplicationController
:pickup_date,
:volunteer_at_pickup)
end
def print_params
params.require(:print_clients)
end
end