diff --git a/app/models/label_printer.rb b/app/models/label_printer.rb index 291b82b9e..fbfe6e1ce 100644 --- a/app/models/label_printer.rb +++ b/app/models/label_printer.rb @@ -19,6 +19,10 @@ class LabelPrinter < ApplicationRecord validates :type_of, presence: true validates :language_type, presence: true + def self.zebra_print_enabled? + RepositoryBase.stock_management_enabled? + end + def done? current_print_job_ids.blank? && ready? end diff --git a/app/models/label_template.rb b/app/models/label_template.rb index 52f5ca61b..667c4ab36 100644 --- a/app/models/label_template.rb +++ b/app/models/label_template.rb @@ -16,7 +16,7 @@ class LabelTemplate < ApplicationRecord validate :ensure_single_default_template! def self.enabled? - ApplicationSettings.instance.values['label_templates_enabled'] + RepositoryBase.stock_management_enabled? end def icon diff --git a/app/views/label_printers/_label_printer_modal.html.erb b/app/views/label_printers/_label_printer_modal.html.erb index 7ef58851f..9fca3cb10 100644 --- a/app/views/label_printers/_label_printer_modal.html.erb +++ b/app/views/label_printers/_label_printer_modal.html.erb @@ -7,7 +7,7 @@ data-print-validation-url="<%= validate_label_template_columns_repository_row_path %>" data-label-preview-url="<%= zpl_preview_label_templates_path %>" data-fluics-info-url="<%= Constants::SCINOTE_FLUICS_URL %>" - data-zebra-enabled="<%= Rails.configuration.x.zebra_print_enabled %>" + data-zebra-enabled="<%= LabelPrinter.zebra_print_enabled? %>" > <% if @printer_type == 'fluics' %> <%= t("users.settings.account.label_printer.fluics_printer") %> - <% elsif @printer_type == 'zebra' && Rails.configuration.x.zebra_print_enabled %> + <% elsif @printer_type == 'zebra' && LabelPrinter.zebra_print_enabled? %> <%= t("users.settings.account.label_printer.zebra_printer") %> <% end %> @@ -25,7 +25,7 @@ <% if @printer_type == 'fluics' %> <%= render "fluics_settings" %> - <% elsif @printer_type == 'zebra' && Rails.configuration.x.zebra_print_enabled %> + <% elsif @printer_type == 'zebra' && LabelPrinter.zebra_print_enabled? %> <%= render "zebra_settings" %> <% end %> diff --git a/app/views/users/settings/account/addons/index.html.erb b/app/views/users/settings/account/addons/index.html.erb index 38d0f67e5..1d51335cb 100644 --- a/app/views/users/settings/account/addons/index.html.erb +++ b/app/views/users/settings/account/addons/index.html.erb @@ -20,7 +20,7 @@

<%= t('users.settings.account.addons.label_printers') %>

- <% if Rails.configuration.x.zebra_print_enabled %> + <% if LabelPrinter.zebra_print_enabled? %>
diff --git a/config/application.rb b/config/application.rb index dcbbdaa1c..3502399c5 100644 --- a/config/application.rb +++ b/config/application.rb @@ -57,8 +57,6 @@ module Scinote config.x.webhooks_enabled = ENV['ENABLE_WEBHOOKS'] == 'true' - config.x.zebra_print_enabled = ENV['SCINOTE_ZEBRA_PRINT_ENABLED'] == 'true' - # Logging config.log_formatter = proc do |severity, datetime, progname, msg| "[#{datetime}] #{severity}: #{msg}\n"