Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant

This commit is contained in:
Nweni
2017-07-01 09:46:44 +06:30
21 changed files with 346 additions and 254 deletions

View File

@@ -20,8 +20,8 @@ class ShiftSale < ApplicationRecord
#if current_user
#find open shift where is open today and is not closed and login by current cashier
today_date = DateTime.now.strftime("%Y-%m-%d")
puts today_date
shift = ShiftSale.where("TO_CHAR(shift_started_at, 'YYYY-MM-DD')=? and shift_started_at is not null and shift_closed_at is null and employee_id = #{current_user}", today_date).take
shift = ShiftSale.where("DATE(shift_started_at)= #{ today_date } and shift_started_at is not null and shift_closed_at is null and employee_id = #{current_user}").take
return shift
#end