update oqs
This commit is contained in:
@@ -46,7 +46,8 @@ $(document).ready(function(){
|
||||
url: url,
|
||||
data: {},
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
success: function(data) {
|
||||
|
||||
for(var field in data) {
|
||||
var price = parseFloat(data[field].price).toFixed(2);
|
||||
|
||||
@@ -62,7 +63,7 @@ $(document).ready(function(){
|
||||
row ='<div class="card queue_station">'
|
||||
+'<div class="card-block">'
|
||||
+'<h4 class="card-title">'
|
||||
+'<span class="order-zone-type">'+data[field]["type"]+'- </span>'
|
||||
+'<span class="order-zone-type">'+data[field]["table_type"]+'- </span>'
|
||||
+'<span class="order-zone">'+ data[field]["zone"] +'</span>'
|
||||
+'<small class="pull-right">'+ data[field]["order_id"] +'- </small>'
|
||||
+'</h4>'
|
||||
@@ -200,7 +201,8 @@ $(document).ready(function(){
|
||||
$(document).on('click', '#print_order_item', function(event){
|
||||
var assigned_item_id = $('.selected-item').children('.card-block').children('.assigned-order-item').text();
|
||||
var options = $('.selected-item').children('.card-block').find('.item-options').text();
|
||||
var params = { 'options':options };
|
||||
var params = { 'options':options };
|
||||
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: '/oqs/print/print/'+assigned_item_id,
|
||||
|
||||
@@ -89,7 +89,7 @@ class Oqs::HomeController < BaseOqsController
|
||||
|
||||
# Query for OQS with delivery status
|
||||
def queue_items_query(status)
|
||||
AssignedOrderItem.select("assigned_order_items.assigned_order_item_id, oqs.id as station_id, oqs.station_name, oqs.is_active, oqpz.zone_id, df.name as zone, df.type, odt.order_id, odt.item_code, odt.item_name, odt.price, odt.qty, odt.item_order_by, odt.options, cus.name as customer_name, odt.created_at")
|
||||
AssignedOrderItem.select("assigned_order_items.assigned_order_item_id, oqs.id as station_id, oqs.station_name, oqs.is_active, oqpz.zone_id, df.name as zone, df.type as type, odt.order_id, odt.item_code, odt.item_name, odt.price, odt.qty, odt.item_order_by, odt.options, cus.name as customer_name, odt.created_at")
|
||||
.joins(" left join order_queue_stations as oqs on oqs.id = assigned_order_items.order_queue_station_id
|
||||
left join order_queue_process_by_zones as oqpz on oqpz.order_queue_station_id = oqs.id
|
||||
left join orders as od ON od.order_id = assigned_order_items.order_id
|
||||
|
||||
@@ -95,7 +95,6 @@ class Oqs::HomeController < BaseOqsController
|
||||
end
|
||||
|
||||
|
||||
|
||||
# Query for OQS with delivery status
|
||||
def queue_items_query(status,oqs_id=nil)
|
||||
if oqs_id == nil
|
||||
@@ -103,7 +102,13 @@ class Oqs::HomeController < BaseOqsController
|
||||
else
|
||||
oqs = "and assigned_order_items.order_queue_station_id = '#{oqs_id}' "
|
||||
end
|
||||
AssignedOrderItem.select("assigned_order_items.assigned_order_item_id, oqs.id as station_id, oqs.station_name, oqs.is_active, oqpz.zone_id, df.name as zone, df.type as type, odt.order_id, odt.item_code, odt.item_name, odt.price, odt.qty, odt.item_order_by, odt.options, cus.name as customer_name, odt.created_at")
|
||||
AssignedOrderItem.select("assigned_order_items.assigned_order_item_id,
|
||||
oqs.id as station_id, oqs.station_name,
|
||||
oqs.is_active, oqpz.zone_id,
|
||||
df.name as zone, df.type as table_type,
|
||||
odt.order_id, odt.item_code, odt.item_name,
|
||||
odt.price, odt.qty, odt.item_order_by, odt.options,
|
||||
cus.name as customer_name, odt.created_at")
|
||||
.joins(" left join order_queue_stations as oqs on oqs.id = assigned_order_items.order_queue_station_id
|
||||
left join order_queue_process_by_zones as oqpz on oqpz.order_queue_station_id = oqs.id
|
||||
left join orders as od ON od.order_id = assigned_order_items.order_id
|
||||
@@ -114,7 +119,6 @@ class Oqs::HomeController < BaseOqsController
|
||||
left join dining_facilities as df on df.id = bk.dining_facility_id")
|
||||
.where("assigned_order_items.delivery_status = #{status} AND odt.price <> 0 AND assigned_order_items.created_at >= '#{Time.now.beginning_of_day.utc}' #{oqs}")
|
||||
.group("assigned_order_items.assigned_order_item_id")
|
||||
.order("assigned_order_items.created_at")
|
||||
|
||||
end
|
||||
|
||||
|
||||
@@ -17,12 +17,11 @@
|
||||
<p class="hidden oqs-id"><%= qsi.id %></p>
|
||||
<a class="nav-link" data-toggle="tab" href="" role="tab" <%= status %>>
|
||||
<%= qsi.station_name %>
|
||||
<span class="badge badge-pill badge-default" id=""><%= qsi.assigned_order_items.count(:delivery_status) %>
|
||||
<span class="badge badge-pill badge-default" id=""> <%= qsi.assigned_order_items.where("delivery_status=0").count %>
|
||||
</span>
|
||||
<% if qsi.auto_print %>
|
||||
<span>(ap)</span>
|
||||
<% end %>
|
||||
<%= qsi.assigned_order_items.where("delivery_status=0").count %>
|
||||
</a>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user