temp remove options in oqs
This commit is contained in:
@@ -2,9 +2,9 @@ class Oqs::HomeController < BaseOqsController
|
|||||||
def index
|
def index
|
||||||
queue_stations=OrderQueueStation.all
|
queue_stations=OrderQueueStation.all
|
||||||
|
|
||||||
@queue_items_details = queue_items_query(0)
|
@queue_items_details = queue_items_query(false)
|
||||||
|
|
||||||
@queue_completed_item = queue_items_query(1)
|
@queue_completed_item = queue_items_query(true)
|
||||||
|
|
||||||
@queue_stations_items=Array.new
|
@queue_stations_items=Array.new
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ class OrderQueueStation < ApplicationRecord
|
|||||||
oqpbz = OrderQueueProcessByZone.find_by_zone_id(dining.zone_id)
|
oqpbz = OrderQueueProcessByZone.find_by_zone_id(dining.zone_id)
|
||||||
|
|
||||||
order_items = order.order_items
|
order_items = order.order_items
|
||||||
|
|
||||||
#Assign OQS id to order Items
|
#Assign OQS id to order Items
|
||||||
oqs_stations.each do |oqs|
|
oqs_stations.each do |oqs|
|
||||||
#Get List of items -
|
#Get List of items -
|
||||||
@@ -26,16 +27,13 @@ class OrderQueueStation < ApplicationRecord
|
|||||||
#Processing through the looping items
|
#Processing through the looping items
|
||||||
order_items.each do |order_item|
|
order_items.each do |order_item|
|
||||||
if (pq_item == order_item.item_code)
|
if (pq_item == order_item.item_code)
|
||||||
if oqs.id == oqpbz.order_queue_station_id
|
# if oqs.id == oqpbz.order_queue_station_id
|
||||||
#Same Order_items can appear in two location.
|
# #Same Order_items can appear in two location.
|
||||||
|
# AssignedOrderItem.assigned_order_item(order, order_item.item_code, oqs)
|
||||||
|
# else
|
||||||
AssignedOrderItem.assigned_order_item(order, order_item.item_code, oqs)
|
AssignedOrderItem.assigned_order_item(order, order_item.item_code, oqs)
|
||||||
else
|
# end
|
||||||
AssignedOrderItem.assigned_order_item(order, order_item.item_code, oqs)
|
|
||||||
end
|
|
||||||
puts oqs.station_name
|
|
||||||
puts oqs.auto_print
|
|
||||||
puts oqs.cut_per_item
|
|
||||||
puts oqs.print_copy
|
|
||||||
if oqs.auto_print
|
if oqs.auto_print
|
||||||
print_slip(oqs, order, order_items)
|
print_slip(oqs, order, order_items)
|
||||||
end
|
end
|
||||||
@@ -43,29 +41,27 @@ class OrderQueueStation < ApplicationRecord
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
#Print OQS where printing is require
|
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
#Print order_items in 1 slip
|
#Print order_items in 1 slip
|
||||||
def print_slip(oqs, order, items)
|
def print_slip(oqs, order, order_items)
|
||||||
unique_code="OrderSummaryPdf"
|
unique_code="OrderSummaryPdf"
|
||||||
|
|
||||||
# print when complete click
|
|
||||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||||
order_queue_printer= Printer::OrderQueuePrinter.new(print_settings)
|
order_queue_printer= Printer::OrderQueuePrinter.new(print_settings)
|
||||||
order_queue_printer.print_order_summary(oqs,order.order_id)
|
order_queue_printer.print_order_summary(oqs,order.order_id)
|
||||||
|
|
||||||
# update print status for completed same order items
|
AssignedOrderItem.where("order_id = '#{ order.order_id }'").find_each do |ai|
|
||||||
items.each do |ai|
|
# update print status for order items
|
||||||
ai.print_status=true
|
ai.print_status=true
|
||||||
ai.save
|
ai.save
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
#Print order_item in 1 slip per item
|
#Print order_item in 1 slip per item
|
||||||
def print_slip_item(oqs, item)
|
def print_slip_item(oqs, assigned_order_item)
|
||||||
unique_code="OrderItemPdf"
|
unique_code="OrderItemPdf"
|
||||||
|
|
||||||
# print when complete click
|
# print when complete click
|
||||||
@@ -74,7 +70,7 @@ class OrderQueueStation < ApplicationRecord
|
|||||||
order_queue_printer.print_order_item(oqs,item.order_id, item.item_code )
|
order_queue_printer.print_order_item(oqs,item.order_id, item.item_code )
|
||||||
|
|
||||||
# update print status for completed same order items
|
# update print status for completed same order items
|
||||||
item.each do |ai|
|
assigned_order_item.each do |ai|
|
||||||
ai.print_status=true
|
ai.print_status=true
|
||||||
ai.save
|
ai.save
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -23,13 +23,15 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
|||||||
# For Print Per Item
|
# For Print Per Item
|
||||||
if oqs.cut_per_item
|
if oqs.cut_per_item
|
||||||
order.each do|odi|
|
order.each do|odi|
|
||||||
|
filename = "tmp/order_item_#{odi.item_name}" + ".pdf"
|
||||||
pdf = OrderItemPdf.new(odi)
|
pdf = OrderItemPdf.new(odi)
|
||||||
pdf.render_file "tmp/order_item.pdf"
|
# pdf.render_file "tmp/order_item.pdf"
|
||||||
|
pdf.render_file filename
|
||||||
if oqs.print_copy
|
if oqs.print_copy
|
||||||
self.print("tmp/order_item.pdf", oqs.printer_name)
|
self.print(filename, oqs.printer_name)
|
||||||
self.print("tmp/order_item.pdf", oqs.printer_name)
|
self.print(filename.gsub(".","-copy."), oqs.printer_name)
|
||||||
else
|
else
|
||||||
self.print("tmp/order_item.pdf", oqs.printer_name)
|
self.print(filename, oqs.printer_name)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
# For Print Order Summary
|
# For Print Order Summary
|
||||||
@@ -37,7 +39,12 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
|||||||
filename = "tmp/order_summary_#{order_id}" + ".pdf"
|
filename = "tmp/order_summary_#{order_id}" + ".pdf"
|
||||||
pdf = OrderSummaryPdf.new(order)
|
pdf = OrderSummaryPdf.new(order)
|
||||||
pdf.render_file filename
|
pdf.render_file filename
|
||||||
self.print(filename, oqs.printer_name)
|
if oqs.print_copy
|
||||||
|
self.print(filename, oqs.printer_name)
|
||||||
|
self.print(filename.gsub(".","-copy."), oqs.printer_name)
|
||||||
|
else
|
||||||
|
self.print(filename, oqs.printer_name)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -77,6 +77,7 @@ class OrderSummaryPdf < Prawn::Document
|
|||||||
move_down 5
|
move_down 5
|
||||||
|
|
||||||
order_item.each do|odi|
|
order_item.each do|odi|
|
||||||
|
y_position = cursor
|
||||||
bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do
|
bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do
|
||||||
text "#{odi.item_name}", :size => self.item_font_size,:align => :left
|
text "#{odi.item_name}", :size => self.item_font_size,:align => :left
|
||||||
end
|
end
|
||||||
@@ -84,9 +85,9 @@ class OrderSummaryPdf < Prawn::Document
|
|||||||
bounding_box([self.item_width,y_position], :width => self.qty_width, :height => self.item_height) do
|
bounding_box([self.item_width,y_position], :width => self.qty_width, :height => self.item_height) do
|
||||||
text "#{odi.qty}", :size => self.item_font_size,:align => :left
|
text "#{odi.qty}", :size => self.item_font_size,:align => :left
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
move_down 5
|
move_down 5
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -49,7 +49,10 @@
|
|||||||
<%= qid.qty %>
|
<%= qid.qty %>
|
||||||
</span> ]
|
</span> ]
|
||||||
</h4>
|
</h4>
|
||||||
<p class="card-text">Medium, Fries, Salad</p>
|
<!--
|
||||||
|
Item Options
|
||||||
|
<p class="card-text">Medium, Fries, Salad</p>
|
||||||
|
-->
|
||||||
<p class="card-text">
|
<p class="card-text">
|
||||||
<small class="text-muted">Order at
|
<small class="text-muted">Order at
|
||||||
<span class="order-at">
|
<span class="order-at">
|
||||||
@@ -97,7 +100,10 @@
|
|||||||
<%= qid.qty %>
|
<%= qid.qty %>
|
||||||
</span> ]
|
</span> ]
|
||||||
</h4>
|
</h4>
|
||||||
<p class="card-text">Medium, Fries, Salad</p>
|
<!--
|
||||||
|
Item Options
|
||||||
|
<p class="card-text">Medium, Fries, Salad</p>
|
||||||
|
-->
|
||||||
<p class="card-text">
|
<p class="card-text">
|
||||||
<small class="text-muted">Order at
|
<small class="text-muted">Order at
|
||||||
<span class="order-at">
|
<span class="order-at">
|
||||||
|
|||||||
Reference in New Issue
Block a user