diff --git a/app/models/ability.rb b/app/models/ability.rb index 066311af..624fa76a 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -89,6 +89,11 @@ class Ability can :moving, :movetable can :move_dining, :moveroom + + can :first_bill, :payment + can :show, :payment + can :create, :payment + can :reprint, :payment elsif user.role == "accountant" diff --git a/app/models/shift_sale.rb b/app/models/shift_sale.rb index a897de2b..aa4c565f 100644 --- a/app/models/shift_sale.rb +++ b/app/models/shift_sale.rb @@ -21,7 +21,7 @@ class ShiftSale < ApplicationRecord #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 diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index 558d35dd..fd951d6c 100644 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -42,7 +42,7 @@