move whole table
This commit is contained in:
37
app/controllers/origami/moveroom_controller.rb
Normal file
37
app/controllers/origami/moveroom_controller.rb
Normal file
@@ -0,0 +1,37 @@
|
||||
class Origami::MoveroomController < BaseOrigamiController
|
||||
|
||||
def move_dining
|
||||
@tables = Table.all.active.order('status desc')
|
||||
@rooms = Room.all.active.order('status desc')
|
||||
@complete = Sale.all
|
||||
@orders = Order.all.order('date desc')
|
||||
|
||||
@status_order = ""
|
||||
@dining = DiningFacility.find(params[:dining_id])
|
||||
@dining.bookings.each do |booking|
|
||||
if booking.sale_id.nil?
|
||||
@order_items = Array.new
|
||||
booking.booking_orders.each do |booking_order|
|
||||
order = Order.find(booking_order.order_id)
|
||||
@obj_order = order
|
||||
@date = order.created_at
|
||||
order.order_items.each do |item|
|
||||
@order_items.push(item)
|
||||
end
|
||||
end
|
||||
@status_order = 'order'
|
||||
else
|
||||
sale = Sale.find(booking.sale_id)
|
||||
if sale.sale_status != "completed"
|
||||
if @status_order == 'order'
|
||||
@status_order = 'sale'
|
||||
end
|
||||
@date = sale.created_at
|
||||
@status_sale = 'sale'
|
||||
@obj_sale = sale
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
49
app/controllers/origami/movetable_controller.rb
Normal file
49
app/controllers/origami/movetable_controller.rb
Normal file
@@ -0,0 +1,49 @@
|
||||
class Origami::MovetableController < BaseOrigamiController
|
||||
|
||||
def move_dining
|
||||
@tables = Table.all.active.order('status desc')
|
||||
@rooms = Room.all.active.order('status desc')
|
||||
@complete = Sale.all
|
||||
@orders = Order.all.order('date desc')
|
||||
|
||||
@status_order = ""
|
||||
@dining = DiningFacility.find(params[:dining_id])
|
||||
@dining.bookings.each do |booking|
|
||||
if booking.sale_id.nil?
|
||||
@order_items = Array.new
|
||||
booking.booking_orders.each do |booking_order|
|
||||
order = Order.find(booking_order.order_id)
|
||||
@obj_order = order
|
||||
@date = order.created_at
|
||||
order.order_items.each do |item|
|
||||
@order_items.push(item)
|
||||
end
|
||||
end
|
||||
@status_order = 'order'
|
||||
else
|
||||
sale = Sale.find(booking.sale_id)
|
||||
if sale.sale_status != "completed"
|
||||
if @status_order == 'order'
|
||||
@status_order = 'sale'
|
||||
end
|
||||
@date = sale.created_at
|
||||
@status_sale = 'sale'
|
||||
@obj_sale = sale
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def moving
|
||||
change_to = params[:change_to] #new
|
||||
change_from = params[:change_from] #original
|
||||
bookings = Booking.where('dining_facility_id=?',change_from)
|
||||
booking_array = Array.new
|
||||
bookings.each do | booking |
|
||||
if booking.sale_id.nil? || booking.sale.sale_status != 'completed'
|
||||
booking_array.push(booking)
|
||||
end
|
||||
end
|
||||
@get_type = Booking.update_dining_facility(booking_array,change_to,change_from)
|
||||
end
|
||||
end
|
||||
@@ -10,6 +10,19 @@ class Booking < ApplicationRecord
|
||||
has_many :booking_orders
|
||||
has_many :orders, :through => :booking_orders
|
||||
|
||||
def self.update_dining_facility(booking_arr, newd, old)
|
||||
booking_arr.each do |booking|
|
||||
booking.dining_facility_id = newd
|
||||
booking.save
|
||||
end
|
||||
new_dining = DiningFacility.find(newd)
|
||||
new_dining.make_occupied
|
||||
old_dining = DiningFacility.find(old)
|
||||
old_dining.make_available
|
||||
|
||||
return new_dining.type
|
||||
end
|
||||
|
||||
private
|
||||
def generate_custom_id
|
||||
self.booking_id = SeedGenerator.generate_id(self.class.name, "BKI")
|
||||
|
||||
@@ -8,6 +8,16 @@ class DiningFacility < ApplicationRecord
|
||||
|
||||
scope :active, -> {where(is_active: true)}
|
||||
|
||||
def make_available
|
||||
self.status = 'available'
|
||||
self.save
|
||||
end
|
||||
|
||||
def make_occupied
|
||||
self.status = 'occupied'
|
||||
self.save
|
||||
end
|
||||
|
||||
def get_current_booking
|
||||
puts "enter booking"
|
||||
booking = Booking.where("dining_facility_id = #{self.id} and booking_status ='assign' and checkin_at between '#{DateTime.now.utc - 5.hours}' and '#{DateTime.now.utc}' and checkout_at is null").limit(1)
|
||||
|
||||
@@ -228,12 +228,12 @@
|
||||
<!-- Column Three -->
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<!-- Waiter Buttons -->
|
||||
<button type="button" class="btn btn-primary btn-block" >Back</button>
|
||||
<button type="button" class="btn btn-primary btn-block" id='back' >Back</button>
|
||||
<button type="button" class="btn btn-primary btn-block" disabled>Add Order</button>
|
||||
<button type="button" class="btn btn-primary btn-block" disabled>Edit</button>
|
||||
<button type="button" class="btn btn-primary btn-block" disabled>Move</button>
|
||||
<button type="button" class="btn btn-primary btn-block" id='move'>Move</button>
|
||||
<button type="button" id="customer" class="btn btn-primary btn-block" >Customer</button>
|
||||
<% if @status == 'order' %>
|
||||
<% if @status_order == 'order' %>
|
||||
<button type="button" id="request_bills" class="btn btn-primary btn-block">Req.Bill</button>
|
||||
<button type="button" id="pay" class="btn btn-primary btn-block" disabled>Pay</button>
|
||||
<% else %>
|
||||
@@ -282,4 +282,13 @@ $('#request_bills').click(function() {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#move').on('click',function(){
|
||||
var dining_id = "<%= @dining.id %>"
|
||||
window.location.href = '/origami/table/'+ dining_id + "/movetable";
|
||||
})
|
||||
|
||||
$('#back').on('click',function(){
|
||||
window.location.href = '/origami/';
|
||||
})
|
||||
</script>
|
||||
|
||||
207
app/views/origami/moveroom/move_dining.html.erb
Normal file
207
app/views/origami/moveroom/move_dining.html.erb
Normal file
@@ -0,0 +1,207 @@
|
||||
<div class="row">
|
||||
<!-- Column One -->
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
|
||||
<!-- Nav tabs -->
|
||||
<ul class="nav nav-tabs" role="tablist" id="mytab">
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link " data-toggle="tab" href="#tables" role="tab">Tables</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" data-toggle="tab" href="#rooms" role="tab">Rooms</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<!-- Nav tabs - End -->
|
||||
|
||||
<div class="tab-content" style="max-height:670px; overflow:auto">
|
||||
<!--- Panel 0 - Completed Orders -->
|
||||
|
||||
|
||||
<!--- Panel 1 - Table Orders -->
|
||||
<div class="tab-pane " id="tables" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @tables.each do |table| %>
|
||||
<% if table.status == 'occupied' %>
|
||||
<div class="card tables red text-white" data-id="<%= table.id %>" data-name="<%= table.name %>">
|
||||
<div class="card-block">
|
||||
<%= table.name %>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="card tables green text-white" data-id="<%= table.id %>" data-name="<%= table.name %>">
|
||||
<div class="card-block">
|
||||
<%= table.name %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--- Panel 2 - Room Orders -->
|
||||
<div class="tab-pane active" id="rooms" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @rooms.each do |room| %>
|
||||
<% if room.status == 'occupied' %>
|
||||
<div class="card rooms red text-white" data-id="<%= room.id %>" data-name="<%= room.name %>">
|
||||
<div class="card-block">
|
||||
<%= room.name %>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="card rooms green text-white" data-id="<%= room.id %>" data-name="<%= room.name %>">
|
||||
<div class="card-block">
|
||||
<%= room.name %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--- Panel 3 - s -->
|
||||
|
||||
|
||||
</div>
|
||||
<!-- tabs - End -->
|
||||
</div>
|
||||
<!-- Column One -->
|
||||
|
||||
<!-- Column Two -->
|
||||
<div class="col-lg-5 col-md-5 col-sm-5">
|
||||
<div class="card" >
|
||||
<div class="card-header">
|
||||
<div><strong id="order-title"> MOVE --> <span style='color:red'>' <%= @dining.name %>' </span> to <span style='color:blue' id="moved"> </span></strong></div>
|
||||
<input type='hidden' id="change_table_value" value="" />
|
||||
</div>
|
||||
<div class="card-block">
|
||||
<div class="card-title row">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
<p> Receipt No: <span id="receipt_no">
|
||||
<% if @status_sale == 'sale' %>
|
||||
<%= @obj_sale.receipt_no rescue '' %>
|
||||
<% end %>
|
||||
</span></p>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 text-right">
|
||||
<p>Date: <span id="receipt_date"><%= @date.utc.strftime("%d/%m/%Y - %I:%M %p") rescue '-'%></span></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-title row customer_detail hide">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
<p>Customer : <span id="customer_name"></span></p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="card-text">
|
||||
<table class="table table-striped" id="order-items-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="item-name">Items</th>
|
||||
<th class="item-attr">QTY</td>
|
||||
<th class="item-attr">Price</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<%
|
||||
sub_total = 0
|
||||
if @status_sale == "sale"
|
||||
@obj_sale.sale_items.each do |sale_item|
|
||||
sub_total = sub_total + sale_item.price
|
||||
%>
|
||||
<input type="hidden" id="sale_id" value="<%= @obj_sale.sale_id %>">
|
||||
<% unless sale_item.price <= 0 %>
|
||||
<tr>
|
||||
<td class='item-name'><%= sale_item.product_name %></td>
|
||||
<td class='item-attr'><%= sale_item.qty %></td>
|
||||
<td class='item-attr'><%= sale_item.price %></td>
|
||||
</tr>
|
||||
<%
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if @status_order == 'order'
|
||||
unless @order_items.nil?
|
||||
@order_items.each do |order_item |
|
||||
sub_total = sub_total + order_item.price
|
||||
|
||||
unless order_item.price <= 0 %>
|
||||
<tr>
|
||||
<td class='item-name'><%= order_item.item_name %></td>
|
||||
<td class='item-attr'><%= order_item.qty %></td>
|
||||
<td class='item-attr'><%= order_item.qty*order_item.price %></td>
|
||||
</tr>
|
||||
<%
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
%>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="pay purple" id="move_table">MOVE TABLE</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Column Three -->
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<!-- Waiter Buttons -->
|
||||
<button type="button" class="btn btn-primary btn-block" id='back'>Back</button>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$(".tables").on('click', function(){
|
||||
$('.tables').removeClass('selected-item');
|
||||
$(this).addClass('selected-item');
|
||||
var dining_name = $(this).attr("data-name");
|
||||
var dining_id = $(this).attr("data-id");
|
||||
$('#moved').text(" ' " + dining_name + " ' ")
|
||||
$('#change_table_value').val(dining_id);
|
||||
})
|
||||
|
||||
$(".rooms").on('click', function(){
|
||||
$('.rooms').removeClass('selected-item');
|
||||
$(this).addClass('selected-item');
|
||||
var dining_name = $(this).attr("data-name");
|
||||
var dining_id = $(this).attr("data-id");
|
||||
$('#moved').text(dining_name)
|
||||
$('#change_table_value').val(dining_id);
|
||||
})
|
||||
|
||||
$('#move_table').on('click',function(){
|
||||
change_to = $('#change_table_value').val();
|
||||
change_from = "<%= @dining.id %>";
|
||||
if (change_to == ""){
|
||||
alert("Please Select Room")
|
||||
}else{
|
||||
$.ajax({type: "POST",
|
||||
url: "<%= origami_moving_path %>",
|
||||
data: "change_from="+ change_from + "&change_to=" + change_to,
|
||||
success:function(result){
|
||||
alert("Moving Success")
|
||||
if (result.get_type == 'Table'){
|
||||
window.location.href = '/origami/table/' + change_to;
|
||||
}else{
|
||||
window.location.href = '/origami/room/' + change_to;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
});
|
||||
$('#back').on('click',function(){
|
||||
window.location.href = '/origami/room/'+ "<%= @dining.id %>";
|
||||
})
|
||||
</script>
|
||||
207
app/views/origami/movetable/move_dining.html.erb
Normal file
207
app/views/origami/movetable/move_dining.html.erb
Normal file
@@ -0,0 +1,207 @@
|
||||
<div class="row">
|
||||
<!-- Column One -->
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
|
||||
<!-- Nav tabs -->
|
||||
<ul class="nav nav-tabs" role="tablist" id="mytab">
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" data-toggle="tab" href="#tables" role="tab">Tables</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#rooms" role="tab">Rooms</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<!-- Nav tabs - End -->
|
||||
|
||||
<div class="tab-content" style="max-height:670px; overflow:auto">
|
||||
<!--- Panel 0 - Completed Orders -->
|
||||
|
||||
|
||||
<!--- Panel 1 - Table Orders -->
|
||||
<div class="tab-pane active" id="tables" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @tables.each do |table| %>
|
||||
<% if table.status == 'occupied' %>
|
||||
<div class="card tables red text-white" data-id="<%= table.id %>" data-name="<%= table.name %>">
|
||||
<div class="card-block">
|
||||
<%= table.name %>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="card tables green text-white" data-id="<%= table.id %>" data-name="<%= table.name %>">
|
||||
<div class="card-block">
|
||||
<%= table.name %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--- Panel 2 - Room Orders -->
|
||||
<div class="tab-pane" id="rooms" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @rooms.each do |room| %>
|
||||
<% if room.status == 'occupied' %>
|
||||
<div class="card rooms red text-white" data-id="<%= room.id %>" data-name="<%= room.name %>">
|
||||
<div class="card-block">
|
||||
<%= room.name %>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="card rooms green text-white" data-id="<%= room.id %>" data-name="<%= room.name %>">
|
||||
<div class="card-block">
|
||||
<%= room.name %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--- Panel 3 - s -->
|
||||
|
||||
|
||||
</div>
|
||||
<!-- tabs - End -->
|
||||
</div>
|
||||
<!-- Column One -->
|
||||
|
||||
<!-- Column Two -->
|
||||
<div class="col-lg-5 col-md-5 col-sm-5">
|
||||
<div class="card" >
|
||||
<div class="card-header">
|
||||
<div><strong id="order-title"> MOVE --> <span style='color:red'> ' <%= @dining.name %> ' </span> to <span style='color:blue' id="moved"> </span></strong></div>
|
||||
<input type='hidden' id="change_table_value" value="" />
|
||||
</div>
|
||||
<div class="card-block">
|
||||
<div class="card-title row">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
<p> Receipt No: <span id="receipt_no">
|
||||
<% if @status_sale == 'sale' %>
|
||||
<%= @obj_sale.receipt_no rescue '' %>
|
||||
<% end %>
|
||||
</span></p>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 text-right">
|
||||
<p>Date: <span id="receipt_date"><%= @date.utc.strftime("%d/%m/%Y - %I:%M %p") rescue '-'%></span></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-title row customer_detail hide">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
<p>Customer : <span id="customer_name"></span></p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="card-text">
|
||||
<table class="table table-striped" id="order-items-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="item-name">Items</th>
|
||||
<th class="item-attr">QTY</td>
|
||||
<th class="item-attr">Price</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<%
|
||||
sub_total = 0
|
||||
if @status_sale == "sale"
|
||||
@obj_sale.sale_items.each do |sale_item|
|
||||
sub_total = sub_total + sale_item.price
|
||||
%>
|
||||
<input type="hidden" id="sale_id" value="<%= @obj_sale.sale_id %>">
|
||||
<% unless sale_item.price <= 0 %>
|
||||
<tr>
|
||||
<td class='item-name'><%= sale_item.product_name %></td>
|
||||
<td class='item-attr'><%= sale_item.qty %></td>
|
||||
<td class='item-attr'><%= sale_item.price %></td>
|
||||
</tr>
|
||||
<%
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if @status_order == 'order'
|
||||
unless @order_items.nil?
|
||||
@order_items.each do |order_item |
|
||||
sub_total = sub_total + order_item.price
|
||||
|
||||
unless order_item.price <= 0 %>
|
||||
<tr>
|
||||
<td class='item-name'><%= order_item.item_name %></td>
|
||||
<td class='item-attr'><%= order_item.qty %></td>
|
||||
<td class='item-attr'><%= order_item.qty*order_item.price %></td>
|
||||
</tr>
|
||||
<%
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
%>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="pay purple" id="move_table">MOVE TABLE</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Column Three -->
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<!-- Waiter Buttons -->
|
||||
<button type="button" class="btn btn-primary btn-block" id='back'>Back</button>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$(".tables").on('click', function(){
|
||||
$('.tables').removeClass('selected-item');
|
||||
$(this).addClass('selected-item');
|
||||
var dining_name = $(this).attr("data-name");
|
||||
var dining_id = $(this).attr("data-id");
|
||||
$('#moved').text(" ' " + dining_name + " ' ")
|
||||
$('#change_table_value').val(dining_id);
|
||||
})
|
||||
|
||||
$(".rooms").on('click', function(){
|
||||
$('.rooms').removeClass('selected-item');
|
||||
$(this).addClass('selected-item');
|
||||
var dining_name = $(this).attr("data-name");
|
||||
var dining_id = $(this).attr("data-id");
|
||||
$('#moved').text(dining_name)
|
||||
$('#change_table_value').val(dining_id);
|
||||
})
|
||||
|
||||
$('#move_table').on('click',function(){
|
||||
change_to = $('#change_table_value').val();
|
||||
change_from = "<%= @dining.id %>";
|
||||
if (change_to == ""){
|
||||
alert("Please Select Table")
|
||||
}else{
|
||||
$.ajax({type: "POST",
|
||||
url: "<%= origami_moving_path %>",
|
||||
data: "change_from="+ change_from + "&change_to=" + change_to,
|
||||
success:function(result){
|
||||
alert("Moving Success")
|
||||
if (result.get_type == 'Table'){
|
||||
window.location.href = '/origami/table/' + change_to;
|
||||
}else{
|
||||
window.location.href = '/origami/room/' + change_to;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
});
|
||||
$('#back').on('click',function(){
|
||||
window.location.href = '/origami/table/'+ "<%= @dining.id %>";
|
||||
})
|
||||
</script>
|
||||
2
app/views/origami/movetable/moving.json.jbuilder
Normal file
2
app/views/origami/movetable/moving.json.jbuilder
Normal file
@@ -0,0 +1,2 @@
|
||||
json.status true
|
||||
json.get_type @get_type
|
||||
@@ -164,7 +164,7 @@
|
||||
|
||||
<!-- Column Three -->
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<button type="button" class="btn btn-primary btn-block" >Back</button>
|
||||
<button type="button" class="btn btn-primary btn-block" id='back'>Back</button>
|
||||
<button type="button" id="re-print" class="btn btn-primary btn-block">Re.Print</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -191,4 +191,7 @@ $('#pay').on('click',function() {
|
||||
var sale_id = $('#sale_id').val();
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment";
|
||||
});
|
||||
$('#back').on('click',function(){
|
||||
window.location.href = '/origami/';
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -228,10 +228,10 @@
|
||||
<!-- Column Three -->
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<!-- Waiter Buttons -->
|
||||
<button type="button" class="btn btn-primary btn-block" >Back</button>
|
||||
<button type="button" class="btn btn-primary btn-block" id='back' >Back</button>
|
||||
<button type="button" class="btn btn-primary btn-block" disabled>Add Order</button>
|
||||
<button type="button" class="btn btn-primary btn-block" disabled>Edit</button>
|
||||
<button type="button" class="btn btn-primary btn-block" disabled>Move</button>
|
||||
<button type="button" class="btn btn-primary btn-block" id="move">Move</button>
|
||||
<button type="button" id="customer" class="btn btn-primary btn-block">Customer</button>
|
||||
<button type="button" id="request_bills" class="btn btn-primary btn-block">Req.Bill</button>
|
||||
<!-- Cashier Buttons -->
|
||||
@@ -264,4 +264,11 @@ $('#pay').on('click',function() {
|
||||
var sale_id = $('#sale_id').val();
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment";
|
||||
});
|
||||
$('#move').on('click',function(){
|
||||
var dining_id = "<%= @room.id %>"
|
||||
window.location.href = '/origami/table/'+ dining_id + "/moveroom";
|
||||
})
|
||||
$('#back').on('click',function(){
|
||||
window.location.href = '/origami/';
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -174,7 +174,7 @@
|
||||
|
||||
<!-- Column Three -->
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<button type="button" class="btn btn-primary btn-block" >Back</button>
|
||||
<button type="button" class="btn btn-primary btn-block" id='back'>Back</button>
|
||||
<button type="button" id="re-print" class="btn btn-primary btn-block">VOID</button>
|
||||
<button type="button" id="re-print" class="btn btn-primary btn-block">Re.Print</button>
|
||||
</div>
|
||||
@@ -203,4 +203,7 @@ $('#pay').on('click',function() {
|
||||
var sale_id = $('#sale_id').val();
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment";
|
||||
});
|
||||
$('#back').on('click',function(){
|
||||
window.location.href = '/origami/';
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -73,10 +73,13 @@ Rails.application.routes.draw do
|
||||
namespace :origami do
|
||||
root "home#index"
|
||||
get "table/:dining_id" => "home#show" do #origami/:booking_id will show
|
||||
|
||||
# resources :discounts, only: [:index,:new, :create ] #add discount type
|
||||
resources :customers #add customer type
|
||||
end
|
||||
post 'moving' => "movetable#moving"
|
||||
|
||||
get 'table/:dining_id/movetable' => "movetable#move_dining"
|
||||
get 'table/:dining_id/moveroom' => "moveroom#move_dining"
|
||||
get 'sale/:sale_id' => 'sales#show'
|
||||
get 'room/:room_id' => 'rooms#show'
|
||||
get 'order/:order_id' => "orders#show"
|
||||
|
||||
Reference in New Issue
Block a user