update no table quick srevice

This commit is contained in:
Aung Myo
2018-02-14 18:21:10 +06:30
parent 9757c34a09
commit 47ffc5fa51
12 changed files with 173 additions and 90 deletions

View File

@@ -32,7 +32,6 @@
<div class="col-lg-5 col-md-5 col-sm-5 col-xs-12">
<input type="text" name="filter" style="margin-right:10px" id="search" placeholder="Search" class="form-control input-sm col-md-12">
<!-- <input type="hidden" name="type" id="type" value="<%= @dining_facility.type %>"> -->
</div>
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-12">
@@ -115,8 +114,13 @@
<span class="patch_method"></span>
<input type="hidden" id="sale_id" name="sale_id" value="<%= @sale_id %>" />
<%if !@dining_facility.nil?%>
<input type="hidden" id="table_id" name="table_id" value="<%= @dining_facility.id %>" />
<input type="hidden" id="type" name="type" value="<%= @dining_facility.type %>" />
<%else%>
<input type="hidden" id="table_id" name="table_id" value="" />
<input type="hidden" id="type" name="type" value="" />
<%end%>
<%= f.error_notification %>
<%= f.hidden_field :id, :class => "form-control col-md-6 " %>
<div class="form-group">
@@ -417,6 +421,7 @@
if(customer_name != ""){
customer = '(' + customer_name + ')';
}
swal({
title: "Confirmation !",
text: 'Are You Sure to assign this customer' + customer + '!',
@@ -437,7 +442,6 @@
var id = $("#table_id").val();
var type = $("#type").val();
if (cashier_type == "quick_service") {
window.location.href = '/origami/table/'+id
window.location.href = '/origami/sale/'+sale_id+'/'+cashier_type+'/payment/';
}else{
if (type=="Table") {
@@ -458,11 +462,17 @@
$('#back').on('click',function(){
var id = $("#table_id").val()
var type = $("#type").val()
if (type=="Table") {
window.location.href = '/origami/table/'+id
var sale_id = $("#sale_id").val()
if (cashier_type == "quick_service") {
window.location.href = '/origami/sale/'+sale_id+'/'+cashier_type+'/payment/';
}else{
window.location.href = '/origami/room/'+id
}
if (type=="Table") {
window.location.href = '/origami/table/'+id
}else{
window.location.href = '/origami/room/'+id
}
}
})
</script>

View File

@@ -197,7 +197,11 @@
<div class="col-lg-1 col-md-1 col-sm-1">
<!-- Action Panel -->
<div>
<button type="button" class="btn bg-default btn-block" onclick="window.location.href = '/origami/<%=@table.type.downcase%>/<%=@table.id%>'"><i class="material-icons">reply</i> Back </button>
<%if !@table.nil?%>
<button type="button" class="btn bg-default btn-block" onclick="window.location.href = '/origami/<%=@table.type.downcase%>/<%=@table.id%>'"><i class="material-icons">reply</i> Back </button>
<%else%>
<button type="button" class="btn bg-default btn-block" onclick="window.location.href = '/origami/sale/<%=@sale_data.sale_id%>/<%=@cashier_type%>/payment'"><i class="material-icons">reply</i> Back </button>
<%end%>
<button id="charge_other" class="btn bg-primary btn-block action-btn">Enter</button>
</div>
</div>

View File

@@ -41,10 +41,18 @@
</div>
<input type="hidden" name="table_id" value="<%=@dining_facility.id%>">
<%if !@dining_facility.nil?%>
<input type="hidden" name="table_id" value="<%= @dining_facility.id %>">
<input type="hidden" name="table_type" value="<%= @table_type %>">
<%= f.input :dining_name, :as => :hidden, :input_html => { :value => @dining_facility.name } %>
<%else%>
<input type="hidden" name="table_id" value="0">
<input type="hidden" name="table_type" value="0">
<%= f.input :dining_name, :as => :hidden, :input_html => { :value => 0 } %>
<%end%>
<input type="hidden" name="sale_id" value="<%=@id%>">
<input type="hidden" name="cashier_type" value="<%=@cashier_type%>">
<%= f.input :dining_name, :as => :hidden, :input_html => { :value => @dining_facility.name } %>
<%= f.input :created_by, :as => :hidden, :input_html => { :value => current_login_employee.name } %>
<%= f.input :receipt_no, :as => :hidden, :input_html => { :value => @receipt_no} %>
<%= f.input :total_amount, :as => :hidden, :input_html => { :value => @grand_total } %>
@@ -228,8 +236,8 @@ var cashier_type = "<%= @cashier_type %>";
});
// click back button for redirect
$('#back').on('click',function(){
table_type = '<%=@table_type%>';
table_id = '<%=@dining_facility.id%>';
table_type = $('#table_type').val()
table_id = $('#table_id').val()
if (cashier_type == "quick_service") {
window.location.href = '/origami/sale/<%= @id %>/<%= @cashier_type %>/payment/';

View File

@@ -1,12 +1,3 @@
<!-- <div class="page-header">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= '/origami/table/@dining_facility.id' %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.survey") %></li>
<span class="float-right">
<%= link_to t('.back',:default => t("views.btn.back")),'/origami/table/'+@dining_facility.id.to_s %>
</span>
</ol>
</div> -->
<%= render 'form', survey: @survey %>