spree_core 1.2.0.rc2 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/app/assets/images/noimage/large.png +0 -0
- data/app/assets/javascripts/admin/admin.js.erb +1 -0
- data/app/assets/javascripts/admin/product_autocomplete.js.erb +1 -0
- data/app/assets/javascripts/admin/shipping_methods.js.coffee +10 -0
- data/app/assets/javascripts/admin/zone.js.coffee +39 -0
- data/app/assets/javascripts/store/cart.js.coffee +4 -5
- data/app/assets/javascripts/store/product.js.coffee +1 -2
- data/app/controllers/spree/admin/general_settings_controller.rb +1 -1
- data/app/controllers/spree/admin/images_controller.rb +5 -13
- data/app/controllers/spree/admin/orders_controller.rb +3 -1
- data/app/controllers/spree/admin/products_controller.rb +2 -6
- data/app/controllers/spree/admin/prototypes_controller.rb +2 -2
- data/app/controllers/spree/checkout_controller.rb +12 -23
- data/app/controllers/spree/orders_controller.rb +1 -0
- data/app/helpers/spree/admin/general_settings_helper.rb +13 -0
- data/app/helpers/spree/admin/users_helper.rb +1 -1
- data/app/helpers/spree/base_helper.rb +9 -24
- data/app/helpers/spree/products_helper.rb +2 -6
- data/app/models/spree/ability.rb +3 -3
- data/app/models/spree/address.rb +1 -1
- data/app/models/spree/adjustment.rb +4 -0
- data/app/models/spree/app_configuration.rb +3 -1
- data/app/models/spree/credit_card.rb +1 -1
- data/app/models/spree/inventory_unit.rb +1 -1
- data/app/models/spree/line_item.rb +1 -1
- data/app/models/spree/order.rb +14 -1
- data/app/models/spree/order/checkout.rb +19 -5
- data/app/models/spree/product.rb +37 -29
- data/app/models/spree/product/scopes.rb +2 -2
- data/app/models/spree/shipping_rate.rb +10 -0
- data/app/models/spree/variant.rb +14 -8
- data/app/views/spree/admin/adjustments/_adjustments_table.html.erb +1 -1
- data/app/views/spree/admin/general_settings/edit.html.erb +15 -6
- data/app/views/spree/admin/general_settings/show.html.erb +6 -0
- data/app/views/spree/admin/images/_form.html.erb +4 -8
- data/app/views/spree/admin/orders/_form.html.erb +3 -3
- data/app/views/spree/admin/orders/_line_item.html.erb +2 -2
- data/app/views/spree/admin/orders/index.html.erb +5 -1
- data/app/views/spree/admin/payments/_list.html.erb +1 -1
- data/app/views/spree/admin/payments/index.html.erb +1 -1
- data/app/views/spree/admin/products/index.html.erb +1 -1
- data/app/views/spree/admin/reports/sales_total.html.erb +3 -3
- data/app/views/spree/admin/return_authorizations/_form.html.erb +1 -1
- data/app/views/spree/admin/return_authorizations/index.html.erb +1 -1
- data/app/views/spree/admin/shared/_order_details.html.erb +6 -6
- data/app/views/spree/admin/shared/_order_tabs.html.erb +2 -1
- data/app/views/spree/admin/shared/_update_order_state.js +1 -1
- data/app/views/spree/admin/shipments/edit.html.erb +1 -1
- data/app/views/spree/admin/shipments/index.html.erb +1 -1
- data/app/views/spree/admin/variants/_form.html.erb +2 -2
- data/app/views/spree/admin/variants/index.html.erb +1 -1
- data/app/views/spree/checkout/_address.html.erb +0 -6
- data/app/views/spree/checkout/_delivery.html.erb +1 -5
- data/app/views/spree/checkout/_summary.html.erb +4 -4
- data/app/views/spree/checkout/edit.html.erb +6 -0
- data/app/views/spree/order_mailer/cancel_email.text.erb +7 -7
- data/app/views/spree/order_mailer/confirm_email.text.erb +9 -8
- data/app/views/spree/orders/_adjustments.html.erb +1 -1
- data/app/views/spree/orders/_line_item.html.erb +2 -2
- data/app/views/spree/orders/edit.html.erb +2 -2
- data/app/views/spree/products/_cart_form.html.erb +1 -1
- data/app/views/spree/shared/_google_analytics.html.erb +16 -15
- data/app/views/spree/shared/_order_details.html.erb +24 -22
- data/app/views/spree/shared/_products.html.erb +1 -1
- data/app/views/spree/shipment_mailer/shipped_email.text.erb +6 -6
- data/config/locales/en.yml +21 -0
- data/config/routes.rb +1 -1
- data/lib/generators/spree/install/templates/config/initializers/spree.rb +1 -1
- data/lib/spree/core.rb +1 -0
- data/lib/spree/core/controller_helpers.rb +19 -1
- data/lib/spree/core/engine.rb +0 -1
- data/lib/spree/core/search/base.rb +5 -2
- data/lib/spree/core/version.rb +1 -1
- data/lib/spree/money.rb +16 -0
- data/lib/spree/product_filters.rb +4 -3
- metadata +64 -129
- data/app/assets/javascripts/admin/shipping_methods.js +0 -15
- data/app/assets/javascripts/admin/zone.js +0 -29
- data/app/views/spree/admin/payments/_transaction_list.html.erb +0 -24
- data/lib/spree/core/relation_serialization.rb +0 -9
|
@@ -97,7 +97,7 @@ module Spree
|
|
|
97
97
|
end
|
|
98
98
|
|
|
99
99
|
def quantity_no_less_than_shipped
|
|
100
|
-
already_shipped = order.shipments.reduce(0) { |acc,s| acc + s.inventory_units.
|
|
100
|
+
already_shipped = order.shipments.reduce(0) { |acc,s| acc + s.inventory_units.select { |i| i.variant == variant }.count }
|
|
101
101
|
unless quantity >= already_shipped
|
|
102
102
|
errors.add(:quantity, I18n.t('validation.cannot_be_less_than_shipped_units'))
|
|
103
103
|
end
|
data/app/models/spree/order.rb
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
require 'spree/core/validators/email'
|
|
2
|
+
require 'spree/order/checkout'
|
|
2
3
|
|
|
3
4
|
module Spree
|
|
4
5
|
class Order < ActiveRecord::Base
|
|
5
|
-
|
|
6
|
+
# TODO:
|
|
7
|
+
# Need to use fully qualified name here because during sandbox migration
|
|
8
|
+
# there is a class called Checkout which conflicts if you use this:
|
|
9
|
+
#
|
|
10
|
+
# include Checkout
|
|
11
|
+
#
|
|
12
|
+
# rather than the qualified name. This will most likely be fixed with the
|
|
13
|
+
# 1.3 release.
|
|
14
|
+
include Spree::Order::Checkout
|
|
6
15
|
checkout_flow do
|
|
7
16
|
go_to_state :address
|
|
8
17
|
go_to_state :delivery
|
|
@@ -98,6 +107,10 @@ module Spree
|
|
|
98
107
|
line_items.sum(&:amount)
|
|
99
108
|
end
|
|
100
109
|
|
|
110
|
+
def display_total
|
|
111
|
+
Spree::Money.new(total)
|
|
112
|
+
end
|
|
113
|
+
|
|
101
114
|
def to_param
|
|
102
115
|
number.to_s.to_url.upcase
|
|
103
116
|
end
|
|
@@ -3,26 +3,40 @@ module Spree
|
|
|
3
3
|
module Checkout
|
|
4
4
|
def self.included(klass)
|
|
5
5
|
klass.class_eval do
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
class_attribute :next_event_transitions
|
|
7
|
+
class_attribute :previous_states
|
|
8
|
+
class_attribute :checkout_flow
|
|
9
|
+
class_attribute :checkout_steps
|
|
10
10
|
|
|
11
11
|
def self.checkout_flow(&block)
|
|
12
12
|
if block_given?
|
|
13
13
|
@checkout_flow = block
|
|
14
|
+
define_state_machine!
|
|
14
15
|
else
|
|
15
16
|
@checkout_flow
|
|
16
17
|
end
|
|
17
18
|
end
|
|
18
19
|
|
|
19
20
|
def self.define_state_machine!
|
|
20
|
-
|
|
21
|
+
# Needs to be an ordered hash to preserve flow order
|
|
22
|
+
self.checkout_steps = ActiveSupport::OrderedHash.new
|
|
21
23
|
self.next_event_transitions = []
|
|
22
24
|
self.previous_states = [:cart]
|
|
25
|
+
|
|
26
|
+
# Build the checkout flow using the checkout_flow defined either
|
|
27
|
+
# within the Order class, or a decorator for that class.
|
|
28
|
+
#
|
|
29
|
+
# This method may be called multiple times depending on if the
|
|
30
|
+
# checkout_flow is re-defined in a decorator or not.
|
|
23
31
|
instance_eval(&checkout_flow)
|
|
32
|
+
|
|
24
33
|
klass = self
|
|
25
34
|
|
|
35
|
+
# To avoid a ton of warnings when the state machine is re-defined
|
|
36
|
+
StateMachine::Machine.ignore_method_conflicts = true
|
|
37
|
+
# To avoid multiple occurrences of the same transition being defined
|
|
38
|
+
# On first definition, state_machines will not be defined
|
|
39
|
+
state_machines.clear if respond_to?(:state_machines)
|
|
26
40
|
state_machine :state, :initial => :cart do
|
|
27
41
|
klass.next_event_transitions.each { |t| transition(t.merge(:on => :next)) }
|
|
28
42
|
|
data/app/models/spree/product.rb
CHANGED
|
@@ -30,8 +30,19 @@ module Spree
|
|
|
30
30
|
belongs_to :shipping_category
|
|
31
31
|
|
|
32
32
|
has_one :master,
|
|
33
|
-
:class_name =>
|
|
34
|
-
:conditions => { :is_master => true }
|
|
33
|
+
:class_name => 'Spree::Variant',
|
|
34
|
+
:conditions => { :is_master => true },
|
|
35
|
+
:dependent => :destroy
|
|
36
|
+
|
|
37
|
+
has_many :variants,
|
|
38
|
+
:class_name => 'Spree::Variant',
|
|
39
|
+
:conditions => { :is_master => false, :deleted_at => nil },
|
|
40
|
+
:order => :position
|
|
41
|
+
|
|
42
|
+
has_many :variants_including_master,
|
|
43
|
+
:class_name => 'Spree::Variant',
|
|
44
|
+
:conditions => { :deleted_at => nil },
|
|
45
|
+
:dependent => :destroy
|
|
35
46
|
|
|
36
47
|
delegate_belongs_to :master, :sku, :price, :weight, :height, :width, :depth, :is_master
|
|
37
48
|
delegate_belongs_to :master, :cost_price if Variant.table_exists? && Variant.column_names.include?('cost_price')
|
|
@@ -43,33 +54,13 @@ module Spree
|
|
|
43
54
|
after_save :save_master
|
|
44
55
|
after_save :set_master_on_hand_to_zero_when_product_has_variants
|
|
45
56
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
:conditions => { :is_master => false, :deleted_at => nil },
|
|
49
|
-
:order => 'position ASC'
|
|
57
|
+
delegate :images, :to => :master, :prefix => true
|
|
58
|
+
alias_method :images, :master_images
|
|
50
59
|
|
|
51
|
-
has_many :variants_including_master,
|
|
52
|
-
:class_name => "Spree::Variant",
|
|
53
|
-
:conditions => { :deleted_at => nil },
|
|
54
|
-
:dependent => :destroy
|
|
55
|
-
|
|
56
|
-
has_many :variants_with_only_master,
|
|
57
|
-
:class_name => "Spree::Variant",
|
|
58
|
-
:conditions => { :is_master => true, :deleted_at => nil },
|
|
59
|
-
:dependent => :destroy
|
|
60
|
+
has_many :variant_images, :source => :images, :through => :variants_including_master, :order => :position
|
|
60
61
|
|
|
61
62
|
accepts_nested_attributes_for :variants, :allow_destroy => true
|
|
62
63
|
|
|
63
|
-
def variant_images
|
|
64
|
-
Image.joins("LEFT JOIN #{Variant.quoted_table_name} ON #{Variant.quoted_table_name}.id = #{Spree::Asset.quoted_table_name}.viewable_id").
|
|
65
|
-
where("(#{Spree::Asset.quoted_table_name}.viewable_type = ? AND #{Spree::Asset.quoted_table_name}.viewable_id = ?) OR
|
|
66
|
-
(#{Spree::Asset.quoted_table_name}.viewable_type = ? AND #{Spree::Asset.quoted_table_name}.viewable_id = ?)", Variant.name, self.master.id, Product.name, self.id).
|
|
67
|
-
order("#{Spree::Asset.quoted_table_name}.position").
|
|
68
|
-
extend(Spree::Core::RelationSerialization)
|
|
69
|
-
end
|
|
70
|
-
|
|
71
|
-
alias_method :images, :variant_images
|
|
72
|
-
|
|
73
64
|
validates :name, :price, :permalink, :presence => true
|
|
74
65
|
|
|
75
66
|
attr_accessor :option_values_hash
|
|
@@ -91,18 +82,19 @@ module Spree
|
|
|
91
82
|
|
|
92
83
|
after_initialize :ensure_master
|
|
93
84
|
|
|
94
|
-
def
|
|
95
|
-
|
|
96
|
-
|
|
85
|
+
def variants_with_only_master
|
|
86
|
+
ActiveSupport::Deprecation.warn("[SPREE] Spree::Product#variants_with_only_master will be deprecated in Spree 1.3. Please use Spree::Product#master instead.")
|
|
87
|
+
master
|
|
97
88
|
end
|
|
98
89
|
|
|
90
|
+
|
|
99
91
|
def to_param
|
|
100
92
|
permalink.present? ? permalink : (permalink_was || name.to_s.to_url)
|
|
101
93
|
end
|
|
102
94
|
|
|
103
95
|
# returns true if the product has any variants (the master variant is not a member of the variants array)
|
|
104
96
|
def has_variants?
|
|
105
|
-
variants.
|
|
97
|
+
variants.any?
|
|
106
98
|
end
|
|
107
99
|
|
|
108
100
|
# returns the number of inventory units "on_hand" for this product
|
|
@@ -130,6 +122,13 @@ module Spree
|
|
|
130
122
|
end
|
|
131
123
|
end
|
|
132
124
|
|
|
125
|
+
# override the delete method to set deleted_at value
|
|
126
|
+
# instead of actually deleting the product.
|
|
127
|
+
def delete
|
|
128
|
+
self.update_column(:deleted_at, Time.now)
|
|
129
|
+
variants_including_master.update_all(:deleted_at => Time.now)
|
|
130
|
+
end
|
|
131
|
+
|
|
133
132
|
# Adding properties and option types on creation based on a chosen prototype
|
|
134
133
|
attr_reader :prototype_id
|
|
135
134
|
def prototype_id=(value)
|
|
@@ -215,6 +214,10 @@ module Spree
|
|
|
215
214
|
end
|
|
216
215
|
end
|
|
217
216
|
|
|
217
|
+
def display_price
|
|
218
|
+
Spree::Money.new(price).to_s
|
|
219
|
+
end
|
|
220
|
+
|
|
218
221
|
private
|
|
219
222
|
|
|
220
223
|
# Builds variants from a hash of option types & values
|
|
@@ -260,6 +263,11 @@ module Spree
|
|
|
260
263
|
def save_master
|
|
261
264
|
master.save if master && (master.changed? || master.new_record?)
|
|
262
265
|
end
|
|
266
|
+
|
|
267
|
+
def ensure_master
|
|
268
|
+
return unless new_record?
|
|
269
|
+
self.master ||= Variant.new
|
|
270
|
+
end
|
|
263
271
|
end
|
|
264
272
|
end
|
|
265
273
|
|
|
@@ -27,11 +27,11 @@ module Spree
|
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
add_search_scope :ascend_by_master_price do
|
|
30
|
-
joins(:
|
|
30
|
+
joins(:master).order("#{variant_table_name}.price ASC")
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
add_search_scope :descend_by_master_price do
|
|
34
|
-
joins(:
|
|
34
|
+
joins(:master).order("#{variant_table_name}.price DESC")
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
add_search_scope :price_between do |low, high|
|
data/app/models/spree/variant.rb
CHANGED
|
@@ -51,18 +51,12 @@ module Spree
|
|
|
51
51
|
end
|
|
52
52
|
end
|
|
53
53
|
|
|
54
|
-
# strips all non-price-like characters from the price.
|
|
55
54
|
def price=(price)
|
|
56
|
-
if price.present?
|
|
57
|
-
self[:price] = price.to_s.gsub(/[^0-9\.-]/, '').to_f
|
|
58
|
-
end
|
|
55
|
+
self[:price] = parse_price(price) if price.present?
|
|
59
56
|
end
|
|
60
57
|
|
|
61
|
-
# and cost_price
|
|
62
58
|
def cost_price=(price)
|
|
63
|
-
if price.present?
|
|
64
|
-
self[:cost_price] = price.to_s.gsub(/[^0-9\.-]/, '').to_f
|
|
65
|
-
end
|
|
59
|
+
self[:cost_price] = parse_price(price) if price.present?
|
|
66
60
|
end
|
|
67
61
|
|
|
68
62
|
# returns number of units currently on backorder for this variant.
|
|
@@ -140,6 +134,18 @@ module Spree
|
|
|
140
134
|
|
|
141
135
|
private
|
|
142
136
|
|
|
137
|
+
# strips all non-price-like characters from the price, taking into account locale settings
|
|
138
|
+
def parse_price(price)
|
|
139
|
+
price = price.to_s
|
|
140
|
+
|
|
141
|
+
separator, delimiter = I18n.t([:'number.currency.format.separator', :'number.currency.format.delimiter'])
|
|
142
|
+
non_price_characters = /[^0-9\-#{separator}]/
|
|
143
|
+
price.gsub!(non_price_characters, '') # strip everything else first
|
|
144
|
+
price.gsub!(separator, '.') unless separator == '.' # then replace the locale-specific decimal separator with the standard separator if necessary
|
|
145
|
+
|
|
146
|
+
price.to_d
|
|
147
|
+
end
|
|
148
|
+
|
|
143
149
|
# Ensures a new variant takes the product master price when price is not supplied
|
|
144
150
|
def check_price
|
|
145
151
|
if price.nil?
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<tr id="<%= spree_dom_id(adjustment) %>" data-hook="adjustment_row">
|
|
13
13
|
<td><%= adjustment.created_at.to_s(:date_time24) %></td>
|
|
14
14
|
<td><%= adjustment.label %></td>
|
|
15
|
-
<td><%=
|
|
15
|
+
<td><%= adjustment.display_amount %></td>
|
|
16
16
|
<td class='actions'>
|
|
17
17
|
<%= link_to_edit adjustment, :class => 'edit' %>
|
|
18
18
|
|
|
@@ -4,15 +4,24 @@
|
|
|
4
4
|
|
|
5
5
|
<%= form_tag admin_general_settings_path, :method => :put do %>
|
|
6
6
|
<fieldset id="preferences" data-hook>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
<% @preferences.each do |key|
|
|
8
|
+
type = Spree::Config.preference_type(key) %>
|
|
9
|
+
<%= label_tag(key, t(key) + ': ') + tag(:br) if type != :boolean %>
|
|
10
|
+
<%= preference_field_tag(key, Spree::Config[key], :type => type) %>
|
|
11
|
+
<%= label_tag(key, t(key)) + tag(:br) if type == :boolean %>
|
|
12
|
+
<% end %>
|
|
13
|
+
<p>
|
|
14
|
+
<%= label_tag :currency, t(:currency) %>
|
|
15
|
+
<%= select_tag :currency, currency_options %>
|
|
16
|
+
</p>
|
|
13
17
|
</fieldset>
|
|
18
|
+
|
|
14
19
|
<p class="form-buttons" data-hook="buttons">
|
|
15
20
|
<%= button t(:update) %>
|
|
16
21
|
<%= t(:or) %> <%= link_to t(:cancel), admin_general_settings_url %>
|
|
17
22
|
</p>
|
|
18
23
|
<% end %>
|
|
24
|
+
|
|
25
|
+
<script>
|
|
26
|
+
$('#currency').select2();
|
|
27
|
+
</script>
|
|
@@ -9,6 +9,12 @@
|
|
|
9
9
|
<td><%= Spree::Config[key] %></td>
|
|
10
10
|
</tr>
|
|
11
11
|
<% end %>
|
|
12
|
+
<tr>
|
|
13
|
+
<td colspan="2">
|
|
14
|
+
<%= t(:dollar_amounts_displayed_as, :example => Spree::Money.new(20.99)) %>
|
|
15
|
+
</td>
|
|
16
|
+
</tr>
|
|
17
|
+
|
|
12
18
|
<tr>
|
|
13
19
|
<td colspan="2">
|
|
14
20
|
<%= Spree::Config[:allow_ssl_in_production] ? t(:ssl_will_be_used_in_production_mode) : t(:ssl_will_not_be_used_in_production_mode) %>
|
|
@@ -3,14 +3,10 @@
|
|
|
3
3
|
<td><%= t(:filename) %>:</td>
|
|
4
4
|
<td><%= f.file_field :attachment %></td>
|
|
5
5
|
</tr>
|
|
6
|
-
|
|
7
|
-
<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
</tr>
|
|
11
|
-
<% else %>
|
|
12
|
-
<%= hidden_field_tag :product_id, @product.id %>
|
|
13
|
-
<% end %>
|
|
6
|
+
<tr data-hook="variant">
|
|
7
|
+
<td><%= Spree::Variant.model_name.human %>:</td>
|
|
8
|
+
<td><%= f.select :viewable_id, @variants %></td>
|
|
9
|
+
</tr>
|
|
14
10
|
<tr data-hook="alt_text">
|
|
15
11
|
<td><%= t(:alt_text) %>:</td>
|
|
16
12
|
<td><%= f.text_area :alt %></td>
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
<tbody id="subtotal" data-hook="admin_order_form_subtotal">
|
|
22
22
|
<tr id="subtotal-row">
|
|
23
23
|
<td colspan="3"><b><%= t(:subtotal) %>:</b></td>
|
|
24
|
-
<td class="total"><span><%=
|
|
24
|
+
<td class="total"><span><%= money(@order.item_total) %></span></td>
|
|
25
25
|
<td></td>
|
|
26
26
|
</tr>
|
|
27
27
|
</tbody>
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
<% @order.adjustments.each do |adjustment| %>
|
|
30
30
|
<tr>
|
|
31
31
|
<td colspan="3"><strong><%= adjustment.label %></strong></td>
|
|
32
|
-
<td class="total"><span><%=
|
|
32
|
+
<td class="total"><span><%= adjustment.display_amount %></span></td>
|
|
33
33
|
<td></td>
|
|
34
34
|
</tr>
|
|
35
35
|
<% end %>
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
<tbody id="order-total" data-hook="admin_order_form_total">
|
|
38
38
|
<tr>
|
|
39
39
|
<td colspan="3"><b><%= t(:order_total) %>:</b></td>
|
|
40
|
-
<td class="total"><span id="order_total"><%=
|
|
40
|
+
<td class="total"><span id="order_total"><%= @order.display_total %></span></td>
|
|
41
41
|
<td></td>
|
|
42
42
|
</tr>
|
|
43
43
|
</tbody>
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
<td width="300">
|
|
3
3
|
<%=f.object.variant.product.name%> <%= "(#{f.object.variant.options_text}))" unless f.object.variant.option_values.empty? %>
|
|
4
4
|
</td>
|
|
5
|
-
<td valign="top" class="price"><%=
|
|
5
|
+
<td valign="top" class="price"><%= money(f.object.price) %></td>
|
|
6
6
|
<td valign="top" class="qty"><%= f.number_field :quantity, :min => 0, :style => "width:30px;", :class => "qty" %></td>
|
|
7
|
-
<td valign="top" class="total"><%=
|
|
7
|
+
<td valign="top" class="total"><%= money(f.object.price * f.object.quantity) %></td>
|
|
8
8
|
<td data-hook="admin_order_form_line_item_actions">
|
|
9
9
|
<%= link_to_delete f.object, {:url => admin_order_line_item_url(@order.number, f.object) } %>
|
|
10
10
|
</td>
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
<td><%= link_to t("payment_states.#{order.payment_state}"), admin_order_payments_path(order) if order.payment_state %></td>
|
|
33
33
|
<td><%= link_to t("shipment_states.#{order.shipment_state}"), admin_order_shipments_path(order) if order.shipment_state %></td>
|
|
34
34
|
<td><%= order.email %></td>
|
|
35
|
-
<td><%=
|
|
35
|
+
<td><%= order.display_total %></td>
|
|
36
36
|
<td class='actions' data-hook="admin_orders_index_row_actions">
|
|
37
37
|
<%= link_to_edit_url edit_admin_order_path(order), :title => "admin_edit_#{dom_id(order)}" %>
|
|
38
38
|
</td>
|
|
@@ -82,6 +82,10 @@
|
|
|
82
82
|
<%= f.check_box :completed_at_not_null, {:checked => @show_only_completed}, '1', '' %>
|
|
83
83
|
<%= label_tag nil, t(:show_only_complete_orders) %>
|
|
84
84
|
</p>
|
|
85
|
+
<p>
|
|
86
|
+
<%= f.check_box :inventory_units_shipment_id_null, { }, '1', '0' %>
|
|
87
|
+
<%= label_tag nil, t(:show_only_unfulfilled_orders) %>
|
|
88
|
+
</p>
|
|
85
89
|
<div data-hook="admin_orders_index_search_buttons">
|
|
86
90
|
<p><%= button t(:search) %></p>
|
|
87
91
|
</div>
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<% payments.each do |payment| %>
|
|
10
10
|
<tr data-hook="payments_row">
|
|
11
11
|
<td><%= payment.created_at.to_s(:date_time24) %></td>
|
|
12
|
-
<td><%=
|
|
12
|
+
<td><%= money(payment.amount) %></td>
|
|
13
13
|
<td><%= link_to payment_method_name(payment), admin_order_payment_path(@order, payment) %></td>
|
|
14
14
|
<td><%= t(payment.state, :scope => :payment_states, :default => payment.state.capitalize) %></td>
|
|
15
15
|
<td>
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<%= render :partial => 'spree/admin/shared/order_tabs', :locals => { :current => 'Payments' } %>
|
|
13
13
|
|
|
14
14
|
<% if @order.outstanding_balance? %>
|
|
15
|
-
<p><%= @order.outstanding_balance < 0 ? t(:credit_owed) : t(:balance_due) %> <strong><%=
|
|
15
|
+
<p><%= @order.outstanding_balance < 0 ? t(:credit_owed) : t(:balance_due) %> <strong><%= money(@order.outstanding_balance) %></strong></p>
|
|
16
16
|
<% end %>
|
|
17
17
|
|
|
18
18
|
<h2><%= t(:payments) %></h2>
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
<tr <%= "style='color: red;'" if product.deleted? %> id="<%= spree_dom_id product %>" data-hook="admin_products_index_rows">
|
|
25
25
|
<td><%= product.sku rescue '' %></td>
|
|
26
26
|
<td><%= link_to product.try(:name), edit_admin_product_path(product) %></td>
|
|
27
|
-
<td><%=
|
|
27
|
+
<td><%= money(product.price) rescue '' %></td>
|
|
28
28
|
<td class="actions" data-hook="admin_products_index_row_actions">
|
|
29
29
|
<%= link_to_edit product, :class => 'edit' unless product.deleted? %>
|
|
30
30
|
|
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
<tbody>
|
|
5
5
|
<tr>
|
|
6
6
|
<th scope="row"><%= t(:item_total) %>:</th>
|
|
7
|
-
<td align="right"><%=
|
|
7
|
+
<td align="right"><%= money @item_total %></td>
|
|
8
8
|
</tr>
|
|
9
9
|
<tr>
|
|
10
10
|
<th scope="row"><%= t(:adjustment_total) %>:</th>
|
|
11
|
-
<td align="right"><%=
|
|
11
|
+
<td align="right"><%= money @adjustment_total %></td>
|
|
12
12
|
</tr>
|
|
13
13
|
<tr>
|
|
14
14
|
<th scope="row"><%= t(:sales_total) %>:</th>
|
|
15
|
-
<td align="right"><%=
|
|
15
|
+
<td align="right"><%= money @sales_total %></td>
|
|
16
16
|
</tr>
|
|
17
17
|
</tbody>
|
|
18
18
|
</table>
|