solidus_volume_pricing 0.2.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +5 -5
  2. data/.circleci/config.yml +35 -0
  3. data/.gitignore +1 -0
  4. data/.rubocop.yml +8 -4
  5. data/.rubocop_todo.yml +126 -0
  6. data/CHANGELOG.md +57 -0
  7. data/Gemfile +18 -4
  8. data/Guardfile +3 -1
  9. data/README.md +53 -48
  10. data/Rakefile +2 -0
  11. data/app/assets/javascripts/spree/backend/solidus_volume_pricing.js +1 -15
  12. data/app/controllers/spree/admin/volume_price_models_controller.rb +2 -1
  13. data/app/controllers/spree/admin/volume_prices_controller.rb +3 -1
  14. data/app/decorators/controllers/solidus_volume_pricing/spree/admin/variants_controller_decorator.rb +42 -0
  15. data/app/decorators/helpers/solidus_volume_pricing/spree/base_helper_decorator.rb +31 -0
  16. data/app/decorators/models/solidus_volume_pricing/spree/line_item_decorator.rb +18 -0
  17. data/app/decorators/models/solidus_volume_pricing/spree/user_decorator.rb +17 -0
  18. data/app/decorators/models/solidus_volume_pricing/spree/variant_decorator.rb +21 -0
  19. data/app/models/solidus_volume_pricing/price_display.rb +47 -0
  20. data/app/models/solidus_volume_pricing/pricer.rb +95 -0
  21. data/app/models/solidus_volume_pricing/pricing_options.rb +20 -0
  22. data/app/models/spree/volume_price.rb +43 -26
  23. data/app/models/spree/volume_price_model.rb +6 -4
  24. data/app/overrides/spree/admin/shared/_settings_sub_menu/add_volume_price_model_admin_menu_links.html.erb.deface +5 -0
  25. data/app/overrides/views_decorator.rb +2 -0
  26. data/app/views/spree/admin/shared/_vp_product_tab.html.erb +2 -2
  27. data/app/views/spree/admin/variants/_edit_fields.html.erb +5 -32
  28. data/app/views/spree/admin/variants/volume_prices.html.erb +9 -36
  29. data/app/views/spree/admin/volume_price_models/_form.html.erb +6 -2
  30. data/app/views/spree/admin/volume_price_models/_list.html.erb +8 -4
  31. data/app/views/spree/admin/volume_price_models/_select.html.erb +17 -0
  32. data/app/views/spree/admin/volume_price_models/edit.html.erb +7 -6
  33. data/app/views/spree/admin/volume_price_models/index.html.erb +7 -5
  34. data/app/views/spree/admin/volume_price_models/new.html.erb +5 -5
  35. data/app/views/spree/admin/volume_prices/_table.html.erb +26 -0
  36. data/app/views/spree/admin/volume_prices/_volume_price_fields.html.erb +6 -6
  37. data/app/views/spree/products/_volume_pricing.html.erb +8 -8
  38. data/bin/rails +3 -2
  39. data/config/locales/de.yml +17 -3
  40. data/config/locales/en.yml +21 -2
  41. data/config/locales/pt.yml +6 -2
  42. data/config/locales/ru.yml +6 -2
  43. data/config/locales/sv.yml +6 -2
  44. data/config/locales/tr.yml +6 -2
  45. data/config/routes.rb +3 -1
  46. data/db/migrate/20081119145604_create_volume_prices.rb +3 -1
  47. data/db/migrate/20110203174010_change_display_name_for_volume_prices.rb +3 -1
  48. data/db/migrate/20111206173307_prefix_volume_pricing_table_names.rb +3 -1
  49. data/db/migrate/20121115043422_add_discount_type_column.rb +3 -1
  50. data/db/migrate/20150513200904_add_role_to_volume_price.rb +3 -1
  51. data/db/migrate/20150603143015_create_spree_volume_price_models.rb +3 -1
  52. data/lib/generators/solidus_volume_pricing/install/install_generator.rb +3 -5
  53. data/lib/solidus_volume_pricing.rb +5 -1
  54. data/lib/solidus_volume_pricing/engine.rb +5 -22
  55. data/lib/solidus_volume_pricing/range_from_string.rb +36 -0
  56. data/lib/solidus_volume_pricing/version.rb +5 -3
  57. data/solidus_volume_pricing.gemspec +6 -14
  58. data/spec/controllers/spree/admin/variants_controller_spec.rb +18 -15
  59. data/spec/factories/volume_price_factory.rb +7 -5
  60. data/spec/features/manage_volume_price_models_feature_spec.rb +5 -3
  61. data/spec/features/manage_volume_prices_feature_spec.rb +6 -4
  62. data/spec/helpers/base_helper_spec.rb +3 -1
  63. data/spec/lib/solidus_volume_pricing/range_from_string_spec.rb +61 -0
  64. data/spec/models/solidus_volume_pricing/pricer_spec.rb +673 -0
  65. data/spec/models/solidus_volume_pricing/pricing_options_spec.rb +57 -0
  66. data/spec/models/spree/line_item_spec.rb +24 -21
  67. data/spec/models/spree/order_spec.rb +4 -2
  68. data/spec/models/spree/variant_spec.rb +3 -303
  69. data/spec/models/spree/volume_price_spec.rb +153 -49
  70. data/spec/spec_helper.rb +5 -38
  71. data/spec/support/shoulda.rb +11 -0
  72. metadata +37 -173
  73. data/.hound.yml +0 -40
  74. data/.travis.yml +0 -12
  75. data/CONTRIBUTING.md +0 -81
  76. data/app/controllers/spree/admin/variants_controller_decorator.rb +0 -32
  77. data/app/helpers/spree/base_helper_decorator.rb +0 -19
  78. data/app/models/spree/line_item_decorator.rb +0 -13
  79. data/app/models/spree/user_decorator.rb +0 -10
  80. data/app/models/spree/variant_decorator.rb +0 -104
  81. data/app/overrides/spree/admin/shared/sub_menu/_configuration/add_volume_price_model_admin_menu_links.html.erb.deface +0 -3
  82. data/app/views/spree/admin/volume_prices/_edit_fields.html.erb +0 -31
  83. data/spec/support/capybara.rb +0 -12
  84. data/spec/support/database_cleaner.rb +0 -21
  85. data/spec/support/factory_girl.rb +0 -7
  86. data/spec/support/spree.rb +0 -10
