End of week commit
This commit is contained in:
@@ -3,7 +3,20 @@ module Suppliers
|
||||
# GET /lists
|
||||
# GET /lists.json
|
||||
def index
|
||||
@lists = List.for_supplier(current_supplier, page: params[:page], per_page: params[:per_page] || 25)
|
||||
if params[:date].present?
|
||||
@date = params[:date].present? ? (Date.parse(params[:date]) rescue Date.today) : Date.today
|
||||
@time = @date.to_time(:utc)
|
||||
@start_time = @time.beginning_of_day
|
||||
@end_time = @time.end_of_day
|
||||
if current_supplier.night_offset.present?
|
||||
@start_time += current_supplier.night_offset.to_f.hours
|
||||
@end_time += current_supplier.night_offset.to_f.hours
|
||||
end
|
||||
@lists = List.for_supplier_created_at current_supplier, @start_time..@end_time
|
||||
@lists.include_relation(:table) # for number
|
||||
else
|
||||
@lists = List.for_supplier(current_supplier, page: params[:page], per_page: params[:per_page] || 25)
|
||||
end
|
||||
@lists.include_relation(:table)
|
||||
|
||||
respond_to do |format|
|
||||
|
||||
Reference in New Issue
Block a user