lk | doesn't display clients without agencies on the print select page

This commit is contained in:
Louis Knapp
2016-07-30 20:35:22 -05:00
parent b7090dba0d
commit ba23905e20
5 changed files with 20 additions and 2 deletions
+4 -1
View File
@@ -32,7 +32,10 @@ class ClientsController < ApplicationController
end
def print_select
@clients = Client.includes(:bike).where.not(bike_id: nil).order(application_date: :desc).paginate(:page => params[:page], :per_page => 30)
@clients = Client.includes(:bike, :agency)
.where.not(bike_id: nil, agency_id: nil)
.order(application_date: :desc)
.paginate(:page => params[:page], :per_page => 30)
end
def print_receipts
+1
View File
@@ -1,5 +1,6 @@
.container
%h1 Select the clients whose receipts you would like to print
%p Only clients with a bike and an agency assigned are shown on this page.
=form_tag("/clients/print_receipts", method: "get") do
%table.table.table-striped.table-bordered.table-hover