@@ -0,0 +1,5 @@
1
+ <!-- insert_bottom "[data-hook='admin_settings_sub_tabs']" -->
2
+
3
+ <% if can?(:admin, Spree::VolumePriceModel) %>
4
+ <%= tab :volume_price_models, url: spree.admin_volume_price_models_path %>
5
+ <% end %>
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Deface::Override.new(
2
4
  virtual_path: 'spree/admin/shared/_product_tabs',
3
5
  name: 'add_volume_pricing_admin_tab',
@@ -1,3 +1,3 @@
1
- <%= content_tag :li, class: ('active' if current == Spree.t(:volume_pricing)) do %>
2
- <%= link_to_with_icon 'tasks', Spree.t(:volume_pricing), volume_prices_admin_product_variant_url(@product, @product.master) %>
1
+ <%= content_tag :li, class: ('active' if current == t('spree.volume_pricing')) do %>
2
+ <%= link_to t('spree.volume_pricing'), volume_prices_admin_product_variant_url(@product, @product.master) %>
3
3
  <% end %>
@@ -1,33 +1,6 @@
1
- <% content_for :page_actions do %>
2
- <span id="new_add_volume_price" data-hook>
3
- <%= button_link_to Spree.t(:add_volume_price), 'javascript:;', {
4
- icon: 'add', :'data-target' => 'tbody#volume_prices', class: 'btn-success spree_add_fields', id: 'add_volume_price' } %>
5
- </span>
6
- <% end %>
1
+ <fieldset>
2
+ <legend><%= t('spree.volume_prices') %></legend>
7
3
 
8
- <h3><%= Spree.t(:volume_prices) %></h3>
9
- <table class="table">
10
- <thead>
11
- <tr>
12
- <th><%= Spree.t(:name) %></th>
13
- <th><%= Spree.t(:discount_type) %></th>
14
- <th><%= Spree.t(:range) %></th>
15
- <th><%= Spree.t(:amount) %></th>
16
- <th><%= Spree.t(:position) %></th>
17
- <th><%= Spree.t(:role) %></th>
18
- <th><%= Spree.t(:action) %></th>
19
- </tr>
20
- </thead>
21
- <tbody id="volume_prices">
22
- <%= f.fields_for :volume_prices do |vp_form| %>
23
- <%= render partial: 'spree/admin/volume_prices/volume_price_fields', locals: { f: vp_form } %>
24
- <% end %>
25
- </tbody>
26
- <tbody id="volume_price_models">
27
- <%= f.field_container :volume_price_model, class: ['form-group'] do %>
28
- <%= f.label :volume_price_model_id, Spree.t(:volume_price_model) %>
29
- <%= f.collection_select(:volume_price_model_ids, Spree::VolumePriceModel.all, :id, :name, { include_blank: Spree.t('match_choices.none') }, { class: 'select2', disabled: (cannot? :edit, Spree::VolumePriceModel) }) %>
30
- <%= f.error_message_on :volume_price_model %>
31
- <% end %>
32
- </tbody>
33
- </table>
4
+ <%= render 'spree/admin/volume_price_models/select', f: f %>
5
+ <%= render 'spree/admin/volume_prices/table', f: f %>
6
+ </fieldset>
@@ -1,39 +1,12 @@
1
- <%= render 'spree/admin/shared/product_tabs', current: Spree.t(:volume_pricing) %>
1
+ <%= render 'spree/admin/shared/product_tabs', current: t('spree.volume_pricing') %>
2
2
  <%= render 'spree/shared/error_messages', target: @variant %>
3
3
 
4
- <% content_for :page_actions do %>
5
- <span id="new_add_volume_price" data-hook>
6
- <%= button_link_to Spree.t(:add_volume_price), 'javascript:;', {
7
- icon: 'add', :'data-target' => 'tbody#volume_prices', class: 'btn-success spree_add_fields', id: 'add_volume_price'} %>
8
- </span>
9
- <% end %>
4
+ <fieldset>
5
+ <legend><%= t('spree.volume_prices') %></legend>
10
6
 
11
- <%= form_for(@variant, url: admin_product_variant_path(@product, @variant), html: { method: :put }) do |f| %>
12
- <h3><%= Spree.t(:volume_prices) %></h3>
13
- <table class="table">
14
- <thead>
15
- <tr>
16
- <th><%= Spree.t(:name) %></th>
17
- <th><%= Spree.t(:discount_type) %></th>
18
- <th><%= Spree.t(:range) %></th>
19
- <th><%= Spree.t(:amount) %></th>
20
- <th><%= Spree.t(:position) %></th>
21
- <th><%= Spree.t(:role) %></th>
22
- <th class="actions"></th>
23
- </tr>
24
- </thead>
25
- <tbody id="volume_prices">
26
- <%= f.fields_for :volume_prices do |vp_form| %>
27
- <%= render partial: 'spree/admin/volume_prices/volume_price_fields', locals: { f: vp_form } %>
28
- <% end %>
29
- </tbody>
30
- <tbody id="volume_price_models">
31
- <%= f.field_container :volume_price_model, class: ['form-group'] do %>
32
- <%= f.label :volume_price_model_id, Spree.t(:volume_price_model) %>
33
- <%= f.collection_select(:volume_price_model_ids, Spree::VolumePriceModel.all, :id, :name, { include_blank: Spree.t('match_choices.none') }, { class: 'select2', disabled: (cannot? :edit, Spree::VolumePriceModel) }) %>
34
- <%= f.error_message_on :volume_price_model %>
35
- <% end %>
36
- </tbody>
37
- </table>
38
- <%= render 'spree/admin/shared/edit_resource_links' %>
39
- <% end %>
7
+ <%= form_for(@variant, url: admin_product_variant_path(@product, @variant), html: { method: :put }) do |f| %>
8
+ <%= render 'spree/admin/volume_price_models/select', f: f %>
9
+ <%= render 'spree/admin/volume_prices/table', f: f %>
10
+ <%= render 'spree/admin/shared/edit_resource_links' %>
11
+ <% end %>
12
+ </fieldset>
@@ -1,9 +1,13 @@
1
1
  <div data-hook="admin_inside_volume_price_model_form" class="form-group">
2
2
  <%= f.field_container :name, class: ['form-group'] do %>
3
- <%= f.label :name, Spree.t(:name) %> <span class="required">*</span>
3
+ <%= f.label :name, t('spree.name') %> <span class="required">*</span>
4
4
  <%= error_message_on :volume_price_model, :name, :class => 'error-message' %>
5
5
  <%= text_field :volume_price_model, :name, :class => 'form-control' %>
6
6
  <% end %>
7
7
 
8
- <%= render 'spree/admin/volume_prices/edit_fields', f: f %>
8
+ <fieldset>
9
+ <legend><%= t('spree.volume_prices') %></legend>
10
+
11
+ <%= render 'spree/admin/volume_prices/table', f: f %>
12
+ </fieldset>
9
13
  </div>
@@ -1,8 +1,8 @@
1
- <table class="table sortable" id='listing_volume_price_models' data-hook data-sortable-link="<%#= update_positions_admin_volume_price_models_url %>">
1
+ <table class="table sortable" id='listing_volume_price_models' data-hook>
2
2
  <thead>
3
3
  <tr data-hook="volume_price_models_header">
4
4
  <th class="no-border"></th>
5
- <th><%= Spree.t(:name) %></th>
5
+ <th><%= t('spree.name') %></th>
6
6
  <th class="actions"></th>
7
7
  </tr>
8
8
  </thead>
@@ -14,8 +14,12 @@
14
14
  </td>
15
15
  <td><%= price_model.name %></td>
16
16
  <td class="actions actions-2 text-right">
17
- <%= link_to_edit price_model.id, no_text: true %>
18
- <%= link_to_delete price_model, no_text: true %>
17
+ <% if can?(:update, price_model) %>
18
+ <%= link_to_edit price_model, no_text: true %>
19
+ <% end %>
20
+ <% if can?(:destroy, price_model) %>
21
+ <%= link_to_delete price_model, no_text: true %>
22
+ <% end %>
19
23
  </td>
20
24
  </tr>
21
25
  <% end %>
@@ -0,0 +1,17 @@
1
+ <div class="row">
2
+ <div class="col-4">
3
+ <%= f.field_container :volume_price_model, class: ['form-group'] do %>
4
+ <%= f.label :volume_price_model_id, t('spree.volume_price_model') %>
5
+ <%= f.collection_select :volume_price_model_ids,
6
+ Spree::VolumePriceModel.all, :id, :name,
7
+ {
8
+ include_blank: t('spree.match_choices.none')
9
+ },
10
+ {
11
+ class: 'custom-select fullwidth',
12
+ disabled: cannot?(:edit, Spree::VolumePriceModel)
13
+ } %>
14
+ <%= f.error_message_on :volume_price_model %>
15
+ <% end %>
16
+ </div>
17
+ </div>
@@ -1,12 +1,13 @@
1
1
  <% content_for :page_title do %>
2
- <%= Spree.t(:volume_price_model_edit) %>
2
+ <%= t('spree.volume_price_model_edit') %>
3
3
  <% end %>
4
4
 
5
- <%= form_for [:admin, @volume_price_model] do |f| %>
6
- <fieldset>
7
- <%= render partial: 'form', locals: { f: f } %>
8
- </fieldset>
5
+ <% admin_breadcrumb(link_to plural_resource_name(Spree::VolumePriceModel), admin_volume_price_models_path) %>
9
6
 
10
- <%= render 'spree/admin/shared/edit_resource_links' %>
7
+ <%= form_for [:admin, @volume_price_model] do |f| %>
8
+ <%= render partial: 'form', locals: { f: f } %>
11
9
 
10
+ <% if can?(:update, @volume_price_model) %>
11
+ <%= render 'spree/admin/shared/edit_resource_links' %>
12
+ <% end %>
12
13
  <% end %>
@@ -1,9 +1,9 @@
1
1
  <% content_for :page_title do %>
2
- <%= "Volume Price Models" %>
2
+ <%= plural_resource_name(Spree::VolumePriceModel) %>
3
3
  <% end %>
4
4
 
5
5
  <% content_for :page_actions do %>
6
- <%= button_link_to Spree.t(:new_volume_price_model), new_object_url, class: "btn-success", icon: 'add', id: 'admin_new_volume_price_model_link' %>
6
+ <%= link_to t('spree.new_volume_price_model'), new_object_url, class: "btn btn-primary", id: 'admin_new_volume_price_model_link' %>
7
7
  <% end %>
8
8
 
9
9
  <% if @volume_price_models.any? %>
@@ -11,8 +11,10 @@
11
11
  <%= render 'list' %>
12
12
  </div>
13
13
  <% else %>
14
- <div class="alert alert-info no-objects-found">
15
- <%= Spree.t(:no_resource_found, resource: "Volume Price Models") %>,
16
- <%= link_to Spree.t(:add_one), new_object_url %>!
14
+ <div class="no-objects-found">
15
+ <%= t('spree.no_resource_found', resource: plural_resource_name(Spree::VolumePriceModel)) %>,
16
+ <% if can? :create, Spree::VolumePriceModel %>
17
+ <%= link_to t('spree.create_one'), new_object_url %>
18
+ <% end %>
17
19
  </div>
18
20
  <% end %>
@@ -1,12 +1,12 @@
1
1
  <% content_for :page_title do %>
2
- <%= Spree.t(:new_volume_price_model) %>
2
+ <%= t('spree.new_volume_price_model') %>
3
3
  <% end %>
4
4
 
5
+ <% admin_breadcrumb(link_to plural_resource_name(Spree::VolumePriceModel), admin_volume_price_models_path) %>
6
+
5
7
  <%= form_for [:admin, @volume_price_model] do |f| %>
6
- <fieldset>
8
+ <fieldset class="no-border-top">
7
9
  <%= render partial: 'form', locals: { f: f } %>
8
- <div class="form-actions" data-hook="buttons">
9
- <%= button Spree.t(:create), 'save' %>
10
- </div>
10
+ <%= render partial: 'spree/admin/shared/new_resource_links' %>
11
11
  </fieldset>
12
12
  <% end %>
@@ -0,0 +1,26 @@
1
+ <table class="table">
2
+ <thead>
3
+ <tr>
4
+ <th><%= t('spree.name') %></th>
5
+ <th><%= t('spree.discount_type') %></th>
6
+ <th><%= t('spree.range') %></th>
7
+ <th><%= t('spree.amount') %></th>
8
+ <th><%= t('spree.position') %></th>
9
+ <th><%= t('spree.role') %></th>
10
+ <th class="actions"></th>
11
+ </tr>
12
+ </thead>
13
+ <tbody id="volume_prices">
14
+ <%= f.fields_for :volume_prices do |vp_form| %>
15
+ <%= render partial: 'spree/admin/volume_prices/volume_price_fields', locals: { f: vp_form } %>
16
+ <% end %>
17
+ </tbody>
18
+ </table>
19
+
20
+ <span id="new_add_volume_price" data-hook>
21
+ <%= link_to t(:add_volume_price, scope: :spree), 'javascript:;', {
22
+ data: { target: 'tbody#volume_prices' },
23
+ class: 'btn btn-primary spree_add_fields',
24
+ id: 'add_volume_price'
25
+ } %>
26
+ </span>
@@ -6,10 +6,10 @@
6
6
  <td>
7
7
  <%= error_message_on(f.object, :discount_type) %>
8
8
  <%= f.select :discount_type, [
9
- ["#{Spree.t(:total_price)}", 'price'],
10
- ["#{Spree.t(:percent_discount)}", 'percent'],
11
- ["#{Spree.t(:price_discount)}", 'dollar']
12
- ], { include_blank: true }, class: 'select2' %>
9
+ [t('spree.total_price'), 'price'],
10
+ [t('spree.percent_discount'), 'percent'],
11
+ [t('spree.price_discount'), 'dollar']
12
+ ], { include_blank: true }, class: 'custom-select' %>
13
13
  </td>
