spree_backend 2.1.3 → 2.1.4
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.
- checksums.yaml +4 -4
- data/app/assets/javascripts/admin/admin.js.erb +10 -9
- data/app/assets/javascripts/admin/line_items.js.coffee +61 -0
- data/app/assets/javascripts/admin/payments/edit.js.coffee +1 -1
- data/app/assets/javascripts/admin/product_picker.js +2 -1
- data/app/assets/javascripts/admin/progress.coffee +2 -2
- data/app/assets/javascripts/admin/shipments.js.erb +242 -0
- data/app/assets/javascripts/admin/variant_autocomplete.js.erb +0 -244
- data/app/assets/javascripts/admin/variant_management.js.coffee +10 -0
- data/app/assets/stylesheets/admin/sections/_log_entries.scss +17 -0
- data/app/assets/stylesheets/admin/spree_admin.scss +1 -0
- data/app/assets/stylesheets/admin/spree_backend.css +1 -1
- data/app/controllers/spree/admin/images_controller.rb +1 -1
- data/app/controllers/spree/admin/log_entries_controller.rb +19 -0
- data/app/controllers/spree/admin/mail_methods_controller.rb +1 -8
- data/app/controllers/spree/admin/orders/customer_details_controller.rb +4 -0
- data/app/controllers/spree/admin/orders_controller.rb +9 -14
- data/app/controllers/spree/admin/payments_controller.rb +4 -0
- data/app/controllers/spree/admin/products_controller.rb +7 -11
- data/app/controllers/spree/admin/reports_controller.rb +20 -4
- data/app/controllers/spree/admin/resource_controller.rb +6 -3
- data/app/controllers/spree/admin/taxons_controller.rb +1 -2
- data/app/controllers/spree/admin/variants_including_master_controller.rb +15 -0
- data/app/helpers/spree/admin/base_helper.rb +1 -1
- data/app/helpers/spree/admin/navigation_helper.rb +5 -2
- data/app/helpers/spree/admin/orders_helper.rb +42 -0
- data/app/helpers/spree/admin/stock_movements_helper.rb +5 -1
- data/app/views/spree/admin/log_entries/_credit_card.html.erb +4 -0
- data/app/views/spree/admin/log_entries/index.html.erb +28 -0
- data/app/views/spree/admin/mail_methods/_form.html.erb +2 -2
- data/app/views/spree/admin/orders/_form.html.erb +9 -1
- data/app/views/spree/admin/orders/_line_items.html.erb +46 -0
- data/app/views/spree/admin/orders/_risk_analysis.html.erb +47 -0
- data/app/views/spree/admin/orders/_shipment.html.erb +11 -3
- data/app/views/spree/admin/orders/_shipment_manifest.html.erb +7 -3
- data/app/views/spree/admin/orders/customer_details/_form.html.erb +1 -1
- data/app/views/spree/admin/orders/customer_details/edit.html.erb +7 -9
- data/app/views/spree/admin/orders/index.html.erb +11 -5
- data/app/views/spree/admin/payment_methods/_form.html.erb +0 -2
- data/app/views/spree/admin/payments/_list.html.erb +2 -2
- data/app/views/spree/admin/payments/show.html.erb +2 -1
- data/app/views/spree/admin/products/_add_stock_form.html.erb +1 -1
- data/app/views/spree/admin/products/_form.html.erb +0 -1
- data/app/views/spree/admin/products/stock.html.erb +10 -1
- data/app/views/spree/admin/shared/_destroy.js.erb +5 -14
- data/app/views/spree/admin/shared/_head.html.erb +6 -2
- data/app/views/spree/admin/shared/_order_tabs.html.erb +4 -4
- data/app/views/spree/admin/variants/update.js.erb +1 -0
- data/config/routes.rb +3 -0
- data/vendor/assets/javascripts/spin.js +356 -296
- metadata +29 -19
@@ -19,7 +19,7 @@ module Spree
|
|
19
19
|
def load_data
|
20
20
|
@product = Product.find_by_permalink(params[:product_id])
|
21
21
|
@variants = @product.variants.collect do |variant|
|
22
|
-
[variant.
|
22
|
+
[variant.sku_and_options_text, variant.id]
|
23
23
|
end
|
24
24
|
@variants.insert(0, [Spree.t(:all), @product.master.id])
|
25
25
|
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Spree
|
2
|
+
module Admin
|
3
|
+
class LogEntriesController < Spree::Admin::BaseController
|
4
|
+
before_filter :find_order_and_payment
|
5
|
+
|
6
|
+
def index
|
7
|
+
@log_entries = @payment.log_entries
|
8
|
+
end
|
9
|
+
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def find_order_and_payment
|
14
|
+
@order = Spree::Order.where(:number => params[:order_id]).first!
|
15
|
+
@payment = @order.payments.find(params[:payment_id])
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -1,8 +1,6 @@
|
|
1
1
|
module Spree
|
2
2
|
module Admin
|
3
3
|
class MailMethodsController < Spree::Admin::BaseController
|
4
|
-
after_filter :initialize_mail_settings
|
5
|
-
|
6
4
|
def update
|
7
5
|
if params[:smtp_password].blank?
|
8
6
|
params.delete(:smtp_password)
|
@@ -14,7 +12,7 @@ module Spree
|
|
14
12
|
end
|
15
13
|
|
16
14
|
flash[:success] = Spree.t(:successfully_updated, :resource => Spree.t(:mail_methods))
|
17
|
-
|
15
|
+
redirect_to edit_admin_mail_method_url
|
18
16
|
end
|
19
17
|
|
20
18
|
def testmail
|
@@ -28,11 +26,6 @@ module Spree
|
|
28
26
|
ensure
|
29
27
|
redirect_to edit_admin_mail_method_url
|
30
28
|
end
|
31
|
-
|
32
|
-
private
|
33
|
-
def initialize_mail_settings
|
34
|
-
Spree::Core::MailSettings.init
|
35
|
-
end
|
36
29
|
end
|
37
30
|
end
|
38
31
|
end
|
@@ -10,7 +10,7 @@ module Spree
|
|
10
10
|
def index
|
11
11
|
params[:q] ||= {}
|
12
12
|
params[:q][:completed_at_not_null] ||= '1' if Spree::Config[:show_only_complete_orders_by_default]
|
13
|
-
@show_only_completed = params[:q][:completed_at_not_null]
|
13
|
+
@show_only_completed = params[:q][:completed_at_not_null] == '1'
|
14
14
|
params[:q][:s] ||= @show_only_completed ? 'completed_at desc' : 'created_at desc'
|
15
15
|
|
16
16
|
# As date params are deleted if @show_only_completed, store
|
@@ -35,7 +35,11 @@ module Spree
|
|
35
35
|
end
|
36
36
|
|
37
37
|
@search = Order.accessible_by(current_ability, :index).ransack(params[:q])
|
38
|
-
|
38
|
+
|
39
|
+
# lazyoading other models here (via includes) may result in an invalid query
|
40
|
+
# e.g. SELECT DISTINCT DISTINCT "spree_orders".id, "spree_orders"."created_at" AS alias_0 FROM "spree_orders"
|
41
|
+
# see https://github.com/spree/spree/pull/3919
|
42
|
+
@orders = @search.result(distinct: true).
|
39
43
|
page(params[:page]).
|
40
44
|
per(params[:per_page] || Spree::Config[:orders_per_page])
|
41
45
|
|
@@ -58,25 +62,17 @@ module Spree
|
|
58
62
|
end
|
59
63
|
|
60
64
|
def update
|
61
|
-
return_path = nil
|
62
65
|
if @order.update_attributes(params[:order]) && @order.line_items.present?
|
63
66
|
@order.update!
|
64
67
|
unless @order.complete?
|
65
68
|
# Jump to next step if order is not complete.
|
66
|
-
|
67
|
-
else
|
68
|
-
# Otherwise, go back to first page since all necessary information has been filled out.
|
69
|
-
return_path = admin_order_path(@order)
|
69
|
+
redirect_to admin_order_customer_path(@order) and return
|
70
70
|
end
|
71
71
|
else
|
72
72
|
@order.errors.add(:line_items, Spree.t('errors.messages.blank')) if @order.line_items.empty?
|
73
73
|
end
|
74
74
|
|
75
|
-
|
76
|
-
redirect_to return_path
|
77
|
-
else
|
78
|
-
render :action => :edit
|
79
|
-
end
|
75
|
+
render :action => :edit
|
80
76
|
end
|
81
77
|
|
82
78
|
def fire
|
@@ -118,9 +114,8 @@ module Spree
|
|
118
114
|
end
|
119
115
|
|
120
116
|
private
|
121
|
-
|
122
117
|
def load_order
|
123
|
-
@order = Order.includes(:adjustments).find_by_number!(params[:id])
|
118
|
+
@order = Order.includes(:adjustments).find_by_number!(params[:id])
|
124
119
|
authorize! action, @order
|
125
120
|
end
|
126
121
|
|
@@ -90,15 +90,11 @@ module Spree
|
|
90
90
|
# @search needs to be defined as this is passed to search_form_for
|
91
91
|
@search = @collection.ransack(params[:q])
|
92
92
|
@collection = @search.result.
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
if params[:q][:s].include?("master_default_price_amount")
|
99
|
-
# PostgreSQL compatibility
|
100
|
-
@collection = @collection.group("spree_prices.amount")
|
101
|
-
end
|
93
|
+
distinct_by_product_ids(params[:q][:s]).
|
94
|
+
includes(product_includes).
|
95
|
+
page(params[:page]).
|
96
|
+
per(Spree::Config[:admin_products_per_page])
|
97
|
+
|
102
98
|
@collection
|
103
99
|
end
|
104
100
|
|
@@ -114,9 +110,9 @@ module Spree
|
|
114
110
|
end
|
115
111
|
|
116
112
|
def product_includes
|
117
|
-
|
113
|
+
[{ :variants => [:images, { :option_values => :option_type }], :master => [:images, :default_price]}]
|
118
114
|
end
|
119
|
-
|
115
|
+
|
120
116
|
def clone_object_url resource
|
121
117
|
clone_admin_product_url resource
|
122
118
|
end
|
@@ -3,12 +3,26 @@ module Spree
|
|
3
3
|
class ReportsController < Spree::Admin::BaseController
|
4
4
|
respond_to :html
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
6
|
+
class << self
|
7
|
+
def available_reports
|
8
|
+
@@available_reports
|
9
|
+
end
|
10
|
+
|
11
|
+
def add_available_report!(report_key, report_description_key = nil)
|
12
|
+
if report_description_key.nil?
|
13
|
+
report_description_key = "#{report_key}_description"
|
14
|
+
end
|
15
|
+
@@available_reports[report_key] = {name: Spree.t(report_key), description: Spree.t(report_description_key)}
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def initialize
|
20
|
+
super
|
21
|
+
ReportsController.add_available_report!(:sales_total)
|
22
|
+
end
|
9
23
|
|
10
24
|
def index
|
11
|
-
@reports =
|
25
|
+
@reports = ReportsController.available_reports
|
12
26
|
end
|
13
27
|
|
14
28
|
def sales_total
|
@@ -50,6 +64,8 @@ module Spree
|
|
50
64
|
Spree::Admin::ReportsController
|
51
65
|
end
|
52
66
|
|
67
|
+
@@available_reports = {}
|
68
|
+
|
53
69
|
end
|
54
70
|
end
|
55
71
|
end
|
@@ -6,20 +6,23 @@ class Spree::Admin::ResourceController < Spree::Admin::BaseController
|
|
6
6
|
rescue_from ActiveRecord::RecordNotFound, :with => :resource_not_found
|
7
7
|
|
8
8
|
respond_to :html
|
9
|
-
respond_to :js, :except => [:show, :index]
|
10
9
|
|
11
10
|
def new
|
12
11
|
invoke_callbacks(:new_action, :before)
|
13
12
|
respond_with(@object) do |format|
|
14
13
|
format.html { render :layout => !request.xhr? }
|
15
|
-
|
14
|
+
if request.xhr?
|
15
|
+
format.js { render :layout => false }
|
16
|
+
end
|
16
17
|
end
|
17
18
|
end
|
18
19
|
|
19
20
|
def edit
|
20
21
|
respond_with(@object) do |format|
|
21
22
|
format.html { render :layout => !request.xhr? }
|
22
|
-
|
23
|
+
if request.xhr?
|
24
|
+
format.js { render :layout => false }
|
25
|
+
end
|
23
26
|
end
|
24
27
|
end
|
25
28
|
|
@@ -71,7 +71,7 @@ module Spree
|
|
71
71
|
when :integer
|
72
72
|
text_field_tag(name, value, preference_field_options(options))
|
73
73
|
when :boolean
|
74
|
-
hidden_field_tag(name, 0) +
|
74
|
+
hidden_field_tag(name, 0, id: "#{name}_hidden") +
|
75
75
|
check_box_tag(name, 1, value, preference_field_options(options))
|
76
76
|
when :string
|
77
77
|
text_field_tag(name, value, preference_field_options(options))
|
@@ -29,7 +29,9 @@ module Spree
|
|
29
29
|
link = link_to(titleized_label, destination_url)
|
30
30
|
end
|
31
31
|
|
32
|
-
selected = if options[:match_path]
|
32
|
+
selected = if options[:match_path].is_a? Regexp
|
33
|
+
request.fullpath =~ options[:match_path]
|
34
|
+
elsif options[:match_path]
|
33
35
|
request.fullpath.starts_with?("#{admin_path}#{options[:match_path]}")
|
34
36
|
else
|
35
37
|
args.include?(controller.controller_name.to_sym)
|
@@ -69,8 +71,9 @@ module Spree
|
|
69
71
|
end
|
70
72
|
|
71
73
|
def link_to_edit(resource, options={})
|
74
|
+
url = options[:url] || edit_object_url(resource)
|
72
75
|
options[:data] = {:action => 'edit'}
|
73
|
-
link_to_with_icon('icon-edit', Spree.t(:edit),
|
76
|
+
link_to_with_icon('icon-edit', Spree.t(:edit), url, options)
|
74
77
|
end
|
75
78
|
|
76
79
|
def link_to_edit_url(url, options={})
|
@@ -18,6 +18,48 @@ module Spree
|
|
18
18
|
def line_item_shipment_price(line_item, quantity)
|
19
19
|
Spree::Money.new(line_item.price * quantity, { currency: line_item.currency })
|
20
20
|
end
|
21
|
+
|
22
|
+
def avs_response_code
|
23
|
+
{
|
24
|
+
"A" => "Street address matches, but 5-digit and 9-digit postal code do not match.",
|
25
|
+
"B" => "Street address matches, but postal code not verified.",
|
26
|
+
"C" => "Street address and postal code do not match.",
|
27
|
+
"D" => "Street address and postal code match. ",
|
28
|
+
"E" => "AVS data is invalid or AVS is not allowed for this card type.",
|
29
|
+
"F" => "Card member's name does not match, but billing postal code matches.",
|
30
|
+
"G" => "Non-U.S. issuing bank does not support AVS.",
|
31
|
+
"H" => "Card member's name does not match. Street address and postal code match.",
|
32
|
+
"I" => "Address not verified.",
|
33
|
+
"J" => "Card member's name, billing address, and postal code match.",
|
34
|
+
"K" => "Card member's name matches but billing address and billing postal code do not match.",
|
35
|
+
"L" => "Card member's name and billing postal code match, but billing address does not match.",
|
36
|
+
"M" => "Street address and postal code match. ",
|
37
|
+
"N" => "Street address and postal code do not match.",
|
38
|
+
"O" => "Card member's name and billing address match, but billing postal code does not match.",
|
39
|
+
"P" => "Postal code matches, but street address not verified.",
|
40
|
+
"Q" => "Card member's name, billing address, and postal code match.",
|
41
|
+
"R" => "System unavailable.",
|
42
|
+
"S" => "Bank does not support AVS.",
|
43
|
+
"T" => "Card member's name does not match, but street address matches.",
|
44
|
+
"U" => "Address information unavailable. Returned if the U.S. bank does not support non-U.S. AVS or if the AVS in a U.S. bank is not functioning properly.",
|
45
|
+
"V" => "Card member's name, billing address, and billing postal code match.",
|
46
|
+
"W" => "Street address does not match, but 9-digit postal code matches.",
|
47
|
+
"X" => "Street address and 9-digit postal code match.",
|
48
|
+
"Y" => "Street address and 5-digit postal code match.",
|
49
|
+
"Z" => "Street address does not match, but 5-digit postal code matches."
|
50
|
+
}
|
51
|
+
end
|
52
|
+
|
53
|
+
def cvv_response_code
|
54
|
+
{
|
55
|
+
"M" => "CVV2 Match",
|
56
|
+
"N" => "CVV2 No Match",
|
57
|
+
"P" => "Not Processed",
|
58
|
+
"S" => "Issuer indicates that CVV2 data should be present on the card, but the merchant has indicated data is not present on the card",
|
59
|
+
"U" => "Issuer has not certified for CVV2 or Issuer has not provided Visa with the CVV2 encryption keys",
|
60
|
+
"" => "Transaction failed because wrong CVV2 number was entered or no CVV2 number was entered"
|
61
|
+
}
|
62
|
+
end
|
21
63
|
end
|
22
64
|
end
|
23
65
|
end
|
@@ -3,7 +3,11 @@ module Spree
|
|
3
3
|
module StockMovementsHelper
|
4
4
|
def pretty_originator(stock_movement)
|
5
5
|
if stock_movement.originator.respond_to?(:number)
|
6
|
-
|
6
|
+
if stock_movement.originator.respond_to?(:order)
|
7
|
+
link_to stock_movement.originator.number, [:edit, :admin, stock_movement.originator.order]
|
8
|
+
else
|
9
|
+
stock_movement.originator.number
|
10
|
+
end
|
7
11
|
else
|
8
12
|
""
|
9
13
|
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<%= render :partial => 'spree/admin/shared/order_tabs', locals: { current: 'Payments' }%>
|
2
|
+
|
3
|
+
<% content_for :page_title do %>
|
4
|
+
<i class="icon-arrow-right"></i>
|
5
|
+
<%= I18n.t(:one, scope: "activerecord.models.spree/payment") %>
|
6
|
+
<i class="icon-arrow-right"></i>
|
7
|
+
<%= Spree.t(:log_entries) %>
|
8
|
+
<% end %>
|
9
|
+
|
10
|
+
<% content_for :page_actions do %>
|
11
|
+
<li><%= button_link_to Spree.t(:logs), spree.admin_order_payment_log_entries_url(@order, @payment), :icon => 'icon-archive' %></li>
|
12
|
+
<li><%= button_link_to Spree.t(:back_to_payment), spree.admin_order_payment_url(@order, @payment), :icon => 'icon-arrow-left' %></li>
|
13
|
+
<% end %>
|
14
|
+
|
15
|
+
<table class='index' id='listing_log_entries'>
|
16
|
+
<% @log_entries.each do |entry| %>
|
17
|
+
<thead>
|
18
|
+
<tr class="log_entry <%= entry.parsed_details.success? ? 'success' : 'fail' %>">
|
19
|
+
<td colspan='2'>
|
20
|
+
<h4><i class='icon icon-<%= entry.parsed_details.success? ? 'ok-circle' : 'remove-sign' %>'></i> <%= pretty_time(entry.created_at) %></h4>
|
21
|
+
</td>
|
22
|
+
</tr>
|
23
|
+
</thead>
|
24
|
+
<tbody>
|
25
|
+
<%= render "spree/admin/log_entries/#{@payment.payment_method.name.gsub(' ', '').underscore}", entry: entry %>
|
26
|
+
</tbody>
|
27
|
+
<% end %>
|
28
|
+
</table>
|
@@ -64,11 +64,11 @@
|
|
64
64
|
</div>
|
65
65
|
<div class="field">
|
66
66
|
<%= label_tag :smtp_username, Spree.t(:smtp_username) %><br />
|
67
|
-
<%= text_field_tag :smtp_username, Spree::Config[:smtp_username], :class => 'fullwidth' %>
|
67
|
+
<%= text_field_tag :smtp_username, Spree::Config[:smtp_username], :class => 'fullwidth', :autocomplete => 'off' %>
|
68
68
|
</div>
|
69
69
|
<div class="field">
|
70
70
|
<%= label_tag :preferred_smtp_password, Spree.t(:smtp_password) %><br />
|
71
|
-
<%= password_field_tag :smtp_password, Spree::Config[:smtp_password], :class => 'fullwidth' %>
|
71
|
+
<%= password_field_tag :smtp_password, Spree::Config[:smtp_password], :class => 'fullwidth', :autocomplete => 'off' %>
|
72
72
|
</div>
|
73
73
|
</fieldset>
|
74
74
|
</div>
|
@@ -3,7 +3,11 @@
|
|
3
3
|
<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @line_item } %>
|
4
4
|
<% end %>
|
5
5
|
|
6
|
-
|
6
|
+
<% if Spree::Order.checkout_step_names.include?(:delivery) %>
|
7
|
+
<%= render :partial => "spree/admin/orders/shipment", :collection => @order.shipments, :locals => { :order => order } %>
|
8
|
+
<% else %>
|
9
|
+
<%= render :partial => "spree/admin/orders/line_items", :locals => { :order => order } %>
|
10
|
+
<% end %>
|
7
11
|
<% if order.adjustments.eligible.exists? %>
|
8
12
|
<fieldset class="no-border-bottom">
|
9
13
|
<legend><%= Spree.t('adjustments') %></legend>
|
@@ -32,6 +36,10 @@
|
|
32
36
|
</fieldset>
|
33
37
|
<% end %>
|
34
38
|
|
39
|
+
<% if @order.payments.exists? %>
|
40
|
+
<%= render 'spree/admin/orders/risk_analysis', latest_payment: @order.payments.order("created_at DESC").first %>
|
41
|
+
<% end %>
|
42
|
+
|
35
43
|
<%= javascript_tag do -%>
|
36
44
|
var order_number = '<%= @order.number %>';
|
37
45
|
var shipments = [];
|
@@ -0,0 +1,46 @@
|
|
1
|
+
<% if order.line_items.exists? %>
|
2
|
+
<table class="line-items index" data-hook="line-items">
|
3
|
+
<colgroup>
|
4
|
+
<col style="width: 10%;" />
|
5
|
+
<col style="width: 20%;" />
|
6
|
+
<col style="width: 20%;" />
|
7
|
+
<col style="width: 15%;" />
|
8
|
+
</colgroup>
|
9
|
+
|
10
|
+
<thead>
|
11
|
+
<th colspan="2"><%= Spree.t(:name) %></th>
|
12
|
+
<th><%= Spree.t(:price) %></th>
|
13
|
+
<th><%= Spree.t(:quantity) %></th>
|
14
|
+
<th><%= Spree.t(:total_price) %></th>
|
15
|
+
<th class="orders-actions actions" data-hook="admin_order_form_line_items_header_actions"> </th>
|
16
|
+
</thead>
|
17
|
+
|
18
|
+
<tbody>
|
19
|
+
<% order.line_items.each do |item| %>
|
20
|
+
|
21
|
+
<tr class="line-item" id="line-item-<%= item.id %>">
|
22
|
+
<td class="line-item-image"><%= mini_image(item.variant) %></td>
|
23
|
+
<td class="line-item-name">
|
24
|
+
<%= item.variant.product.name %><br><%= "(" + variant_options(item.variant) + ")" unless item.variant.option_values.empty? %>
|
25
|
+
</td>
|
26
|
+
<td class="line-item-price align-center"><%= item.single_money.to_html %></td>
|
27
|
+
<td class="line-item-qty-show align-center">
|
28
|
+
<%= item.quantity %>
|
29
|
+
</td>
|
30
|
+
<td class="line-item-qty-edit hidden">
|
31
|
+
<%= number_field_tag :quantity, item.quantity, :min => 0, :class => "line_item_quantity", :size => 5 %>
|
32
|
+
</td>
|
33
|
+
<td class="line-item-total align-center"><%= line_item_shipment_price(item, item.quantity) %></td>
|
34
|
+
<td class="cart-line-item-delete actions" data-hook="cart_line_item_delete">
|
35
|
+
<% if can? :update, item %>
|
36
|
+
<%= link_to '', '#', :class => 'save-line-item icon_link icon-ok no-text with-tip', :data => { 'line-item-id' => item.id, :action => 'save'}, :title => Spree.t('actions.save'), :style => 'display: none' %>
|
37
|
+
<%= link_to '', '#', :class => 'cancel-line-item icon_link icon-cancel no-text with-tip', :data => {:action => 'cancel'}, :title => Spree.t('actions.cancel'), :style => 'display: none' %>
|
38
|
+
<%= link_to '', '#', :class => 'edit-line-item icon_link icon-edit no-text with-tip', :data => {:action => 'edit'}, :title => Spree.t('edit') %>
|
39
|
+
<%= link_to '', '#', :class => 'delete-line-item icon-trash no-text with-tip', :data => { 'line-item-id' => item.id, :action => 'remove'}, :title => Spree.t('delete') %>
|
40
|
+
<% end %>
|
41
|
+
</td>
|
42
|
+
</tr>
|
43
|
+
<% end %>
|
44
|
+
</tbody>
|
45
|
+
</table>
|
46
|
+
<% end %>
|
@@ -0,0 +1,47 @@
|
|
1
|
+
<fieldset class="no-border-bottom">
|
2
|
+
<legend><%= Spree.t(:risk_analysis) %></legend>
|
3
|
+
<table>
|
4
|
+
<thead>
|
5
|
+
<th><%= Spree.t('risk')%></th>
|
6
|
+
<th><%= Spree.t('status')%></th>
|
7
|
+
</thead>
|
8
|
+
<tbody id="risk-analysis" data-hook="order_details_adjustments" class="with-border">
|
9
|
+
<tr class="">
|
10
|
+
<td><strong>
|
11
|
+
<%= Spree.t(:failed_payment_attempts) %>:
|
12
|
+
</strong></td>
|
13
|
+
<td class="align-center">
|
14
|
+
<span class="<%= @order.is_risky? ? 'state void' : 'state complete' %>">
|
15
|
+
<%= link_to "#{pluralize(@order.payments.failed.count, Spree.t(:payment))}", spree.admin_order_payments_path(@order) %>
|
16
|
+
</span>
|
17
|
+
</td>
|
18
|
+
</tr>
|
19
|
+
|
20
|
+
<tr>
|
21
|
+
<td><strong><%= Spree.t(:avs_response) %>:</strong></td>
|
22
|
+
<td class="align-center">
|
23
|
+
<span class="<%= latest_payment.is_avs_risky? ? 'state void' : 'state complete' %>">
|
24
|
+
<% if latest_payment.is_avs_risky? %>
|
25
|
+
<%= "#{Spree.t(:error)}: #{avs_response_code[latest_payment.avs_response]}" %>
|
26
|
+
<% else %>
|
27
|
+
<%= Spree.t(:success) %>
|
28
|
+
<% end %>
|
29
|
+
</span>
|
30
|
+
</td>
|
31
|
+
</tr>
|
32
|
+
|
33
|
+
<tr>
|
34
|
+
<td><strong><%= Spree.t(:cvv_response) %>:</strong></td>
|
35
|
+
<td class="align-center">
|
36
|
+
<span class="<%= latest_payment.is_cvv_risky? ? 'state void' : 'state complete' %>">
|
37
|
+
<% if latest_payment.is_cvv_risky? %>
|
38
|
+
<%= "#{Spree.t(:error)}: #{cvv_response_code[latest_payment.cvv_response_code]}" %>
|
39
|
+
<% else %>
|
40
|
+
<%= Spree.t(:success) %>
|
41
|
+
<% end %>
|
42
|
+
</span>
|
43
|
+
</td>
|
44
|
+
</tr>
|
45
|
+
</tbody>
|
46
|
+
</table>
|
47
|
+
</fieldset>
|
@@ -41,7 +41,7 @@
|
|
41
41
|
<div class="field alpha five columns">
|
42
42
|
<%= label_tag 'selected_shipping_rate_id', Spree.t(:shipping_method) %>
|
43
43
|
<%= select_tag :selected_shipping_rate_id,
|
44
|
-
options_for_select(shipment.shipping_rates.
|
44
|
+
options_for_select(shipment.shipping_rates.with_shipping_method.map {|sr| ["#{sr.name} #{sr.display_price}", sr.id] }, shipment.selected_shipping_rate_id),
|
45
45
|
{:class => 'select2 fullwidth', :data => {'shipment-number' => shipment.number } } %>
|
46
46
|
</div>
|
47
47
|
|
@@ -68,7 +68,7 @@
|
|
68
68
|
|
69
69
|
<tr class="show-method total">
|
70
70
|
<td colspan="4">
|
71
|
-
<% if shipment.adjustment.present? %>
|
71
|
+
<% if shipment.adjustment.present? && shipment.shipping_method.present? %>
|
72
72
|
<strong><%= shipment.adjustment.label %>: <%= shipment.shipping_method.name %></strong>
|
73
73
|
<% else %>
|
74
74
|
<%= Spree.t(:cannot_set_shipping_method_without_address) %>
|
@@ -101,6 +101,14 @@
|
|
101
101
|
</td>
|
102
102
|
</tr>
|
103
103
|
|
104
|
+
<% if @order.special_instructions.present? %>
|
105
|
+
<tr class='special_instructions'>
|
106
|
+
<td colspan="5">
|
107
|
+
<strong><%= Spree.t(:special_instructions) %>: </strong><%= @order.special_instructions %>
|
108
|
+
</td>
|
109
|
+
</tr>
|
110
|
+
<% end %>
|
111
|
+
|
104
112
|
<tr class="show-tracking total">
|
105
113
|
<td colspan="5">
|
106
114
|
<% if shipment.tracking.present? %>
|
@@ -117,4 +125,4 @@
|
|
117
125
|
</tr>
|
118
126
|
</tbody>
|
119
127
|
</table>
|
120
|
-
</div>
|
128
|
+
</div>
|
@@ -1,15 +1,19 @@
|
|
1
1
|
<% shipment.manifest.each do |item| %>
|
2
2
|
<% line_item = order.find_line_item_by_variant(item.variant) %>
|
3
|
-
|
4
3
|
<tr class="stock-item" data-item-quantity="<%= item.quantity %>">
|
5
|
-
<td class="item-image"
|
4
|
+
<td class="item-image">
|
5
|
+
<%= mini_image(item.variant) %>
|
6
|
+
</td>
|
6
7
|
<td class="item-name">
|
7
8
|
<%= item.variant.product.name %><br><%= "(" + variant_options(item.variant) + ")" unless item.variant.option_values.empty? %>
|
9
|
+
<% if item.variant.sku.present? %>
|
10
|
+
<strong><%= Spree.t(:sku) %>:</strong> <%= item.variant.sku %>
|
11
|
+
<% end %>
|
8
12
|
</td>
|
9
13
|
<td class="item-price align-center"><%= line_item.single_money.to_html %></td>
|
10
14
|
<td class="item-qty-show align-center">
|
11
15
|
<% item.states.each do |state,count| %>
|
12
|
-
<%= count %> x <%= state.
|
16
|
+
<%= count %> x <%= Spree.t(state).downcase %>
|
13
17
|
<% end %>
|
14
18
|
</td>
|
15
19
|
<% unless shipment.shipped? %>
|
@@ -19,7 +19,7 @@
|
|
19
19
|
<%= @order.user.nil? ? Spree.t(:say_yes) : Spree.t(:say_no) %>
|
20
20
|
</li>
|
21
21
|
<% else %>
|
22
|
-
<% guest = @order.user.nil?
|
22
|
+
<% guest = @order.user.nil? %>
|
23
23
|
<li>
|
24
24
|
<%= radio_button_tag :guest_checkout, true, guest %>
|
25
25
|
<%= label_tag :guest_checkout_true, Spree.t(:say_yes) %>
|