update for all print with filenamme

This commit is contained in:
Yan
2017-07-11 11:03:21 +06:30
parent a713bf3b0e
commit 975372e467
3 changed files with 19 additions and 9 deletions

View File

@@ -6,7 +6,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
#Print
order_item = print_query('order_item', item_code) #OrderItem.find_by_item_code(item_code)
filename = "tmp/order_item_#{order_item[0].item_name}" + ".pdf"
filename = "tmp/order_item.pdf"
# check for item not to show
if order_item[0].price != 0
@@ -35,7 +35,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
# For Print Per Item
if oqs.cut_per_item
order.each do|odi|
filename = "tmp/order_item_#{odi.item_name}" + ".pdf"
filename = "tmp/order_item.pdf"
# For Item Options
options = odi.options == "[]"? "" : odi.options
@@ -54,7 +54,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
end
# For Print Order Summary
else
filename = "tmp/order_summary_#{ order_id }" + ".pdf"
filename = "tmp/order_summary.pdf"
pdf = OrderSummaryPdf.new(print_settings,order, print_status, order_items, oqs.use_alternate_name)
pdf.render_file filename
if oqs.print_copy
@@ -75,7 +75,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
# For Print Per Item
if oqs.cut_per_item
order.each do|odi|
filename = "tmp/order_item_#{odi.item_name}" + ".pdf"
filename = "tmp/order_item.pdf"
# For Item Options
options = odi.options == "[]"? "" : odi.options
@@ -97,7 +97,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
end
# For Print Order Summary
else
filename = "tmp/booking_summary_#{ booking_id }" + ".pdf"
filename = "tmp/booking_summary.pdf"
pdf = OrderSummaryPdf.new(print_settings,order, print_status,oqs.use_alternate_name)
pdf.render_file filename
if oqs.print_copy