mirror of
https://github.com/fspc/bike-database.git
synced 2026-09-16 08:31:39 -04:00
lk | adds ability to print multiple receipts for freecyclery clients
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user