update add order for menu and void foc for no table
This commit is contained in:
@@ -209,3 +209,35 @@ i.logout_icon{
|
||||
.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
|
||||
|
||||
table_avaliable = true
|
||||
table_count = 0
|
||||
table = sale.bookings[0].dining_facility
|
||||
table.bookings.each do |booking|
|
||||
if booking.booking_status != 'moved'
|
||||
if booking.sale_id
|
||||
if booking.sale.sale_status != 'completed' && booking.sale.sale_status != 'void'
|
||||
if sale.bookings[0].dining_facility_id.to_i > 0
|
||||
table_avaliable = true
|
||||
table_count = 0
|
||||
table = sale.bookings[0].dining_facility
|
||||
table.bookings.each do |booking|
|
||||
if booking.booking_status != 'moved'
|
||||
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_count += 1
|
||||
else
|
||||
table_avaliable = true
|
||||
end
|
||||
else
|
||||
table_avaliable = false
|
||||
table_count += 1
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if table_avaliable && table_count == 0
|
||||
table.status = 'available'
|
||||
table.save
|
||||
if table_avaliable && table_count == 0
|
||||
table.status = 'available'
|
||||
table.save
|
||||
end
|
||||
else
|
||||
table = nil
|
||||
end
|
||||
|
||||
# FOr Sale Audit
|
||||
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" )
|
||||
|
||||
# For Print
|
||||
@@ -78,13 +86,21 @@ class Origami::VoidController < BaseOrigamiController
|
||||
bookings = Booking.where("sale_id='#{sale_id}'")
|
||||
if bookings.count > 1
|
||||
# for Multiple Booking
|
||||
table = DiningFacility.find(bookings[0].dining_facility_id)
|
||||
else
|
||||
table = DiningFacility.find(bookings[0].dining_facility_id)
|
||||
if bookings[0].dining_facility_id.to_i>0
|
||||
table = DiningFacility.find(bookings[0].dining_facility_id)
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
cashier_zone = CashierTerminalByZone.find_by_zone_id(table.zone_id)
|
||||
cashier_terminal = CashierTerminal.find(cashier_zone.cashier_terminal_id)
|
||||
if bookings[0].dining_facility_id.to_i > 0
|
||||
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
|
||||
unique_code = "ReceiptBillPdf"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
<%= stylesheet_link_tag 'addorder', media: 'all', 'data-turbolinks-track': 'reload' %>
|
||||
<%= javascript_include_tag 'addorder', 'data-turbolinks-track': 'reload' %>
|
||||
<div id="oqs_loading_wrapper" style="display:none;">
|
||||
@@ -10,8 +11,9 @@
|
||||
<input type="hidden" name="type" id="modify_order" value="<%=modify_order%>">
|
||||
<div class="row m-t--20">
|
||||
<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">
|
||||
<span class="main_menu p-l-15 p-t-20" id="main_menu"><%= @menus[0].name %></span>
|
||||
<!-- <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;
|
||||
border-right: 1px solid #54A5AF;">
|
||||
<span class="main_menu" id="main_menu" ><%= @menus[0].name %></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu menu_list" style="width:90%">
|
||||
<% @menus.each do |menu| %>
|
||||
@@ -19,7 +21,21 @@
|
||||
<a class="nav-link" data-toggle="tab" href="" role="tab"><%=menu.name%></a>
|
||||
</li>
|
||||
<%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">
|
||||
<li class="nav-item product" data-ref="<%= origami_get_all_product_path %>">
|
||||
<a class="nav-link" data-toggle="tab" href="" role="tab">Products</a>
|
||||
|
||||
Reference in New Issue
Block a user