From 2d57faf7cfafcf55269d75c9617312c7cd0555b0 Mon Sep 17 00:00:00 2001 From: yarzar_code Date: Fri, 10 Jan 2020 11:31:59 +0630 Subject: [PATCH] Update Shift for credit payment --- app/models/printer/printer_worker.rb | 22 +++++++++++----------- config/initializers/action_controller.rb | 10 +++++----- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/app/models/printer/printer_worker.rb b/app/models/printer/printer_worker.rb index 5d7cce22..d30af42d 100755 --- a/app/models/printer/printer_worker.rb +++ b/app/models/printer/printer_worker.rb @@ -42,17 +42,17 @@ class Printer::PrinterWorker end def print(file_path, printer_destination = nil ) - # if printer_destination.nil? - # printer_destination = self.printer_destination - # end + if printer_destination.nil? + printer_destination = self.printer_destination + end - # copy = self.print_copies - # #Print only when printer information is not null - # if !self.printer_destination.nil? - # (1..copy).each do - # page = Cups::PrintJob.new(file_path, printer_destination) - # page.print - # end - # end + copy = self.print_copies + #Print only when printer information is not null + if !self.printer_destination.nil? + (1..copy).each do + page = Cups::PrintJob.new(file_path, printer_destination) + page.print + end + end end end diff --git a/config/initializers/action_controller.rb b/config/initializers/action_controller.rb index 2cf70a1b..eb7ba401 100644 --- a/config/initializers/action_controller.rb +++ b/config/initializers/action_controller.rb @@ -20,11 +20,11 @@ class ActionController::Base end else # check for license file - # if check_license - # current_license(ENV["SX_PROVISION_URL"]) - # else - # redirect_to activate_path - # end + if check_license + current_license(ENV["SX_PROVISION_URL"]) + else + redirect_to activate_path + end end end