order item edit and print
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
||||
|
||||
def print_order_item(print_settings,oqs,order_id, item_code, print_status, options="")
|
||||
def print_order_item(print_settings,oqs,order_id, instance_code, print_status, options="")
|
||||
#Use CUPS service
|
||||
#Generate PDF
|
||||
#Print
|
||||
@@ -10,7 +10,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
||||
print_settings.save!
|
||||
end
|
||||
|
||||
order_item = print_query('order_item', item_code) #OrderItem.find_by_item_code(item_code)
|
||||
order_item = print_query('order_item', instance_code) #OrderItem.find_by_item_code(item_code)
|
||||
|
||||
filename = "tmp/order_item.pdf"
|
||||
|
||||
|
||||
@@ -33,7 +33,6 @@ class Printer::PrinterWorker
|
||||
end
|
||||
|
||||
def print(file_path,printer_destination = nil )
|
||||
|
||||
if printer_destination.nil?
|
||||
printer_destination = self.printer_destination
|
||||
end
|
||||
|
||||
@@ -74,6 +74,10 @@ class Printer::ReceiptPrinter < Printer::PrinterWorker
|
||||
|
||||
# print as print copies in printer setting
|
||||
count = printer_settings.print_copies
|
||||
|
||||
# override print copies for print worker loop
|
||||
print_settings.print_copies = 1
|
||||
print_settings.save!
|
||||
begin
|
||||
if count == 1
|
||||
pdf.render_file "tmp/receipt_bill_#{sale_data.receipt_no}.pdf"
|
||||
|
||||
Reference in New Issue
Block a user