spree_exactor 1.1.3.20130726 → 1.1.4.20130729

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a296fbaa1625887546dc2741b4702c5f5b818624
4
- data.tar.gz: d433d5b3ab4908e5790e0cdd7e14225b9cae911c
3
+ metadata.gz: 51f5bfa0c8da069c380831843a08103da78df42e
4
+ data.tar.gz: 15c9eebf445ddea087d443b8f67c960838b88567
5
5
  SHA512:
6
- metadata.gz: 970892fac28c3aa4bdd4813b64a93c9a1280624035a6b0fe0c9150e633b9ac34b93fb13c056f481c51c6b2f4ed085234639b99ed7e23e8e971c46ac90c784ce4
7
- data.tar.gz: f966b3813218ce7a388eda4e8b983533977bd8bdeecc075850530ef0366a6ebadf787558c27957509c4ca2ba153880492ae3f4848f252c1a45c0c5a8108930fa
6
+ metadata.gz: f2be701bf8b97295cbcebf6d02cf0ee13c2cd1d2358b323554734e22c4bf43bf2a78db29d647676d32c8805764db627fa3cf098ff5165d1aaf171e4cba5f813f
7
+ data.tar.gz: efe8c4b847e04bb070f9646714014e784e451cecf4e1ef53a44aae27f126cd89b8b498807985012c194433d93573a6692812f6fc9105038e1c07d7461a6dc440
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- spree_exactor (1.1.3.20130726)
4
+ spree_exactor (1.1.4.20130729)
5
5
  rspec
6
6
  spree_core (>= 2.0.0)
7
7
  sqlite3
@@ -4,7 +4,7 @@ require 'bigdecimal/util'
4
4
 
5
5
  module SpreeExactorConnector
6
6
  class SpreeExactorConnector
7
- PLUGIN_VERSION = "20130726"
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
- shipment_amounts[shipment.stock_location_id] = shipment.cost
346
- shipment_addresses[shipment.stock_location_id] = stockAddress
347
- shipment_quantities[shipment.stock_location_id] += 1
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
- exactor_connector.do_checkout!(self)
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)
@@ -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.3.20130726'
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.3.20130726
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-26 00:00:00.000000000 Z
11
+ date: 2013-07-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: spree_core