spree_temando 0.1.1 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +3 -0
- data/Rakefile +3 -31
- data/app/models/spree/temando_quote.rb +1 -1
- data/app/models/spree_temando/variant_shipping_decorator.rb +1 -0
- data/app/views/spree/admin/shipments/_form.html.erb +83 -0
- data/db/migrate/20121113034743_add_carrier_data_to_temando_quote.rb +7 -0
- data/lib/spree_temando/engine.rb +4 -1
- data/lib/spree_temando/version.rb +1 -1
- metadata +75 -9
data/README.md
CHANGED
@@ -30,6 +30,9 @@ Temando::Api::Base.config.password = ENV['TEMANDO_PASSWORD']
|
|
30
30
|
|
31
31
|
The extension adds a new Shipping calculator.
|
32
32
|
|
33
|
+
*NOTE* this extension assumes that all product dimensions are in
|
34
|
+
centimetres, with weights in kilograms.
|
35
|
+
|
33
36
|
Add a new Shipping Method from the Spree Admin (under Configuration >
|
34
37
|
Shipping Methods), and you can set the relevant calculator type to
|
35
38
|
`Temando`.
|
data/Rakefile
CHANGED
@@ -4,37 +4,9 @@ begin
|
|
4
4
|
rescue LoadError
|
5
5
|
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
6
6
|
end
|
7
|
-
begin
|
8
|
-
require 'rdoc/task'
|
9
|
-
rescue LoadError
|
10
|
-
require 'rdoc/rdoc'
|
11
|
-
require 'rake/rdoctask'
|
12
|
-
RDoc::Task = Rake::RDocTask
|
13
|
-
end
|
14
|
-
|
15
|
-
RDoc::Task.new(:rdoc) do |rdoc|
|
16
|
-
rdoc.rdoc_dir = 'rdoc'
|
17
|
-
rdoc.title = 'SpreeTemando'
|
18
|
-
rdoc.options << '--line-numbers'
|
19
|
-
rdoc.rdoc_files.include('README.rdoc')
|
20
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
21
|
-
end
|
22
|
-
|
23
|
-
APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
|
24
|
-
load 'rails/tasks/engine.rake'
|
25
7
|
|
8
|
+
require 'rspec/core/rake_task'
|
26
9
|
|
10
|
+
RSpec::Core::RakeTask.new('spec')
|
27
11
|
|
28
|
-
|
29
|
-
|
30
|
-
require 'rake/testtask'
|
31
|
-
|
32
|
-
Rake::TestTask.new(:test) do |t|
|
33
|
-
t.libs << 'lib'
|
34
|
-
t.libs << 'test'
|
35
|
-
t.pattern = 'test/**/*_test.rb'
|
36
|
-
t.verbose = false
|
37
|
-
end
|
38
|
-
|
39
|
-
|
40
|
-
task :default => :test
|
12
|
+
task :default => :spec
|
@@ -36,7 +36,7 @@ module Spree
|
|
36
36
|
q.shipment = object
|
37
37
|
end
|
38
38
|
|
39
|
-
[ :total_price, :tax, :currency, :minimum_eta, :maximum_eta, :name, :base_price, :guaranteed_eta, :carrier_id ].each do |field|
|
39
|
+
[ :total_price, :tax, :currency, :minimum_eta, :maximum_eta, :name, :base_price, :guaranteed_eta, :carrier_id, :carrier_name, :carrier_phone, :delivery_method ].each do |field|
|
40
40
|
q.send("#{field}=".to_sym, quote.send(field))
|
41
41
|
end
|
42
42
|
|
@@ -10,6 +10,7 @@ module SpreeTemando
|
|
10
10
|
def to_temando_item
|
11
11
|
return nil unless self.temando_quotable?
|
12
12
|
item = Temando::Item::GeneralGoods.new
|
13
|
+
item.packaging_optimization = self.packaging_optimization
|
13
14
|
# NOTE: All the distances in Temando are in metres
|
14
15
|
item.height = (self.height / 100.0)
|
15
16
|
item.length = (self.depth / 100.0)
|
@@ -0,0 +1,83 @@
|
|
1
|
+
<div data-hook="admin_shipment_form_fields">
|
2
|
+
<% unless @shipment.order.cart? %>
|
3
|
+
<table class="index" style="width:100%;" data-hook="admin_shipment_form_inventory_units">
|
4
|
+
<tr data-hook="shipments_header">
|
5
|
+
<th style="width:130px;"><%= t(:include_in_shipment) %></th>
|
6
|
+
<th><%= t(:sku) %></th>
|
7
|
+
<th><%= t(:item_description) %></th>
|
8
|
+
<th><%= t(:status) %></th>
|
9
|
+
<th><%= t(:note) %></th>
|
10
|
+
</tr>
|
11
|
+
|
12
|
+
<% @shipment.order.inventory_units.each do |inventory_unit| %>
|
13
|
+
<tr data-hook="shipments_row">
|
14
|
+
<td style="text-align:center;">
|
15
|
+
<%= check_box_tag "inventory_units[#{inventory_unit.id}]",
|
16
|
+
:true,
|
17
|
+
(inventory_unit.shipment == @shipment),
|
18
|
+
{ :disabled => %w(shipped backordered returned).include?(inventory_unit.state),
|
19
|
+
:class => 'inventory_unit'} %>
|
20
|
+
</td>
|
21
|
+
<td style="vertical-align:top; width:120px;"><%= inventory_unit.variant.sku %></td>
|
22
|
+
<td style="width:300px;">
|
23
|
+
<%=inventory_unit.variant.product.name %>
|
24
|
+
<%= '(' + variant_options(inventory_unit.variant) + ')' unless inventory_unit.variant.option_values.empty? %>
|
25
|
+
</td>
|
26
|
+
<td><%= t(inventory_unit.state) %></td>
|
27
|
+
<td>
|
28
|
+
<% if inventory_unit.shipment == @shipment %>
|
29
|
+
<%= t(:included_in_this_shipment) %>
|
30
|
+
<% elsif !inventory_unit.shipment.nil? %>
|
31
|
+
<%= t(:included_in_other_shipment) %> - <%= link_to inventory_unit.shipment.number, edit_admin_order_shipment_url(inventory_unit.order, inventory_unit.shipment) %>
|
32
|
+
<% end %>
|
33
|
+
</td>
|
34
|
+
</tr>
|
35
|
+
<% end %>
|
36
|
+
</table>
|
37
|
+
<% end %>
|
38
|
+
|
39
|
+
<div data-hook="admin_shipment_form_address">
|
40
|
+
<% shipment_form.fields_for 'address' do |sa_form| %>
|
41
|
+
<%= render :partial => 'spree/admin/shared/address_form', :locals => { :f => sa_form, :name => t(:shipping_address), :use_billing => false } %>
|
42
|
+
<% end %>
|
43
|
+
</div>
|
44
|
+
|
45
|
+
<div data-hook="admin_shipment_form_details">
|
46
|
+
<table class="index">
|
47
|
+
<tr>
|
48
|
+
<th colspan="8"><%= t(:shipment_details) %></th>
|
49
|
+
</tr>
|
50
|
+
<tr>
|
51
|
+
<td>
|
52
|
+
<%= shipment_form.label :shipping_method_id, t(:shipping_method) + ':' %>
|
53
|
+
</td>
|
54
|
+
<td>
|
55
|
+
<%= shipment_form.select :shipping_method_id,
|
56
|
+
@shipping_methods.map {|sm| ["#{sm.name} - #{sm.zone.name}", sm.id] } %>
|
57
|
+
</td>
|
58
|
+
<td>
|
59
|
+
<%= shipment_form.label :tracking, t(:tracking) + ':' %>
|
60
|
+
</td>
|
61
|
+
<td><%= shipment_form.text_field :tracking %></td>
|
62
|
+
</tr>
|
63
|
+
<% temando_quote = @shipment.order.temando_quotes.first %>
|
64
|
+
<% if temando_quote %>
|
65
|
+
<tr>
|
66
|
+
<td><b>Carrier Name:</b> <%= temando_quote.carrier_name %></td>
|
67
|
+
<td><b>Carrier Phone:</b> <%= temando_quote.carrier_phone %></td>
|
68
|
+
<td colspan=5><b>Delivery Method:</b> <%= temando_quote.delivery_method %></td>
|
69
|
+
</tr>
|
70
|
+
<% end %>
|
71
|
+
<% if Spree::Config[:shipping_instructions] %>
|
72
|
+
<tr>
|
73
|
+
<td>
|
74
|
+
<%= shipment_form.label :special_instructions, t(:special_instructions) + ':' %>
|
75
|
+
</td>
|
76
|
+
<td colspan="3">
|
77
|
+
<%= shipment_form.text_area :special_instructions %>
|
78
|
+
</td>
|
79
|
+
</tr>
|
80
|
+
<% end %>
|
81
|
+
</table>
|
82
|
+
</div>
|
83
|
+
</div>
|
data/lib/spree_temando/engine.rb
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
require 'spree_core'
|
2
|
+
require 'temando'
|
3
|
+
|
1
4
|
module SpreeTemando
|
2
5
|
class Engine < ::Rails::Engine
|
3
6
|
isolate_namespace SpreeTemando
|
@@ -9,7 +12,7 @@ module SpreeTemando
|
|
9
12
|
Dir.glob(File.join(File.dirname(__FILE__), "../../app/**/*_decorator*.rb")) do |c|
|
10
13
|
Rails.configuration.cache_classes ? require(c) : load(c)
|
11
14
|
end
|
12
|
-
Temando::Api::Base.logger = Rails.logger
|
15
|
+
::Temando::Api::Base.logger = Rails.logger
|
13
16
|
end
|
14
17
|
|
15
18
|
initializer "spree_temando.register.shipping_calculators" do |app|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_temando
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-11-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: spree_core
|
@@ -50,7 +50,7 @@ dependencies:
|
|
50
50
|
requirements:
|
51
51
|
- - ~>
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: 0.1.
|
53
|
+
version: 0.1.3
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -58,15 +58,15 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.1.
|
61
|
+
version: 0.1.3
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
|
-
name:
|
63
|
+
name: combustion
|
64
64
|
requirement: !ruby/object:Gem::Requirement
|
65
65
|
none: false
|
66
66
|
requirements:
|
67
67
|
- - ~>
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version:
|
69
|
+
version: 0.3.1
|
70
70
|
type: :development
|
71
71
|
prerelease: false
|
72
72
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -74,7 +74,23 @@ dependencies:
|
|
74
74
|
requirements:
|
75
75
|
- - ~>
|
76
76
|
- !ruby/object:Gem::Version
|
77
|
-
version:
|
77
|
+
version: 0.3.1
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: rspec-rails
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
type: :development
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
78
94
|
- !ruby/object:Gem::Dependency
|
79
95
|
name: faker
|
80
96
|
requirement: !ruby/object:Gem::Requirement
|
@@ -91,6 +107,54 @@ dependencies:
|
|
91
107
|
- - ! '>='
|
92
108
|
- !ruby/object:Gem::Version
|
93
109
|
version: '0'
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: pry
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - ! '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ! '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: pry-remote
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
130
|
+
requirements:
|
131
|
+
- - ! '>='
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
134
|
+
type: :development
|
135
|
+
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
139
|
+
- - ! '>='
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '0'
|
142
|
+
- !ruby/object:Gem::Dependency
|
143
|
+
name: sqlite3
|
144
|
+
requirement: !ruby/object:Gem::Requirement
|
145
|
+
none: false
|
146
|
+
requirements:
|
147
|
+
- - ! '>='
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: '0'
|
150
|
+
type: :development
|
151
|
+
prerelease: false
|
152
|
+
version_requirements: !ruby/object:Gem::Requirement
|
153
|
+
none: false
|
154
|
+
requirements:
|
155
|
+
- - ! '>='
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
version: '0'
|
94
158
|
description: Adds temando shipping support to Spree
|
95
159
|
email:
|
96
160
|
- jason@reinteractive.net
|
@@ -107,6 +171,7 @@ files:
|
|
107
171
|
- app/models/spree_temando/order_shipping_decorator.rb
|
108
172
|
- app/models/spree_temando/shipment_shipping_decorator.rb
|
109
173
|
- app/models/spree_temando/variant_shipping_decorator.rb
|
174
|
+
- app/views/spree/admin/shipments/_form.html.erb
|
110
175
|
- config/locales/en.yml
|
111
176
|
- config/routes.rb
|
112
177
|
- db/migrate/20121011082400_create_spree_temando_quotes.rb
|
@@ -117,6 +182,7 @@ files:
|
|
117
182
|
- db/migrate/20121011104200_add_cached_items_hash_to_temando_quote.rb
|
118
183
|
- db/migrate/20121011115000_remove_temando_quote_delivery_method.rb
|
119
184
|
- db/migrate/20121017165000_fix_temando_quote_associations.rb
|
185
|
+
- db/migrate/20121113034743_add_carrier_data_to_temando_quote.rb
|
120
186
|
- lib/spree_temando/engine.rb
|
121
187
|
- lib/spree_temando/version.rb
|
122
188
|
- lib/spree_temando.rb
|
@@ -124,7 +190,7 @@ files:
|
|
124
190
|
- MIT-LICENSE
|
125
191
|
- Rakefile
|
126
192
|
- README.md
|
127
|
-
homepage:
|
193
|
+
homepage: https://github.com/reInteractive-open/spree_temando
|
128
194
|
licenses: []
|
129
195
|
post_install_message:
|
130
196
|
rdoc_options: []
|
@@ -144,7 +210,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
144
210
|
version: '0'
|
145
211
|
requirements: []
|
146
212
|
rubyforge_project:
|
147
|
-
rubygems_version: 1.8.
|
213
|
+
rubygems_version: 1.8.24
|
148
214
|
signing_key:
|
149
215
|
specification_version: 3
|
150
216
|
summary: Adds temando shipping support to Spree
|