Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant
This commit is contained in:
@@ -97,7 +97,7 @@
|
||||
<div class="col-lg-5 col-md-5 col-sm-5">
|
||||
<div class="card" >
|
||||
<div class="card-header">
|
||||
<% if @status_order == 'order' %>
|
||||
<% if @status_order == 'order' && @status_sale != 'sale' %>
|
||||
<div id="save_order_id" data-order="<%= @obj_order.order_id %>"><strong id="order-title">ORDER DETAILS </strong></div>
|
||||
<% elsif @status_sale == 'sale' %>
|
||||
<div><strong id="order-title">INVOICE DETAILS </strong></div>
|
||||
@@ -108,7 +108,7 @@
|
||||
<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 '' %>
|
||||
<%= @sale_array[0].receipt_no rescue '' %>
|
||||
<% end %>
|
||||
</span></p>
|
||||
</div>
|
||||
@@ -126,6 +126,7 @@
|
||||
<table class="table table-striped" id="order-items-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th class="item-name">Items</th>
|
||||
<th class="item-attr">QTY</td>
|
||||
<th class="item-attr">Price</td>
|
||||
@@ -133,14 +134,18 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<%
|
||||
count = 0
|
||||
sub_total = 0
|
||||
if @status_sale == "sale"
|
||||
@obj_sale.sale_items.each do |sale_item|
|
||||
puts @sale_array[0]
|
||||
@sale_array[0].sale_items.each do |sale_item|
|
||||
count += 1
|
||||
sub_total = sub_total + sale_item.price
|
||||
%>
|
||||
<input type="hidden" id="sale_id" value="<%= @obj_sale.sale_id %>">
|
||||
<input type="hidden" id="sale_id" value="<%= @sale_array[0].sale_id %>">
|
||||
<% unless sale_item.price <= 0 %>
|
||||
<tr>
|
||||
<td><%= count %></td>
|
||||
<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>
|
||||
@@ -150,13 +155,18 @@
|
||||
end
|
||||
end
|
||||
|
||||
if @status_order == 'order'
|
||||
if @status_order == 'order' && @status_sale != 'sale'
|
||||
unless @order_items.nil?
|
||||
count = 0
|
||||
@order_items.each do |order_item |
|
||||
puts @order_items.size
|
||||
puts "view"
|
||||
count += 1
|
||||
sub_total = sub_total + order_item.price
|
||||
|
||||
unless order_item.price <= 0 %>
|
||||
<tr>
|
||||
<td><%= count %></td>
|
||||
<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>
|
||||
@@ -217,8 +227,24 @@
|
||||
</table>
|
||||
<button class='btn btn-primary'> Add to existing invoice </button>
|
||||
<%
|
||||
else
|
||||
@sale_array.each do |sale|
|
||||
if @sale_array.size > 1
|
||||
unless sale.receipt_no == @sale_array[0].receipt_no
|
||||
%>
|
||||
Pending New Invoice
|
||||
<table class="table table-striped">
|
||||
<tr>
|
||||
<td>Receipt No - <%= sale.receipt_no %></td>
|
||||
<td><button class='btn btn-sm btn-primary '>Show Detail </button></td>
|
||||
</tr>
|
||||
</table>
|
||||
<%
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
%>
|
||||
|
||||
</div>
|
||||
@@ -229,6 +255,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 +270,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>
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
<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 '' %>
|
||||
<%= @sale_array[0].receipt_no rescue '' %>
|
||||
<% end %>
|
||||
</span></p>
|
||||
</div>
|
||||
@@ -99,6 +99,7 @@
|
||||
<table class="table table-striped" id="order-items-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th class="item-name">Items</th>
|
||||
<th class="item-attr">QTY</td>
|
||||
<th class="item-attr">Price</td>
|
||||
@@ -106,14 +107,18 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<%
|
||||
count = 0
|
||||
sub_total = 0
|
||||
if @status_sale == "sale"
|
||||
@obj_sale.sale_items.each do |sale_item|
|
||||
puts @sale_array[0]
|
||||
@sale_array[0].sale_items.each do |sale_item|
|
||||
count += 1
|
||||
sub_total = sub_total + sale_item.price
|
||||
%>
|
||||
<input type="hidden" id="sale_id" value="<%= @obj_sale.sale_id %>">
|
||||
<input type="hidden" id="sale_id" value="<%= @sale_array[0].sale_id %>">
|
||||
<% unless sale_item.price <= 0 %>
|
||||
<tr>
|
||||
<td><%= count %></td>
|
||||
<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>
|
||||
@@ -123,13 +128,18 @@
|
||||
end
|
||||
end
|
||||
|
||||
if @status_order == 'order'
|
||||
if @status_order == 'order' && @status_sale != 'sale'
|
||||
unless @order_items.nil?
|
||||
count = 0
|
||||
@order_items.each do |order_item |
|
||||
puts @order_items.size
|
||||
puts "view"
|
||||
count += 1
|
||||
sub_total = sub_total + order_item.price
|
||||
|
||||
unless order_item.price <= 0 %>
|
||||
<tr>
|
||||
<td><%= count %></td>
|
||||
<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>
|
||||
@@ -143,6 +153,47 @@
|
||||
</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>
|
||||
<button class='btn btn-primary'> Add to existing invoice </button>
|
||||
<%
|
||||
else
|
||||
@sale_array.each do |sale|
|
||||
if @sale_array.size > 1
|
||||
unless sale.receipt_no == @sale_array[0].receipt_no
|
||||
%>
|
||||
Pending New Invoice
|
||||
<table class="table table-striped">
|
||||
<tr>
|
||||
<td>Receipt No - <%= sale.receipt_no %></td>
|
||||
<td><button class='btn btn-sm btn-primary '>Show Detail </button></td>
|
||||
</tr>
|
||||
</table>
|
||||
<%
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
%>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="pay purple" id="move_table">MOVE TABLE</div>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user