14
14
  <td>
15
15
  <%= error_message_on(f.object, :range) %>
@@ -25,9 +25,9 @@
25
25
  </td>
26
26
  <td>
27
27
  <%= error_message_on(f.object, :role_id) %>
28
- <%= f.collection_select(:role_id, Spree::Role.all, :id, :name, { include_blank: Spree.t('match_choices.none') }, { class: 'select2' }) %>
28
+ <%= f.collection_select(:role_id, Spree::Role.all, :id, :name, { include_blank: t('spree.match_choices.none') }, { class: 'custom-select' }) %>
29
29
  </td>
30
30
  <td class="actions">
31
- <%= link_to_remove_fields Spree.t(:remove), f, no_text: true %>
31
+ <%= link_to_remove_fields t('spree.remove'), f, no_text: true %>
32
32
  </td>
33
33
  </tr>
@@ -1,15 +1,15 @@
1
1
  <% display_percent ||= false %>
2
2
  <% if product.price > 0 and product.master.volume_prices.present? %>
3
3
  <div id="bulk-discount">
4
- <h6><%= Spree.t(:bulk_discount) %></h6>
4
+ <h6><%= t('spree.bulk_discount') %></h6>
5
5
  <table class="table">
6
- <% product.master.volume_prices.each do |v| %>
7
- <%= content_tag(:tr) do %>
8
- <%= content_tag :td, (v.open_ended? ? v.range : "#{v.range.to_range.begin}–#{v.range.to_range.end}") %>
9
- <%= content_tag :td, Spree::Money.new(v.amount).to_s %>
10
- <%= content_tag(:td, '%i%' % ((1.0 - v.amount / product.master.price) * 100.0).round) if display_percent %>
11
- <% end %>
12
- <% end %>
6
+ <% product.master.volume_prices.each do |v| %>
7
+ <%= content_tag(:tr) do %>
8
+ <%= content_tag :td, v.display_range %>
9
+ <%= content_tag :td, Spree::Money.new(v.amount).to_s %>
10
+ <%= content_tag(:td, '%i%' % ((1.0 - v.amount / product.master.price) * 100.0).round) if display_percent %>
11
+ <% end %>
12
+ <% end %>
13
13
  </table>
