From bcc02f35e7e2d81fbc21085aba09f566f13f1914 Mon Sep 17 00:00:00 2001 From: luisramos0 Date: Wed, 19 Jun 2019 13:29:30 +0100 Subject: [PATCH] Add new preference to invoice settings: enable invoices --- app/models/spree/app_configuration_decorator.rb | 1 + app/views/admin/invoice_settings/edit.html.haml | 5 +++++ config/locales/en.yml | 7 ++++--- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/models/spree/app_configuration_decorator.rb b/app/models/spree/app_configuration_decorator.rb index 2df7c02ea7..6d0b48f666 100644 --- a/app/models/spree/app_configuration_decorator.rb +++ b/app/models/spree/app_configuration_decorator.rb @@ -29,6 +29,7 @@ Spree::AppConfiguration.class_eval do preference :matomo_site_id, :string, default: nil # Invoices & Receipts + preference :enable_invoices?, :boolean, default: true preference :invoice_style2?, :boolean, default: false preference :enable_receipt_printing?, :boolean, default: false diff --git a/app/views/admin/invoice_settings/edit.html.haml b/app/views/admin/invoice_settings/edit.html.haml index e134356927..85b53999df 100644 --- a/app/views/admin/invoice_settings/edit.html.haml +++ b/app/views/admin/invoice_settings/edit.html.haml @@ -5,6 +5,11 @@ = form_tag main_app.admin_invoice_settings_path, :method => :put do + .field.align-center + = hidden_field_tag 'preferences[enable_invoices?]', '0' + = check_box_tag 'preferences[enable_invoices?]', '1', Spree::Config[:enable_invoices?] + = label_tag nil, t('.enable_invoices?') + .field.align-center = hidden_field_tag 'preferences[invoice_style2?]', '0' = check_box_tag 'preferences[invoice_style2?]', '1', Spree::Config[:invoice_style2?] diff --git a/config/locales/en.yml b/config/locales/en.yml index 6ec88c03fd..7c2ec27cb8 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -359,9 +359,10 @@ en: invoice_settings: edit: - title: Invoice Settings - invoice_style2?: Use the alternative invoice model that includes total tax breakdown per rate and tax rate info per item (not yet suitable for countries displaying prices excluding tax) - enable_receipt_printing?: Show options for printing receipts using thermal printers in order dropdown? + title: "Invoice Settings" + enable_invoices?: "Enable Invoices?" + invoice_style2?: "Use the alternative invoice model that includes total tax breakdown per rate and tax rate info per item (not yet suitable for countries displaying prices excluding tax)" + enable_receipt_printing?: "Show options for printing receipts using thermal printers in order dropdown?" stripe_connect_settings: edit: