price 0 print
This commit is contained in:
@@ -762,7 +762,7 @@ $(function() {
|
||||
$('#sub_total').empty();
|
||||
$('#sub_total').append(fixed_total_price);
|
||||
|
||||
if (fixed_total_price > 0) {
|
||||
if (item_row.length > 0) {
|
||||
$('.create').removeAttr("disabled", false);
|
||||
}else{
|
||||
$('.create').attr("disabled", true);
|
||||
|
||||
@@ -125,7 +125,7 @@ class Oqs::HomeController < BaseOqsController
|
||||
left join booking_orders as bo on bo.order_id = assigned_order_items.order_id
|
||||
left join bookings as bk on bk.booking_id = bo.booking_id
|
||||
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} ")
|
||||
.where("assigned_order_items.delivery_status = #{status} AND assigned_order_items.created_at >= '#{Time.now.beginning_of_day.utc}' #{oqs} ")
|
||||
query = query.where("df.name LIKE ? OR odt.order_id LIKE ? OR odt.item_name LIKE ? OR cus.name = '#{filter}'","%#{filter}%","%#{filter}%","%#{filter}%",)
|
||||
.order("assigned_order_items.assigned_order_item_id desc")
|
||||
.group("odt.order_items_id")
|
||||
@@ -143,7 +143,7 @@ class Oqs::HomeController < BaseOqsController
|
||||
left join booking_orders as bo on bo.order_id = assigned_order_items.order_id
|
||||
left join bookings as bk on bk.booking_id = bo.booking_id
|
||||
left join dining_facilities as df on df.id = bk.dining_facility_id")
|
||||
.where("assigned_order_items.delivery_status = true AND odt.price <> 0 AND assigned_order_items.created_at between '#{Time.now.beginning_of_day.utc}' and '#{Time.now.end_of_day.utc}'")
|
||||
.where("assigned_order_items.delivery_status = true AND assigned_order_items.created_at between '#{Time.now.beginning_of_day.utc}' and '#{Time.now.end_of_day.utc}'")
|
||||
query = query.where("df.name LIKE ? OR odt.order_id LIKE ? OR odt.item_name LIKE ? OR cus.name = '#{filter}'","%#{filter}%","%#{filter}%","%#{filter}%",)
|
||||
.group("assigned_order_items.order_id")
|
||||
.limit(20)
|
||||
@@ -162,7 +162,7 @@ class Oqs::HomeController < BaseOqsController
|
||||
left join booking_orders as bo on bo.order_id = assigned_order_items.order_id
|
||||
left join bookings as bk on bk.booking_id = bo.booking_id
|
||||
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}' ")
|
||||
.where("assigned_order_items.delivery_status = #{status} AND assigned_order_items.created_at >= '#{Time.now.beginning_of_day.utc}' ")
|
||||
query = query.where("df.name LIKE ? OR odt.order_id LIKE ? OR odt.item_name LIKE ? OR cus.name = '#{filter}'","%#{filter}%","%#{filter}%","%#{filter}%",)
|
||||
.group("oqs.id")
|
||||
|
||||
|
||||
@@ -5,14 +5,15 @@ class OrderQueueProcessorJob < ApplicationJob
|
||||
# Do something later
|
||||
#Order ID
|
||||
|
||||
order = Order.find(order_id)
|
||||
assign_order = AssignedOrderItem.assigned_order_item_by_job(order_id)
|
||||
order = Order.find(order_id)
|
||||
|
||||
#Execute orders and send to order stations
|
||||
if order
|
||||
oqs = OrderQueueStation.new
|
||||
oqs.process_order(order, table_id)
|
||||
end
|
||||
|
||||
assign_order = AssignedOrderItem.assigned_order_item_by_job(order_id)
|
||||
ActionCable.server.broadcast "order_queue_station_channel",order: assign_order
|
||||
end
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ class AssignedOrderItem < ApplicationRecord
|
||||
left join booking_orders as bo on bo.order_id = assigned_order_items.order_id
|
||||
left join bookings as bk on bk.booking_id = bo.booking_id
|
||||
left join dining_facilities as df on df.id = bk.dining_facility_id")
|
||||
.where("assigned_order_items.order_id = '#{order_id}' AND assigned_order_items.delivery_status = false AND odt.price <> 0 AND assigned_order_items.created_at >= '#{Time.now.beginning_of_day.utc}' ")
|
||||
.where("assigned_order_items.order_id = '#{order_id}' AND assigned_order_items.delivery_status = false AND assigned_order_items.created_at >= '#{Time.now.beginning_of_day.utc}' ")
|
||||
.order("assigned_order_items.assigned_order_item_id desc")
|
||||
.group("assigned_order_items.assigned_order_item_id")
|
||||
return order_item
|
||||
|
||||
@@ -123,7 +123,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
||||
left join dining_facilities AS df ON df.id = b.dining_facility_id
|
||||
left join customers as cus ON cus.customer_id = orders.customer_id
|
||||
left join menu_items as item ON item.item_code = order_items.item_code")
|
||||
.where("order_items.item_instance_code = '#{ id }' AND order_items.price != 0")
|
||||
.where("order_items.item_instance_code = '#{ id }'")
|
||||
.group("order_items.item_code")
|
||||
elsif type == "order_summary"
|
||||
OrderItem.select("order_items.order_id, order_items.item_code, order_items.item_name, order_items.qty, order_items.price, order_items.options, order_items.item_order_by as order_by, order_items.created_at as order_at, cus.name as customer, df.type, df.name as dining,item.alt_name as alt_name")
|
||||
@@ -133,7 +133,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
||||
left join dining_facilities AS df ON df.id = b.dining_facility_id
|
||||
left join customers as cus ON cus.customer_id = orders.customer_id
|
||||
left join menu_items as item ON item.item_code = order_items.item_code")
|
||||
.where("orders.order_id = '#{ id }' AND order_items.price != 0")
|
||||
.where("orders.order_id = '#{ id }'")
|
||||
.group("order_items.order_items_id")
|
||||
else
|
||||
# order summary for booking
|
||||
@@ -144,7 +144,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
||||
left join dining_facilities AS df ON df.id = b.dining_facility_id
|
||||
left join customers as cus ON cus.customer_id = orders.customer_id
|
||||
left join menu_items as item ON item.item_code = order_items.item_code")
|
||||
.where("b.booking_id = '#{ id }' AND order_items.price != 0")
|
||||
.where("b.booking_id = '#{ id }'")
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -90,26 +90,28 @@ json.options opt_format
|
||||
# json.item_attributes = item_instance.item_attributes
|
||||
|
||||
json.instances item.menu_item_instances do |is|
|
||||
# Convert id to name for attributes
|
||||
instance_attr = []
|
||||
if is.is_available
|
||||
# Convert id to name for attributes
|
||||
instance_attr = []
|
||||
|
||||
is.item_attributes.each do |ia|
|
||||
# mItemAttr = MenuItemAttribute.find(is)
|
||||
# instance_attr.push(ia)
|
||||
mItemAttr = MenuItemAttribute.find(ia).name
|
||||
instance_attr.push(mItemAttr)
|
||||
is.item_attributes.each do |ia|
|
||||
# mItemAttr = MenuItemAttribute.find(is)
|
||||
# instance_attr.push(ia)
|
||||
mItemAttr = MenuItemAttribute.find(ia).name
|
||||
instance_attr.push(mItemAttr)
|
||||
end
|
||||
|
||||
json.id is.id
|
||||
json.code is.item_instance_code
|
||||
json.name is.item_instance_name
|
||||
json.price is.price
|
||||
json.is_available is.is_available
|
||||
json.is_default is.is_default
|
||||
json.is_on_promotion is.is_on_promotion
|
||||
json.promotion_price is.promotion_price
|
||||
json.values instance_attr
|
||||
# json.item_sets is.item_sets
|
||||
end
|
||||
|
||||
json.id is.id
|
||||
json.code is.item_instance_code
|
||||
json.name is.item_instance_name
|
||||
json.price is.price
|
||||
json.is_available is.is_available
|
||||
json.is_default is.is_default
|
||||
json.is_on_promotion is.is_on_promotion
|
||||
json.promotion_price is.promotion_price
|
||||
json.values instance_attr
|
||||
# json.item_sets is.item_sets
|
||||
end
|
||||
|
||||
#Child Menu items
|
||||
|
||||
@@ -90,23 +90,25 @@ json.options opt_format
|
||||
# json.item_attributes = item_instance.item_attributes
|
||||
|
||||
json.instances item.menu_item_instances do |is|
|
||||
# Convert id to name for attributes
|
||||
instance_attr = []
|
||||
is.item_attributes.each do |ia|
|
||||
mItemAttr = MenuItemAttribute.find(ia).name
|
||||
instance_attr.push(mItemAttr)
|
||||
if is.is_available
|
||||
# Convert id to name for attributes
|
||||
instance_attr = []
|
||||
is.item_attributes.each do |ia|
|
||||
mItemAttr = MenuItemAttribute.find(ia).name
|
||||
instance_attr.push(mItemAttr)
|
||||
end
|
||||
|
||||
json.id is.id
|
||||
json.code is.item_instance_code
|
||||
json.name is.item_instance_name
|
||||
json.price is.price
|
||||
json.is_available is.is_available
|
||||
json.is_default is.is_default
|
||||
json.is_on_promotion is.is_on_promotion
|
||||
json.promotion_price is.promotion_price
|
||||
json.values instance_attr
|
||||
# json.item_sets is.item_sets
|
||||
end
|
||||
|
||||
json.id is.id
|
||||
json.code is.item_instance_code
|
||||
json.name is.item_instance_name
|
||||
json.price is.price
|
||||
json.is_available is.is_available
|
||||
json.is_default is.is_default
|
||||
json.is_on_promotion is.is_on_promotion
|
||||
json.promotion_price is.promotion_price
|
||||
json.values instance_attr
|
||||
# json.item_sets is.item_sets
|
||||
end
|
||||
|
||||
#Child Menu items
|
||||
|
||||
Reference in New Issue
Block a user