oqs update
This commit is contained in:
@@ -45,7 +45,8 @@ class OrderQueueStation < ApplicationRecord
|
||||
end
|
||||
# Auto Printing
|
||||
# ToDo per item per printer
|
||||
if oqs.auto_print && is_auto_printed == false
|
||||
if oqs.auto_print && is_auto_printed == false
|
||||
puts oqs_order_items.length
|
||||
print_slip(oqs, order, oqs_order_items)
|
||||
is_auto_printed = true
|
||||
end
|
||||
@@ -59,7 +60,7 @@ class OrderQueueStation < ApplicationRecord
|
||||
|
||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||
order_queue_printer= Printer::OrderQueuePrinter.new(print_settings)
|
||||
order_queue_printer.print_order_summary(oqs,order.order_id, print_status="")
|
||||
order_queue_printer.print_order_summary(oqs,order.order_id, order_items, print_status="")
|
||||
|
||||
AssignedOrderItem.where("order_id = '#{ order.order_id }'").find_each do |ai|
|
||||
# update print status for order items
|
||||
|
||||
@@ -22,14 +22,14 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
||||
end
|
||||
|
||||
# Query for per order
|
||||
def print_order_summary(oqs, order_id, print_status)
|
||||
def print_order_summary(oqs, order_id, order_items, print_status)
|
||||
#Use CUPS service
|
||||
#Generate PDF
|
||||
#Print
|
||||
#Print
|
||||
order=print_query('order_summary', order_id)
|
||||
# For Print Per Item
|
||||
if oqs.cut_per_item
|
||||
order.each do|odi|
|
||||
order_items.each do|odi|
|
||||
filename = "tmp/order_item_#{odi.item_name}" + ".pdf"
|
||||
# For Item Options
|
||||
options = odi.options == "[]"? "" : odi.options
|
||||
@@ -46,7 +46,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
||||
# For Print Order Summary
|
||||
else
|
||||
filename = "tmp/order_summary_#{ order_id }" + ".pdf"
|
||||
pdf = OrderSummaryPdf.new(order, print_status)
|
||||
pdf = OrderSummaryPdf.new(order, print_status, order_items)
|
||||
pdf.render_file filename
|
||||
if oqs.print_copy
|
||||
self.print(filename, oqs.printer_name)
|
||||
|
||||
Reference in New Issue
Block a user