update table box

This commit is contained in:
Aung Myo
2018-02-06 09:52:27 +06:30
parent 76a094972e
commit 85020d91bf
15 changed files with 173 additions and 79 deletions

View File

@@ -42,6 +42,8 @@
</div>
<input type="hidden" name="table_id" value="<%=@dining_facility.id%>">
<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} %>
@@ -145,6 +147,7 @@
</div>
<script type="text/javascript">
var cashier_type = "<%= @cashier_type %>";
$(document).ready(function(){
//click add button for new row
$('#addForeigner').on('click',function(){
@@ -223,17 +226,21 @@
return false;
}
});
// click back button for redirect
$('#back').on('click',function(){
table_type = '<%=@table_type%>';
table_id = '<%=@dining_facility.id%>';
if (cashier_type == "quick_service") {
window.location.href = '/origami/sale/<%= @id %>/<%= @cashier_type %>/payment/';
}else{
if(table_type == "Table"){
window.location.href = "/origami/table/" + table_id
}
else {
window.location.href = "/origami/room/" + table_id
}
}
});
});