update for addorder and printer

This commit is contained in:
Thein Lin Kyaw
2019-12-17 15:02:58 +06:30
parent 40ad724e77
commit e6392c3bd4
8 changed files with 193 additions and 336 deletions

View File

@@ -37,14 +37,15 @@ class Printer::PrinterWorker
Cups.default_printer
end
def print(file_path,printer_destination = nil )
def self.printer_exists?(printer)
Cups.show_destinations.include? printer
end
def print(file_path, printer_destination = nil )
if printer_destination.nil?
printer_destination = self.printer_destination
end
puts printer_destination
puts '........Printer Destination..........'
copy = self.print_copies
#Print only when printer information is not null
if !self.printer_destination.nil?