validate foodcourt origami cashier

This commit is contained in:
NyanLinHtut
2020-05-18 14:23:33 +06:30
parent 1dc01d6055
commit 871403382e
2 changed files with 270 additions and 235 deletions

View File

@@ -7,7 +7,8 @@ class Foodcourt::FoodCourtController < ApplicationController
end
end
def index
def index
if !ShiftSale.current_shift.nil?
if params[:sale_id].present?
sale =Sale.find(params[:sale_id])
if sale
@@ -50,6 +51,13 @@ class Foodcourt::FoodCourtController < ApplicationController
.joins("JOIN customers ON orders.customer_id=customers.customer_id")
.where("bookings.booking_status !=? and sales.sale_status =? and sales.payment_status =? and orders.source='app' and DATE(bookings.created_at)=?",'completed','completed','paid',Date.today).order("bookings.created_at desc").uniq.length
render "foodcourt/addorders/detail"
else
if current_user.role == 'administrator' || current_user.role == 'manager'
redirect_to origami_dashboard_path
else
redirect_to new_foodcourt_shift_path
end
end
end
def get_menu_category ()