14
14
  </div>
15
15
  <% end %>
data/bin/rails CHANGED
@@ -1,7 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
- ENGINE_ROOT = File.expand_path('../..', __FILE__)
4
- ENGINE_PATH = File.expand_path('../../lib/solidus_volume_pricing/engine', __FILE__)
4
+ ENGINE_ROOT = File.expand_path('..', __dir__)
5
+ ENGINE_PATH = File.expand_path('../lib/solidus_volume_pricing/engine', __dir__)
5
6
 
6
7
  require 'rails/all'
7
8
  require 'rails/engine/commands'
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  de:
3
3
  spree:
4
- add_volume_price: Neuen Staffelpreis
4
+ add_volume_price: Neuer Staffelpreis
5
5
  position: Position
6
6
  discount_type:
7
7
  range: Bereich
@@ -10,9 +10,23 @@ de:
10
10
  price_discount:
11
11
  percent_discount:
12
12
  bulk_discount:
13
+ admin:
14
+ tab:
15
+ volume_price_models: Staffelpreismodelle
13
16
  activerecord:
17
+ models:
18
+ spree/volume_price:
19
+ one: Staffelpreis
20
+ other: Staffelpreise
21
+ spree/volume_price_model:
22
+ one: Staffelpreismodell
23
+ other: Staffelpreismodelle
14
24
  errors:
25
+ models:
26
+ spree/volume_price:
27
+ attributes:
28
+ discount_type:
29
+ inclusion: '%{value} ist kein valider Staffelpreistyp'
15
30
  messages:
16
- could_not_conver_to_range:
17
- is_not_a_valid_volume_price_type:
31
+ could_not_convert_to_range:
18
32
  must_be_in_format:
@@ -5,14 +5,33 @@ en:
5
5
  position: Position
6
6
  discount_type: Discount Type
7
7
  range: Range
8
+ role: Role
8
9
  volume_prices: Volume Prices
10
+ volume_price_model: Volume Price Model
11
+ new_volume_price_model: New Volume Price Model
12
+ volume_price_model_edit: Edit Volume Price Model
9
13
  volume_pricing: Volume Pricing
10
14
  price_discount: Price Discount
11
15
  percent_discount: Percent Discount
12
16
  bulk_discount: Bulk Discount
17
+ total_price: Total price
18
+ admin:
19
+ tab:
20
+ volume_price_models: Volume Price Models
13
21
  activerecord:
22
+ models:
23
+ spree/volume_price:
24
+ one: Volume Price
25
+ other: Volume Prices
26
+ spree/volume_price_model:
27
+ one: Volume Price Model
28
+ other: Volume Price Models
14
29
  errors:
