prints, excels,pdf gems
This commit is contained in:
20
app/models/print_worker.rb
Normal file
20
app/models/print_worker.rb
Normal file
@@ -0,0 +1,20 @@
|
||||
require 'cups'
|
||||
|
||||
class PrintWorker
|
||||
def self.printers()
|
||||
Cups.show_destinations
|
||||
end
|
||||
|
||||
def self.default_printer()
|
||||
Cups.default_printer
|
||||
end
|
||||
|
||||
def self.print_receipt_cashgo(sale,receipt_setting, printer_destination,order_id)
|
||||
|
||||
pdf = CashPdf.new(sale,receipt_setting,order_id)
|
||||
pdf.render_file "tmp/receipt_#{sale.receipt_no}" + ".pdf"
|
||||
|
||||
page = Cups::PrintJob.new("tmp/receipt_#{sale.receipt_no}.pdf", printer_destination)
|
||||
page.print
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user