update add order for menu and void foc for no table
This commit is contained in:
@@ -209,3 +209,35 @@ i.logout_icon{
|
|||||||
.blue{
|
.blue{
|
||||||
background-color: blue;
|
background-color: blue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*For Menu List*/
|
||||||
|
.dropdown-toggle:after{
|
||||||
|
margin-left:30px;
|
||||||
|
}
|
||||||
|
.my-toggle{
|
||||||
|
padding: 15px 35px 10px 20px;
|
||||||
|
line-height:2;
|
||||||
|
border-bottom: 1px solid #fff;
|
||||||
|
}
|
||||||
|
.list-menu{
|
||||||
|
list-style: none;
|
||||||
|
margin-top:5px;
|
||||||
|
background-color: #eee;
|
||||||
|
}
|
||||||
|
.menu_list{
|
||||||
|
display: block;
|
||||||
|
background-color: #eeeeee;
|
||||||
|
border-bottom: .214rem solid #fff;
|
||||||
|
border-left: 1px solid #54A5AF;
|
||||||
|
border-right: 1px solid #54A5AF;
|
||||||
|
margin-bottom: -1px;
|
||||||
|
margin-top: 5px
|
||||||
|
}
|
||||||
|
.menu_click{
|
||||||
|
list-style: none;
|
||||||
|
margin-left:-40px;
|
||||||
|
border-bottom: .014rem solid #fff;
|
||||||
|
}
|
||||||
|
.list-menu > a:hover{
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
@@ -39,33 +39,41 @@ class Origami::VoidController < BaseOrigamiController
|
|||||||
# end
|
# end
|
||||||
# end
|
# end
|
||||||
|
|
||||||
table_avaliable = true
|
if sale.bookings[0].dining_facility_id.to_i > 0
|
||||||
table_count = 0
|
table_avaliable = true
|
||||||
table = sale.bookings[0].dining_facility
|
table_count = 0
|
||||||
table.bookings.each do |booking|
|
table = sale.bookings[0].dining_facility
|
||||||
if booking.booking_status != 'moved'
|
table.bookings.each do |booking|
|
||||||
if booking.sale_id
|
if booking.booking_status != 'moved'
|
||||||
if booking.sale.sale_status != 'completed' && booking.sale.sale_status != 'void'
|
if booking.sale_id
|
||||||
|
if booking.sale.sale_status != 'completed' && booking.sale.sale_status != 'void'
|
||||||
|
table_avaliable = false
|
||||||
|
table_count += 1
|
||||||
|
else
|
||||||
|
table_avaliable = true
|
||||||
|
end
|
||||||
|
else
|
||||||
table_avaliable = false
|
table_avaliable = false
|
||||||
table_count += 1
|
table_count += 1
|
||||||
else
|
|
||||||
table_avaliable = true
|
|
||||||
end
|
end
|
||||||
else
|
|
||||||
table_avaliable = false
|
|
||||||
table_count += 1
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
if table_avaliable && table_count == 0
|
if table_avaliable && table_count == 0
|
||||||
table.status = 'available'
|
table.status = 'available'
|
||||||
table.save
|
table.save
|
||||||
|
end
|
||||||
|
else
|
||||||
|
table = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
# FOr Sale Audit
|
# FOr Sale Audit
|
||||||
action_by = current_user.id
|
action_by = current_user.id
|
||||||
remark = "Void Sale ID #{sale_id} | Receipt No #{sale.receipt_no} | Receipt No #{sale.receipt_no} | Table ->#{table.name}"
|
if table.nil?
|
||||||
|
remark = "Void Sale ID #{sale_id} | Receipt No #{sale.receipt_no} | Receipt No #{sale.receipt_no} | Table -> nil"
|
||||||
|
else
|
||||||
|
remark = "Void Sale ID #{sale_id} | Receipt No #{sale.receipt_no} | Receipt No #{sale.receipt_no} | Table ->#{table.name}"
|
||||||
|
end
|
||||||
sale_audit = SaleAudit.record_audit_for_edit(sale_id,sale.cashier_id, action_by,remark,"SALEVOID" )
|
sale_audit = SaleAudit.record_audit_for_edit(sale_id,sale.cashier_id, action_by,remark,"SALEVOID" )
|
||||||
|
|
||||||
# For Print
|
# For Print
|
||||||
@@ -78,13 +86,21 @@ class Origami::VoidController < BaseOrigamiController
|
|||||||
bookings = Booking.where("sale_id='#{sale_id}'")
|
bookings = Booking.where("sale_id='#{sale_id}'")
|
||||||
if bookings.count > 1
|
if bookings.count > 1
|
||||||
# for Multiple Booking
|
# for Multiple Booking
|
||||||
table = DiningFacility.find(bookings[0].dining_facility_id)
|
if bookings[0].dining_facility_id.to_i>0
|
||||||
else
|
table = DiningFacility.find(bookings[0].dining_facility_id)
|
||||||
table = DiningFacility.find(bookings[0].dining_facility_id)
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
cashier_zone = CashierTerminalByZone.find_by_zone_id(table.zone_id)
|
if bookings[0].dining_facility_id.to_i > 0
|
||||||
cashier_terminal = CashierTerminal.find(cashier_zone.cashier_terminal_id)
|
cashier_zone = CashierTerminalByZone.find_by_zone_id(table.zone_id)
|
||||||
|
cashier_terminal = CashierTerminal.find(cashier_zone.cashier_terminal_id)
|
||||||
|
else
|
||||||
|
shift = ShiftSale.find(sale.shift_sale_id)
|
||||||
|
cashier_terminal = CashierTerminal.find(shift.cashier_terminal_id)
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
|
if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
|
||||||
unique_code = "ReceiptBillPdf"
|
unique_code = "ReceiptBillPdf"
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
<%= stylesheet_link_tag 'addorder', media: 'all', 'data-turbolinks-track': 'reload' %>
|
<%= stylesheet_link_tag 'addorder', media: 'all', 'data-turbolinks-track': 'reload' %>
|
||||||
<%= javascript_include_tag 'addorder', 'data-turbolinks-track': 'reload' %>
|
<%= javascript_include_tag 'addorder', 'data-turbolinks-track': 'reload' %>
|
||||||
<div id="oqs_loading_wrapper" style="display:none;">
|
<div id="oqs_loading_wrapper" style="display:none;">
|
||||||
@@ -10,8 +11,9 @@
|
|||||||
<input type="hidden" name="type" id="modify_order" value="<%=modify_order%>">
|
<input type="hidden" name="type" id="modify_order" value="<%=modify_order%>">
|
||||||
<div class="row m-t--20">
|
<div class="row m-t--20">
|
||||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||||
<a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
|
<!-- <a href="javascript:void(0);" class="dropdown-toggle waves-block p-t-15 p-l-15 p-b-15" data-toggle="dropdown" aria-haspopup="" aria-expanded="true" style="background-color: #eeeeee;border-bottom: .214rem solid #fff;border-left: 1px solid #54A5AF;
|
||||||
<span class="main_menu p-l-15 p-t-20" id="main_menu"><%= @menus[0].name %></span>
|
border-right: 1px solid #54A5AF;">
|
||||||
|
<span class="main_menu" id="main_menu" ><%= @menus[0].name %></span>
|
||||||
</a>
|
</a>
|
||||||
<ul class="dropdown-menu menu_list" style="width:90%">
|
<ul class="dropdown-menu menu_list" style="width:90%">
|
||||||
<% @menus.each do |menu| %>
|
<% @menus.each do |menu| %>
|
||||||
@@ -19,7 +21,21 @@
|
|||||||
<a class="nav-link" data-toggle="tab" href="" role="tab"><%=menu.name%></a>
|
<a class="nav-link" data-toggle="tab" href="" role="tab"><%=menu.name%></a>
|
||||||
</li>
|
</li>
|
||||||
<%end%>
|
<%end%>
|
||||||
</ul>
|
</ul> -->
|
||||||
|
<li class="list-menu">
|
||||||
|
<a href="javascript:void(0);" class="menu-toggle dropdown-toggle toggled my-toggle " style="">
|
||||||
|
|
||||||
|
<span class="main_menu" id="main_menu" ><%= @menus[0].name %></span>
|
||||||
|
<!-- <i class="material-icons material-icons m-l-50 p-r-30">arrow_drop_down</i> -->
|
||||||
|
</a>
|
||||||
|
<ul class="ml-menu menu_list aria-hidden " style="">
|
||||||
|
<% @menus.each do |menu| %>
|
||||||
|
<li class="nav-item menu_click" data-name="<%=menu.name%>" data-id="<%=menu.id%>" style="">
|
||||||
|
<a class="nav-link" data-toggle="tab" href="" role="tab" style="text-transform: lowercase;"><%=menu.name%></a>
|
||||||
|
</li>
|
||||||
|
<%end%>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
<ul class="nav nav-tabs flex-column category_list" role="tablist" id="ul-navbar">
|
<ul class="nav nav-tabs flex-column category_list" role="tablist" id="ul-navbar">
|
||||||
<li class="nav-item product" data-ref="<%= origami_get_all_product_path %>">
|
<li class="nav-item product" data-ref="<%= origami_get_all_product_path %>">
|
||||||
<a class="nav-link" data-toggle="tab" href="" role="tab">Products</a>
|
<a class="nav-link" data-toggle="tab" href="" role="tab">Products</a>
|
||||||
|
|||||||
Reference in New Issue
Block a user