effective_qb_online 0.6.2 → 0.6.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4f62dccc91223b3a392121d17144aa8dd07a8b1ade5536f4b03cb4743451143e
4
- data.tar.gz: 30149c1bc4592e6da477d6e68424d9f148665275215a9e7751882b1a6aac89b1
3
+ metadata.gz: 6e101a55c8962b4989853c7f8fb701be335c09541fc0b85d179f7d2a03fce924
4
+ data.tar.gz: 803a96e73c6500c08796d3c94aa42b6dd8164ee8510427e67ec788aefa53bc27
5
5
  SHA512:
6
- metadata.gz: d6bf08ef6708280f6250d00608582b1f2e6e0f9686ae7b9a370ccdfcfc69f463987e480c50ab412587dc0cdf608567e8ad71e460c7f05ae98fa8495ce2758af3
7
- data.tar.gz: 644968d67ba6ded4151cd5050b51e185e866f6b410307277df6881c87b97071dea0c784b0c2402ee916fbf0f644f4346a74cc6f01645a77f776aad74e5d837ea
6
+ metadata.gz: 5b0576c3215a5ec6eb371f1f969cb7bdee78f91f598fbf9620576b7188231330f22ab57fb1a307c82e3d0fea70a2acb656138a8c5717aa8196bab7d15412fb5a
7
+ data.tar.gz: 71f51b35b900412ab7dd4d0a9ba84200c4fcbf611f092a589798921c59a60438289f574c6e2fd8489c46d5978a96f8f2a011ddb9d7a639a478b9b07d50a5657e
@@ -160,18 +160,16 @@ module Effective
160
160
  exempt = [['0.0', exempt]] if exempt.present?
161
161
 
162
162
  # Find The rest
163
- tax_codes = codes.map do |code|
163
+ tax_codes = codes.select(&:active?).map do |code|
164
164
  rate_id = code.sales_tax_rate_list.tax_rate_detail.first&.tax_rate_ref&.value
165
165
  rate = rates.find { |rate| rate.id == rate_id } if rate_id
166
166
 
167
167
  [rate.rate_value.to_s, code] if rate && (exempt.blank? || rate.rate_value.to_f > 0.0)
168
168
  end
169
169
 
170
- (Array(exempt) + tax_codes.compact).to_h
170
+ (Array(exempt) + tax_codes.uniq { |key, _| key }.compact).to_h
171
171
  end
172
172
 
173
- private
174
-
175
173
  def with_service(name, &block)
176
174
  klass = "Quickbooks::Service::#{name}".constantize
177
175
 
@@ -181,6 +179,8 @@ module Effective
181
179
  end
182
180
  end
183
181
 
182
+ private
183
+
184
184
  def with_authenticated_request(max_attempts: 3, &block)
185
185
  attempts = 0
186
186
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveQbOnline
2
- VERSION = '0.6.2'.freeze
2
+ VERSION = '0.6.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_qb_online
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect