Pull from master
This commit is contained in:
@@ -6,25 +6,21 @@ if @zones
|
||||
#List all tables
|
||||
json.tables zone.tables do |table|
|
||||
if table.is_active
|
||||
booking = table.get_current_booking
|
||||
json.id table.id
|
||||
json.name table.name
|
||||
json.status table.status
|
||||
json.zone_id table.zone_id #Add this zone_id to keep data structure consistance
|
||||
json.current_booking booking.booking_id rescue ""
|
||||
json.sale_id booking.sale_id rescue ""
|
||||
json.current_booking table.get_current_booking.booking_id rescue ""
|
||||
end
|
||||
end
|
||||
|
||||
json.rooms zone.rooms do |room|
|
||||
if room.is_active
|
||||
booking = room.get_current_booking
|
||||
json.id room.id
|
||||
json.name room.name
|
||||
json.status room.status
|
||||
json.zone_id room.zone_id #Add this zone_id to keep data structure consistance
|
||||
json.current_booking booking.booking_id rescue ""
|
||||
json.sale_id booking.sale_id rescue ""
|
||||
json.current_booking room.get_current_booking.booking_id rescue ""
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -32,25 +28,21 @@ if @zones
|
||||
else #list all tables and rooms with out zones
|
||||
json.tables @all_tables do |table|
|
||||
if table.is_active
|
||||
booking = table.get_current_booking
|
||||
json.id table.id
|
||||
json.name table.name
|
||||
json.status table.status
|
||||
json.zone_id table.zone_id #Add this zone_id to keep data structure consistance
|
||||
json.current_booking booking.booking_id rescue ""
|
||||
json.sale_id booking.sale_id rescue ""
|
||||
json.current_booking table.get_current_booking.booking_id rescue ""
|
||||
end
|
||||
end
|
||||
|
||||
json.rooms @all_rooms do |room|
|
||||
if room.is_active
|
||||
booking = room.get_current_booking
|
||||
json.id room.id
|
||||
json.name room.name
|
||||
json.status room.status
|
||||
json.zone_id room.zone_id #Add this zone_id to keep data structure consistance
|
||||
json.current_booking booking.booking_id rescue ""
|
||||
json.sale_id booking.sale_id rescue ""
|
||||
json.current_booking room.get_current_booking.booking_id rescue ""
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -50,8 +50,8 @@
|
||||
<div class="card tables orange text-white" data-id="<%= table.id %>">
|
||||
<% end %>
|
||||
<div class="card-block">
|
||||
Zone <%= table.zone_id %> <br>
|
||||
Table <%= table.name %> ( <%= table.seater %> Seat )
|
||||
Table <%= table.name %> ( <%= table.seater %> Seat ) <br>
|
||||
Zone <%= table.zone_id %>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
@@ -61,16 +61,16 @@
|
||||
<div class="card tables orange text-white" data-id="<%= table.id %>">
|
||||
<% end %>
|
||||
<div class="card-block">
|
||||
Zone <%= table.zone_id %> <br>
|
||||
Table <%= table.name %> ( <%= table.seater %> Seat )
|
||||
Table <%= table.name %> ( <%= table.seater %> Seat ) <br>
|
||||
Zone <%= table.zone_id %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<div class="card tables green text-white table_<%= table.id %>" data-id="<%= table.id %>">
|
||||
<div class="card-block">
|
||||
Zone <%= table.zone_id %> <br>
|
||||
Table <%= table.name %> ( <%= table.seater %> Seat )
|
||||
Table <%= table.name %> ( <%= table.seater %> Seat ) <br>
|
||||
Zone <%= table.zone_id %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -107,11 +107,26 @@
|
||||
<div class="tab-pane dining" id="orders" role="tabpanel">
|
||||
<div class="card-columns">
|
||||
<% @orders.each do |order| %>
|
||||
<div class="card orders red text-white" data-id = "<%= order.order_id %>">
|
||||
<div class="card-block">
|
||||
<%= order.order_id %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card orders <%=(order.status=="new") ? 'blue' : 'red'%> text-white" data-id="<%= order.order_id %>">
|
||||
<div class="card-block">
|
||||
<%
|
||||
order_status = ""
|
||||
sale_order = order.sale_orders.first
|
||||
if sale_order
|
||||
unless sale_order.sale_id.nil?
|
||||
sale = Sale.find(sale_order.sale_id)
|
||||
order_status = sale.sale_status
|
||||
if order_status == 'new'
|
||||
order_status = order.status
|
||||
end
|
||||
end
|
||||
else
|
||||
order_status = order.status
|
||||
end
|
||||
%>
|
||||
<%= order.order_id %> <% if !order_status.empty? %>| <%= order_status %> <% end %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -371,7 +371,9 @@
|
||||
<% else %>
|
||||
No Tax
|
||||
<% end %></strong><br>
|
||||
<button class="btn btn-link waves-effect bg-info change_tax">Change Tax</button>
|
||||
<%if !@webview %>
|
||||
<button class="btn btn-link waves-effect bg-info change_tax">Change Tax</button>
|
||||
<% end %>
|
||||
</td>
|
||||
<td class="item-attr"><strong id="order-Tax"><%= @obj_sale.total_tax rescue 0%></strong></td>
|
||||
</tr>
|
||||
|
||||
@@ -144,25 +144,25 @@
|
||||
<div class="card-columns">
|
||||
<% @orders.each do |order| %>
|
||||
<div class="card orders <%=(order.status=="new") ? 'blue' : 'red'%> text-white" data-id="<%= order.order_id %>">
|
||||
<div class="card-block">
|
||||
<%
|
||||
order_status = ""
|
||||
sale_order = SaleOrder.find_by_order_id(order)
|
||||
if sale_order
|
||||
unless sale_order.sale_id.nil?
|
||||
sale = Sale.find(sale_order.sale_id)
|
||||
order_status = sale.sale_status
|
||||
if order_status == 'new'
|
||||
order_status = order.status
|
||||
<div class="card-block">
|
||||
<%
|
||||
order_status = ""
|
||||
sale_order = order.sale_orders.first
|
||||
if sale_order
|
||||
unless sale_order.sale_id.nil?
|
||||
sale = Sale.find(sale_order.sale_id)
|
||||
order_status = sale.sale_status
|
||||
if order_status == 'new'
|
||||
order_status = order.status
|
||||
end
|
||||
end
|
||||
else
|
||||
order_status = order.status
|
||||
end
|
||||
else
|
||||
order_status = order.status
|
||||
end
|
||||
%>
|
||||
%>
|
||||
<%= order.order_id %> <% if !order_status.empty? %>| <%= order_status %> <% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
@@ -360,7 +360,9 @@
|
||||
<% else %>
|
||||
No Tax
|
||||
<% end %></strong><br>
|
||||
<button class="btn btn-link waves-effect bg-info change_tax">Change Tax</button>
|
||||
<%if !@webview %>
|
||||
<button class="btn btn-link waves-effect bg-info change_tax">Change Tax</button>
|
||||
<% end %>
|
||||
</td>
|
||||
<td class="item-attr"><strong id="order-Tax"><%= @obj_sale.total_tax rescue 0%></strong></td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user