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 @@
  • <%= link_to "Daily Sale Report", reports_dailysale_index_path, :tabindex =>"-1" %>
  • <%= link_to "Sales Item Report", reports_saleitem_index_path, :tabindex =>"-1" %>
  • <%= link_to "Receipt Report", reports_receipt_no_index_path, :tabindex =>"-1" %>
  • - +
  • <%= link_to "Shift Sale Report", reports_shiftsale_index_path, :tabindex =>"-1" %>
  • diff --git a/app/views/reports/shiftsale/index.html.erb b/app/views/reports/shiftsale/index.html.erb index 6a1d69c2..714a8328 100644 --- a/app/views/reports/shiftsale/index.html.erb +++ b/app/views/reports/shiftsale/index.html.erb @@ -42,9 +42,9 @@ Credit Payment - Card Payment - Grand Total + - + Other Payment + Grand Total @@ -101,7 +101,7 @@ <%= sprintf("%.2f",card) rescue '-'%> - <%= sprintf("%.2f",total) rescue '-'%> + <%= sprintf("%.2f",g_total) rescue '-'%>