Merge branch 'quick_service'

This commit is contained in:
Aung Myo
2018-03-05 13:56:23 +06:30
11 changed files with 75 additions and 167 deletions

View File

@@ -1,4 +1,3 @@
<%= 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;">
@@ -7,8 +6,6 @@
<% type = request.path_info.include?('quick_service')%>
<% modify_order = request.path_info.include?('modify_order')%>
<input type="hidden" name="type" id="type" value="<%=type%>">
<input type="hidden" name="type" id="modify_order" value="<%=modify_order%>">
<input type="hidden" name="type" id="role" value="<%= current_user.role%>">
<div class="row m-t--20">
@@ -51,7 +48,7 @@
<li class="nav-item menu_category sub_click first_<%=menu.id%>" data-id="<%=menu.id%>">
<p class="hidden menu-id"><%= menu.id %></p>
<a class="nav-link" data-toggle="tab" href="" role="tab"> <%= menu.name%>
<ul class=" sub_category_list hidden fadeInTop animated" id="sub_category_list">
<ul class="sub_category_list hidden fadeInTop animated" id="sub_category_list">
</ul>
</a>
</li>
@@ -184,7 +181,7 @@
<% end%>
<p class="hidden" id="booking_id"><%=@booking_id%></p>
<p class="hidden" id="customer_id"><%=@customer ? @customer.customer_id : ''%></p>
<p class="hidden" id="customer_id"><%=@customer ? @customer.customer_id : '---'%></p>
<p class="hidden" id="sale_id"><%=@sale_id%></p>
<% else%>
<p class="hidden" id="table_type"></p>

View File

@@ -1,111 +0,0 @@
<div class="row">
<div class="col-lg-11 col-md-11 col-sm-11">
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item">
<a class="nav-link active" data-toggle="tab" href="#table" role="tab">Tables</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#room" role="tab">Rooms</a>
</li>
</ul>
<div class="tab-content" style="max-height:650px; overflow:auto">
<div class="tab-pane active" id="table" role="tabpanel" style="max-height:; overflow:auto">
<% @tables.each do |zone| %>
<h3>Zone : <%=zone.zone.name%></h3>
<div class="card-columns" style="padding-top:10px; column-gap: 2.2rem;">
<% @all_table.each do |table| %>
<% if zone.zone_id == table.zone_id %>
<div class="card click_table <%= table.status=="available" ? "available" : "occupied"%>" data-id = "<%= table.id %>">
<div class="card-block">
<p class="hidden table-status"><%= table.status %></p>
<p style="text-align: center"><%= table.name %></p>
<p style="text-align: center">Seat : <%= table.seater %></p>
</div>
</div>
<% end %> <% end %>
</div>
<% end %>
</div>
<div class="tab-pane" id="room" role="tabpanel" style="max-height:; overflow:auto">
<% @rooms.each do |zone| %>
<h3>Zone : <%=zone.zone.name%></h3>
<div class="card-columns" style="padding-top:10px; column-gap: 2.2rem;">
<% @all_room.each do |room| %>
<% if zone.zone_id == room.zone_id %>
<div class="card click_table <%= room.status=="available" ? "available" : "occupied"%>" data-id = "<%= room.id %>">
<div class="card-block">
<p class="hidden table-status"><%= room.status %></p>
<p style="text-align: center"><%= room.name %></p>
<p style="text-align: center">Seat : <%= room.seater %></p>
</div>
</div>
<% end %> <% end %>
</div>
<% end %>
</div>
</div>
</div>
<div class="col-lg-1 col-md-1 col-sm-1">
<button type="button" class="btn btn-block btn-default waves-effect" id='back'>
<i class="material-icons">reply</i>
Back
</button>
</div>
</div>
<script>
$(document).on('click',".click_table",function(){
var dining_id = $(this).attr('data-id');
var status = $(this).find(".table-status").text();
if (status == "available") {
$.confirm({
title: 'Confirmation !',
content: 'Are you sure to assign this table',
buttons: {
confirm: {
text: 'Ok',
btnClass: 'btn-green',
action: function(){
window.location.href = '/origami/addorders/'+dining_id;
}
}
}
});
} else {
$.confirm({
title: 'Alert!',
content: 'You cannot assign this table',
buttons: {
confirm: {
text: 'Ok',
btnClass: 'btn-red',
}
}
});
}
})
</script>
<style type="text/css">
.card-columns {
-webkit-column-count:5;
-moz-column-count:5;
column-count:5;
}
.occupied{
color: #fff !important;
background-color: red;
}
.available{
color: #fff !important;
background-color: #009900;
}
</style>

View File

@@ -320,10 +320,10 @@
</div>
</div>
<div class="col-lg-1 col-md-1 col-sm-1 col-xs-1">
<button type="button" class="btn btn-block btn-default waves-effect" id='back'>
<i class="material-icons">reply</i>
Back
</button>
<button type="button" class="btn btn-block btn-default waves-effect" id='back'>
<i class="material-icons">reply</i>
Back
</button>
<button type="button" class="btn bg-deep-purple btn-block" data-toggle="modal" data-target="#focModal" <%= (can? :foc, :payment)? ' ': 'disabled=' %> active="true"> FOC </button>
<button type="button" class="btn bg-red btn-block" data-toggle="modal" data-target="#voidModal" <%= (can? :overall_void, :void)? ' ': 'disabled=' %> > Void </button>
<% if @cashier_type=="quick_service" %>
@@ -771,7 +771,7 @@ console.log("fffffffffffff")
var cash = $('#grand_total').text();
var sub_total = $('#sub-total').text();
var sale_id = $('#sale_id').text();
var params = { 'cash':cash,'sale_id':sale_id,'sub_total':sub_total,'remark':remark };
var params = { 'cash':cash,'sale_id':sale_id,'sub_total':sub_total,'remark':remark,'type':cashier_type };
if ($(this).attr('active')=== "true") {
swal({
@@ -794,7 +794,11 @@ console.log("fffffffffffff")
title: "Information!",
text: 'Thank You !',
}, function () {
window.location.href = '/origami';
if (cashier_type=="cashier") {
window.location.href = '/origami';
}else{
window.location.href = '/origami/quick_service';
}
});
}
}

View File

@@ -153,7 +153,7 @@
<% if current_user.role != "waiter" || @status != "sale"%>
<button type="button" id="addorder" class="btn bg-blue btn-block">Add Order</button>
<%end%>
<% if current_user.role != "waiter"%>
<% if current_user.role != "waiter" && @status != "order"%>
<button type="button" id="pay" class="btn bg-blue btn-block">Pay</button>
<%end%>
<% if @status != "sale"%>