30
+ models:
31
+ spree/volume_price:
32
+ attributes:
33
+ discount_type:
34
+ inclusion: '%{value} is not a valid Volume Price Type'
15
35
  messages:
16
- could_not_conver_to_range: "Couldn't convert to Range: %{number}"
17
- is_not_a_valid_volume_price_type: '%{value} is not a valid Volume Price Type'
36
+ could_not_convert_to_range: "Couldn't convert to Range: %{range_string}"
18
37
  must_be_in_format: 'must be in one of the following formats: (a..b), (a...b), (a+)'
@@ -12,7 +12,11 @@ pt:
12
12
  bulk_discount: Desconto por Quantidade
13
13
  activerecord:
14
14
  errors:
15
+ models:
16
+ spree/volume_price:
17
+ attributes:
18
+ discount_type:
19
+ inclusion: '%{value} is not a valid Volume Price Type'
15
20
  messages:
16
- could_not_conver_to_range:
17
- is_not_a_valid_volume_price_type:
21
+ could_not_convert_to_range:
18
22
  must_be_in_format:
@@ -12,7 +12,11 @@ ru:
12
12
  bulk_discount:
13
13
  activerecord:
14
14
  errors:
15
+ models:
16
+ spree/volume_price:
17
+ attributes:
18
+ discount_type:
19
+ inclusion: '%{value} is not a valid Volume Price Type'
15
20
  messages:
