move table

This commit is contained in:
Nweni
2017-06-21 17:53:44 +06:30
parent b889603ce6
commit 64210f30ac
16 changed files with 218 additions and 40 deletions

View File

@@ -229,6 +229,7 @@
<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>
<% if @dining.bookings.length >= 1 %>
<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" id='move'>Move</button>
@@ -243,6 +244,7 @@
<!-- Cashier Buttons -->
<button type="button" id="discount" class="btn btn-primary btn-block" >Discount</button>
<button type="button" id="re-print" class="btn btn-primary btn-block" >Re.Print</button>
<% end %>
</div>
</div>
<script>

View File

@@ -143,6 +143,30 @@
</tbody>
</table>
</div>
<%
if @status_sale == 'sale'
unless @order_items.nil?
%>
Pending New Order
<table class="table table-striped">
<%
@order_items.each do |order_item |
%>
<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
%>
</table>
<%
end
end
%>
<div class="row">
<div class="col-md-12">
<div class="pay purple" id="move_table">MOVE TABLE</div>

View File

@@ -81,7 +81,20 @@
<% @orders.each do |order| %>
<div class="card orders red text-white" data-id = "<%= order.order_id %>">
<div class="card-block">
<%= order.order_id %>
<%
order_status = ""
sale_order = SaleOrder.find_by_order_id(order)
if sale_order
sale = Sale.find(sale_order.sale_id)
order_status = sale.sale_status
if order_status == 'new'
order_status = order.status
end
else
order_status = order.status
end
%>
<%= order.order_id %> | <%= order_status %>
</div>
</div>
<% end %>
@@ -137,10 +150,8 @@
<td class='item-attr'><%= sale_item.price %></td>
</tr>
<%
end
end
%>
</tbody>
</table>
@@ -165,6 +176,9 @@
<!-- Column Three -->
<div class="col-lg-1 col-md-1 col-sm-1">
<button type="button" class="btn btn-primary btn-block" id='back'>Back</button>
<% if @sale_status != 'completed' %>
<button type="button" class="btn btn-primary btn-block" id='move'>MOVE</button>
<% end %>
<button type="button" id="re-print" class="btn btn-primary btn-block">Re.Print</button>
</div>
</div>
@@ -193,5 +207,8 @@ $('#pay').on('click',function() {
});
$('#back').on('click',function(){
window.location.href = '/origami/';
})
$('#move').on('click',function(){
})
</script>