price 0 print
This commit is contained in:
@@ -762,7 +762,7 @@ $(function() {
|
|||||||
$('#sub_total').empty();
|
$('#sub_total').empty();
|
||||||
$('#sub_total').append(fixed_total_price);
|
$('#sub_total').append(fixed_total_price);
|
||||||
|
|
||||||
if (fixed_total_price > 0) {
|
if (item_row.length > 0) {
|
||||||
$('.create').removeAttr("disabled", false);
|
$('.create').removeAttr("disabled", false);
|
||||||
}else{
|
}else{
|
||||||
$('.create').attr("disabled", true);
|
$('.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 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 bookings as bk on bk.booking_id = bo.booking_id
|
||||||
left join dining_facilities as df on df.id = bk.dining_facility_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}%",)
|
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")
|
.order("assigned_order_items.assigned_order_item_id desc")
|
||||||
.group("odt.order_items_id")
|
.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 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 bookings as bk on bk.booking_id = bo.booking_id
|
||||||
left join dining_facilities as df on df.id = bk.dining_facility_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}%",)
|
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")
|
.group("assigned_order_items.order_id")
|
||||||
.limit(20)
|
.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 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 bookings as bk on bk.booking_id = bo.booking_id
|
||||||
left join dining_facilities as df on df.id = bk.dining_facility_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}%",)
|
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")
|
.group("oqs.id")
|
||||||
|
|
||||||
|
|||||||
@@ -6,13 +6,14 @@ class OrderQueueProcessorJob < ApplicationJob
|
|||||||
#Order ID
|
#Order ID
|
||||||
|
|
||||||
order = Order.find(order_id)
|
order = Order.find(order_id)
|
||||||
assign_order = AssignedOrderItem.assigned_order_item_by_job(order_id)
|
|
||||||
|
|
||||||
#Execute orders and send to order stations
|
#Execute orders and send to order stations
|
||||||
if order
|
if order
|
||||||
oqs = OrderQueueStation.new
|
oqs = OrderQueueStation.new
|
||||||
oqs.process_order(order, table_id)
|
oqs.process_order(order, table_id)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
assign_order = AssignedOrderItem.assigned_order_item_by_job(order_id)
|
||||||
ActionCable.server.broadcast "order_queue_station_channel",order: assign_order
|
ActionCable.server.broadcast "order_queue_station_channel",order: assign_order
|
||||||
end
|
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 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 bookings as bk on bk.booking_id = bo.booking_id
|
||||||
left join dining_facilities as df on df.id = bk.dining_facility_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")
|
.order("assigned_order_items.assigned_order_item_id desc")
|
||||||
.group("assigned_order_items.assigned_order_item_id")
|
.group("assigned_order_items.assigned_order_item_id")
|
||||||
return order_item
|
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 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 customers as cus ON cus.customer_id = orders.customer_id
|
||||||
left join menu_items as item ON item.item_code = order_items.item_code")
|
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")
|
.group("order_items.item_code")
|
||||||
elsif type == "order_summary"
|
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")
|
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 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 customers as cus ON cus.customer_id = orders.customer_id
|
||||||
left join menu_items as item ON item.item_code = order_items.item_code")
|
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")
|
.group("order_items.order_items_id")
|
||||||
else
|
else
|
||||||
# order summary for booking
|
# 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 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 customers as cus ON cus.customer_id = orders.customer_id
|
||||||
left join menu_items as item ON item.item_code = order_items.item_code")
|
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
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -90,26 +90,28 @@ json.options opt_format
|
|||||||
# json.item_attributes = item_instance.item_attributes
|
# json.item_attributes = item_instance.item_attributes
|
||||||
|
|
||||||
json.instances item.menu_item_instances do |is|
|
json.instances item.menu_item_instances do |is|
|
||||||
# Convert id to name for attributes
|
if is.is_available
|
||||||
instance_attr = []
|
# Convert id to name for attributes
|
||||||
|
instance_attr = []
|
||||||
|
|
||||||
is.item_attributes.each do |ia|
|
is.item_attributes.each do |ia|
|
||||||
# mItemAttr = MenuItemAttribute.find(is)
|
# mItemAttr = MenuItemAttribute.find(is)
|
||||||
# instance_attr.push(ia)
|
# instance_attr.push(ia)
|
||||||
mItemAttr = MenuItemAttribute.find(ia).name
|
mItemAttr = MenuItemAttribute.find(ia).name
|
||||||
instance_attr.push(mItemAttr)
|
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
|
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
|
end
|
||||||
|
|
||||||
#Child Menu items
|
#Child Menu items
|
||||||
|
|||||||
@@ -90,23 +90,25 @@ json.options opt_format
|
|||||||
# json.item_attributes = item_instance.item_attributes
|
# json.item_attributes = item_instance.item_attributes
|
||||||
|
|
||||||
json.instances item.menu_item_instances do |is|
|
json.instances item.menu_item_instances do |is|
|
||||||
# Convert id to name for attributes
|
if is.is_available
|
||||||
instance_attr = []
|
# Convert id to name for attributes
|
||||||
is.item_attributes.each do |ia|
|
instance_attr = []
|
||||||
mItemAttr = MenuItemAttribute.find(ia).name
|
is.item_attributes.each do |ia|
|
||||||
instance_attr.push(mItemAttr)
|
mItemAttr = MenuItemAttribute.find(ia).name
|
||||||
end
|
instance_attr.push(mItemAttr)
|
||||||
|
end
|
||||||
|
|
||||||
json.id is.id
|
json.id is.id
|
||||||
json.code is.item_instance_code
|
json.code is.item_instance_code
|
||||||
json.name is.item_instance_name
|
json.name is.item_instance_name
|
||||||
json.price is.price
|
json.price is.price
|
||||||
json.is_available is.is_available
|
json.is_available is.is_available
|
||||||
json.is_default is.is_default
|
json.is_default is.is_default
|
||||||
json.is_on_promotion is.is_on_promotion
|
json.is_on_promotion is.is_on_promotion
|
||||||
json.promotion_price is.promotion_price
|
json.promotion_price is.promotion_price
|
||||||
json.values instance_attr
|
json.values instance_attr
|
||||||
# json.item_sets is.item_sets
|
# json.item_sets is.item_sets
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
#Child Menu items
|
#Child Menu items
|
||||||
|
|||||||
Reference in New Issue
Block a user