16
- could_not_conver_to_range:
17
- is_not_a_valid_volume_price_type:
21
+ could_not_convert_to_range:
18
22
  must_be_in_format:
@@ -12,7 +12,11 @@ sv:
12
12
  bulk_discount: Bulk rabatt
13
13
  activerecord:
14
14
  errors:
15
+ models:
16
+ spree/volume_price:
17
+ attributes:
18
+ discount_type:
19
+ inclusion: '%{value} är inte en giltligt typ för volympris'
15
20
  messages:
16
- could_not_conver_to_range: "Det gick inte att konvertera till omfång: %{number}"
17
- is_not_a_valid_volume_price_type: '%{value} är inte en giltligt typ för volympris'
21
+ could_not_convert_to_range: "Det gick inte att konvertera till omfång: %{range_string}"
18
22
  must_be_in_format: 'måste vara i ett av följande format: (a..b), (a...b), (a+)'
@@ -12,7 +12,11 @@ tr:
12
12
  bulk_discount:
13
13
  activerecord:
14
14
  errors:
15
+ models:
16
+ spree/volume_price:
17
+ attributes:
18
+ discount_type:
19
+ inclusion: '%{value} is not a valid Volume Price Type'
15
20
  messages:
16
- could_not_conver_to_range:
17
- is_not_a_valid_volume_price_type:
21
+ could_not_convert_to_range:
18
22
  must_be_in_format: