Merge branch 'foodcourt' of gitlab.com:code2lab/SXRestaurant into HEAD

This commit is contained in:
Myat Zin Wai Maw
2020-01-14 18:11:09 +06:30
8 changed files with 34 additions and 21 deletions

View File

@@ -1041,7 +1041,7 @@ $(function() {
}else if(result.data == 'OK'){
window.location.href = '/origami/'+type+'/pending_order/' + $('#sale_id').text();
}else{
if(result.current_user_role == 'foodcourt_cashier'){
if(result.current_user_role == 'cashier'){
window.location.href = "/foodcourt/sale/"+result.data["sale_id"]+"/"+type+"/payment";
}
else{

View File

@@ -199,13 +199,22 @@ class HomeController < ApplicationController
redirect_to dashboard_path
end
elsif employee.role == "cashier"
food_court = Lookup.find_by_lookup_type_and_value("food_court", "1")
#check if cashier has existing open cashier
shift = ShiftSale.current_open_shift(employee)
if !shift.nil?
redirect_to origami_dashboard_path
# redirect_to origami_root_path
if food_court
if !shift.nil?
redirect_to foodcourt_food_court_path
else
redirect_to new_foodcourt_shift_path
end
else
redirect_to new_origami_shift_path
if !shift.nil?
redirect_to origami_dashboard_path
# redirect_to origami_root_path
else
redirect_to new_origami_shift_path
end
end
elsif employee.role == "manager"
redirect_to dashboard_path

View File

@@ -37,7 +37,8 @@
<!-- #END# Overlay For Sidebars -->
<%= render 'layouts/header' %>
<section>
<%if current_login_employee.role == "foodcourt_cashier" %>
<%food_court = Lookup.find_by_lookup_type_and_value("food_court", "1")%>
<% if food_court %>
<%= render 'layouts/foodcourt_left_sidebar' %>
<% else %>
<%= render 'layouts/left_sidebar' %>

View File

@@ -23,7 +23,12 @@
<a class="navbar-brand mbl_view" href="<%=origami_dashboard_path%>" style="margin-left: 20px;">
<% elsif current_login_employee.role == "cashier" || current_login_employee.role == "waiter"%>
<%if ShiftSale.current_open_shift(current_login_employee) %>
<a class="navbar-brand mbl_view" href="<%=origami_dashboard_path%>" style="margin-left: 20px;">
<%food_court = Lookup.find_by_lookup_type_and_value("food_court", "1")%>
<%if current_login_employee.role == "cashier" && food_court %>
<a class="navbar-brand mbl_view" href="<%=foodcourt_food_court_path%>" style="margin-left: 20px;">
<%else%>
<a class="navbar-brand mbl_view" href="<%=origami_dashboard_path%>" style="margin-left: 20px;">
<%end%>
<%else%>
<a class="navbar-brand mbl_view" href="" style="margin-left: 20px;">
<%end%>
@@ -46,7 +51,8 @@
<span class="navbar-brand navbar-brand-txt"><%= current_shop.name %></span>
</div>
<!-- End Shop Info -->
<% if current_login_employee.role !='foodcourt_cashier' %>
<%food_court = Lookup.find_by_lookup_type_and_value("food_court", "1")%>
<% if !food_court %>
<div class="navbar-right m-auto">
<% if order_reservation %>
<div class="online_order">
@@ -156,15 +162,8 @@
</p>
</li>
<% end %>
<%if current_login_employee.role =="foodcourt_cashier" %>
<li>
<p class="waves-effect waves-block p-l-30 m-b-5">
<a href="/foodcourt/second_display" onclick="window.open('/foodcourt/second_display', 'newwindow', 'width=700,height=500'); return false;" style="text-decoration: none;">
<i class="material-icons font-7 logout_icon shopinfo">info</i>
<span class="font-15 shopinfo" >Second Display</span>
</a>
</p>
</li>
<%food_court = Lookup.find_by_lookup_type_and_value("food_court", "1")%>
<% if food_court %>
<li>
<p class="waves-effect waves-block p-l-30 m-b-5 close_cashier">
<i class="material-icons font-7 logout_icon">close</i>

View File

@@ -38,7 +38,8 @@
<!-- #END# Overlay For Sidebars -->
<%= render 'layouts/header' %>
<section>
<%if current_login_employee.role == "foodcourt_cashier" %>
<%food_court = Lookup.find_by_lookup_type_and_value("food_court", "1")%>
<% if food_court %>
<%= render 'layouts/foodcourt_left_sidebar' %>
<% else %>
<%= render 'layouts/left_sidebar' %>

View File

@@ -3,7 +3,8 @@
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t :booking %></li>
<span class="float-right">
<%if current_login_employee.role == "foodcourt_cashier" %>
<%food_court = Lookup.find_by_lookup_type_and_value("food_court", "1")%>
<% if food_court %>
<%= link_to 'Back', foodcourt_food_court_path %>
<% else %>
<%= link_to 'Back', dashboard_path %>

View File

@@ -4,7 +4,8 @@
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.order") %></li>
<span class="float-right">
<%if current_login_employee.role == "foodcourt_cashier" %>
<%food_court = Lookup.find_by_lookup_type_and_value("food_court", "1")%>
<% if food_court %>
<%= link_to 'Back', foodcourt_food_court_path %>
<% else %>
<%= link_to 'Back', dashboard_path %>

View File

@@ -3,7 +3,8 @@
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t :sale %></li>
<span class="float-right">
<%if current_login_employee.role == "foodcourt_cashier" %>
<%food_court = Lookup.find_by_lookup_type_and_value("food_court", "1")%>
<% if food_court %>
<%= link_to 'Back', transactions_bookings_path %>
<% else %>
<%= link_to 'Back', dashboard_path %>