diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 3353a3a5..fd45ed1d 100755 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -109,6 +109,13 @@ class HomeController < ApplicationController @sales = @sales.date_on(today) end + if current_user.present? && !(current_user.role == 'administrator' || current_user.role == 'manager' || current_user.role == 'account' || current_user.role == 'supervisor') + if shift = ShiftSale.current_open_shift(current_user.id) + @orders = @orders.where(shift_sale_id: shift.id) + @sales = @sales.where(shift_sale_id: shift.id) + end + end + @top_products = Sale.top_bottom_products(today,current_user,@from,@to,@from_time,@to_time,"top") @bottom_products = Sale.top_bottom_products(today,current_user,@from,@to,@from_time,@to_time,"bottom") @hourly_sales = Sale.hourly_sales(today,current_user,@from,@to,@from_time,@to_time)