spree_exactor 1.1.3.20130726 → 1.1.4.20130729
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/Gemfile.lock +1 -1
- data/app/helpers/spree_exactor_connector.rb +11 -6
- data/app/models/spree/calculator/exactor_tax_calculator.rb +0 -3
- data/app/models/spree/order_decorator.rb +3 -1
- data/lib/generators/spree_exactor/install/install_generator.rb +1 -0
- data/spree_exactor.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51f5bfa0c8da069c380831843a08103da78df42e
|
4
|
+
data.tar.gz: 15c9eebf445ddea087d443b8f67c960838b88567
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2be701bf8b97295cbcebf6d02cf0ee13c2cd1d2358b323554734e22c4bf43bf2a78db29d647676d32c8805764db627fa3cf098ff5165d1aaf171e4cba5f813f
|
7
|
+
data.tar.gz: efe8c4b847e04bb070f9646714014e784e451cecf4e1ef53a44aae27f126cd89b8b498807985012c194433d93573a6692812f6fc9105038e1c07d7461a6dc440
|
data/Gemfile.lock
CHANGED
@@ -4,7 +4,7 @@ require 'bigdecimal/util'
|
|
4
4
|
|
5
5
|
module SpreeExactorConnector
|
6
6
|
class SpreeExactorConnector
|
7
|
-
PLUGIN_VERSION = "
|
7
|
+
PLUGIN_VERSION = "20130729"
|
8
8
|
TEST_TRANSACTION_NAME = "Spree Test Transaction"
|
9
9
|
TEST_ITEM_DESRIPTION = "Exactor Account Verification. Plug-in version:"
|
10
10
|
PLUGIN_NAME = "SpreeCommerce"
|
@@ -204,7 +204,6 @@ module SpreeExactorConnector
|
|
204
204
|
|
205
205
|
def update_tax_if_needed(order)
|
206
206
|
if order.exactor_invoice_transaction.nil?
|
207
|
-
order.update_column(:exactor_order_hash_sum, nil)
|
208
207
|
order.update_adjustments
|
209
208
|
end
|
210
209
|
end
|
@@ -340,11 +339,11 @@ module SpreeExactorConnector
|
|
340
339
|
invoice.LineItem << exactor_line
|
341
340
|
end
|
342
341
|
end
|
343
|
-
# using stock_location_id instead of shipment_id is a workaround. Spree recreates shipments on delivery page.
|
344
342
|
# collect shipment amounts to create shipping items in the future
|
345
|
-
|
346
|
-
|
347
|
-
|
343
|
+
shipment_key = generate_shipment_key(shipment)
|
344
|
+
shipment_amounts[shipment_key] = shipment.cost
|
345
|
+
shipment_addresses[shipment_key] = stockAddress
|
346
|
+
shipment_quantities[shipment_key] += 1
|
348
347
|
end
|
349
348
|
shipment_amounts.each do |id, amount|
|
350
349
|
shipment_quantities[id].times do
|
@@ -380,6 +379,12 @@ module SpreeExactorConnector
|
|
380
379
|
return invoice
|
381
380
|
end
|
382
381
|
|
382
|
+
# @param [Spree::Shipment] shipment
|
383
|
+
def generate_shipment_key(shipment)
|
384
|
+
# using stock_location_id instead of shipment_id is a workaround. Spree recreates shipments on delivery page.
|
385
|
+
"#{shipment.stock_location_id}_#{shipment.shipping_method.id}"
|
386
|
+
end
|
387
|
+
|
383
388
|
def add_free_shipping_lineitem(shipping_amount, stock = nil)
|
384
389
|
exactor_line = InvoiceRequest::LineItem.new
|
385
390
|
exactor_line.SKU=@settings.shipping_include_handling ? SHIPPING_EUC_WITH_HANDLING : SHIPPING_EUC_NO_HANDLING
|
@@ -72,9 +72,6 @@ class Spree::Calculator::ExactorTaxCalculator < Spree::Calculator
|
|
72
72
|
# @param [Spree::Order] order
|
73
73
|
# @return [Boolean]
|
74
74
|
def is_full?(order)
|
75
|
-
packages = Spree::Stock::Coordinator.new(order).packages
|
76
|
-
|
77
|
-
return false if packages.size > order.shipments.size
|
78
75
|
|
79
76
|
variant2quantity = Hash.new(0)
|
80
77
|
|
@@ -7,7 +7,9 @@ module Spree
|
|
7
7
|
#check out handler
|
8
8
|
def finalize!
|
9
9
|
exactor_connector = SpreeExactorConnector::SpreeExactorConnector.new
|
10
|
-
|
10
|
+
#we can accidentally commit order with an old invoice id
|
11
|
+
this_order = Spree::Order.find(self.id)
|
12
|
+
exactor_connector.do_checkout!(this_order)
|
11
13
|
super_finalize!
|
12
14
|
end
|
13
15
|
|
@@ -11,6 +11,7 @@ module SpreeExactor
|
|
11
11
|
supported_versions '1.1.1.112920126'=>['1.1.1','1.1.2','1.1.3']
|
12
12
|
supported_versions '1.1.2.20130723'=>['2.0.*']
|
13
13
|
supported_versions '1.1.3.20130726'=>['2.0.*']
|
14
|
+
supported_versions '1.1.4.20130729'=>['2.0.*']
|
14
15
|
unless @supported_versions.include? _plugin_version
|
15
16
|
puts "Unknown plug-in version. Try any of those: "+ @supported_versions.keys.to_s
|
16
17
|
exit(0)
|
data/spree_exactor.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
Gem::Specification.new do |s|
|
3
3
|
s.platform = Gem::Platform::RUBY
|
4
4
|
s.name = 'spree_exactor'
|
5
|
-
s.version = '1.1.
|
5
|
+
s.version = '1.1.4.20130729'
|
6
6
|
s.summary = 'Exactor sales tax compliance module for SpreeCommerce'
|
7
7
|
s.description = 'Sales tax compliance module for (i) calculating sales tax with SpreeCommerce; and (ii) generating and filing sales tax returns in all US jurisdictions (state and local).'
|
8
8
|
s.required_ruby_version = '>= 2.0.0'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_exactor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.4.20130729
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Exactor, Inc
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-07-
|
11
|
+
date: 2013-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: spree_core
|