diff --git a/app/controllers/admin/enterprises_controller.rb b/app/controllers/admin/enterprises_controller.rb index e5b35473ac..1166f31376 100644 --- a/app/controllers/admin/enterprises_controller.rb +++ b/app/controllers/admin/enterprises_controller.rb @@ -15,6 +15,7 @@ module Admin prepend_before_action :override_sells, only: :create before_action :load_countries, except: [:index, :register, :check_permalink] + before_action :set_enterprise, only: [:edit, :update] before_action :load_methods_and_fees, only: [:edit, :update] before_action :load_groups, only: [:new, :edit, :update, :create] before_action :load_taxons, only: [:new, :edit, :update, :create] @@ -216,6 +217,14 @@ module Admin [:index, :for_order_cycle, :visible, :bulk_update] end + def set_enterprise + @enterprise = @object + return if @enterprise + + flash[:error] = I18n.t(:enterprise_not_found_error) + redirect_to admin_enterprises_path + end + def load_methods_and_fees enterprise_payment_methods = @enterprise.payment_methods.to_a enterprise_shipping_methods = @enterprise.shipping_methods.to_a diff --git a/config/locales/en.yml b/config/locales/en.yml index 1eedd00d20..d3917e1b1f 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -629,7 +629,7 @@ en: price: Price producer: Producer category: Category - sku: SKU + sku: SKU on_hand: "On Hand" on_demand: "On Demand" tax_category: "Tax Category" @@ -641,7 +641,7 @@ en: price: Price producer: Producer category: Category - sku: SKU + sku: SKU on_hand: "On Hand" on_demand: "On Demand" tax_category: "Tax Category" @@ -652,7 +652,7 @@ en: clone: Clone delete: Delete remove: Remove - preview: Preview + preview: Preview image: edit: Edit product_preview: @@ -801,7 +801,7 @@ en: connected_apps_enabled: discover_regen: Discover Regenerative portal affiliate_sales_data: DFC anonymised orders API for research purposes - vine: Voucher Integration Engine (VINE) + vine: Voucher Integration Engine (VINE) update: resource: Connected app settings @@ -1429,7 +1429,7 @@ en: use_limit: Use/Limit customers: Customer net_value: Net Value - active: Active? + active: Active? add_new: Add New no_voucher_yet: No Vouchers yet white_label: @@ -2139,7 +2139,7 @@ en: voucher_not_found: Not found add_voucher_error: There was an error while adding the voucher create_voucher_error: "There was an error while creating the voucher: %{error}" - voucher_redeeming_error: There was an error while trying to redeem your voucher + voucher_redeeming_error: There was an error while trying to redeem your voucher shops: hubs: show_closed_shops: "Show closed shops" @@ -2218,7 +2218,7 @@ en: invoice_column_price_per_unit_without_taxes: "Price Per unit (Excl. tax)" invoice_column_tax_rate: "Tax rate" invoice_tax_total: "GST Total:" - invoice_cancel_and_replace_invoice: "cancels and replaces invoice" + invoice_cancel_and_replace_invoice: "cancels and replaces invoice" tax_invoice: "TAX INVOICE" tax_total: "Total tax (%{rate}):" invoice_shipping_category_delivery: "Delivery" @@ -3440,6 +3440,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using enterprise_register_package_error: "Please select a package" enterprise_register_error: "Could not complete registration for %{enterprise}" enterprise_register_success_notice: "Congratulations! Registration for %{enterprise} is complete!" + enterprise_not_found_error: "Enterprise not found" enterprise_bulk_update_success_notice: "Enterprises updated successfully" enterprise_bulk_update_error: 'Update failed' enterprise_shop_show_error: "The shop you are looking for doesn't exist or is inactive on OFN. Please check other shops." @@ -4733,7 +4734,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using title: "Edit Product Category" destroy: delete_taxon: - success: "Successfully deleted the product category" + success: "Successfully deleted the product category" error: "Unable to delete the product category due to assigned products." form: name: Name @@ -4741,7 +4742,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using meta_description: Meta Description meta_keywords: Meta Keywords description: Description - dfc_id: DFC URI + dfc_id: DFC URI general_settings: edit: legal_settings: "Legal Settings"