sports_south 0.10.0 → 0.11.0

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: 3ad70665245178cc174e50a43bc3625f0e8aa15e
4
- data.tar.gz: 91cbd940f6eea3b0e42353e213aecbeca5bf6d57
3
+ metadata.gz: 32664639ae431ea6c82263071e94099898aa6354
4
+ data.tar.gz: ad995db38cc2181dee6b70f7b8b329fe16361292
5
5
  SHA512:
6
- metadata.gz: 7004bfbf4ed15679d6639c0dcbd02f92144c41cd0a0f3d1bc41c430b81a7f1930f13a9c68313f86ba379ecd7c75653a2de71e9f1a6424bff9a587f1f645108ab
7
- data.tar.gz: affda4a5bbd8c6e2141dae605290c8742f8b4ecc4d0d2d845f9cf07c559dac09696eb0d587ccd0b3f1f8a7c72db24a3a26ff0bb21c266139c47ed25cea09f85d
6
+ metadata.gz: a45b73ace5a6ddfe6ccb705245f8e223effd3aa68570934493bddd0881f08b89c8a535bb2ab7fe5f361c013ed20f7696911629012b9447d5ceb4bcdba11e4d7a
7
+ data.tar.gz: 7e5d7ca741db5db9359ed51eac322e7c33d40d8603ad4aacc3d75dbcf6c128d9123fd30cf4dcf5b32cc1169a739c2912289abf1a83ea1cacda8a8c72e64d680d
@@ -167,5 +167,36 @@ module SportsSouth
167
167
  items
168
168
  end
169
169
 
170
+ # Pass an optional `:since` option (YYYY-MM-DDTHH:mm:ss.mss-HH:00) to get items updated since that timestamp.
171
+ def self.incremental_onhand_update(options = {})
172
+ requires!(options, :username, :password, :source, :customer_number)
173
+
174
+ options[:since] ||= '-1'
175
+
176
+ http, request = get_http_and_request(API_URL, '/IncrementalOnhandUpdate')
177
+
178
+ request.set_form_data(form_params(options).merge({ SinceDateTime: options[:since] }))
179
+
180
+ response = http.request(request)
181
+ body = sanitize_response(response)
182
+ xml_doc = Nokogiri::XML(body)
183
+
184
+ raise SportsSouth::NotAuthenticated if not_authenticated?(xml_doc)
185
+
186
+ items = []
187
+
188
+ xml_doc.css('Onhand').each do |item|
189
+ items << {
190
+ item_number: content_for(item, 'I'),
191
+ quantity: content_for(item, 'Q'),
192
+ quantity_changed: content_for(item, 'D'),
193
+ catalog_price: content_for(item, 'P'),
194
+ customer_price: content_for(item, 'C'),
195
+ }
196
+ end
197
+
198
+ items
199
+ end
200
+
170
201
  end
171
202
  end
@@ -1,3 +1,3 @@
1
1
  module SportsSouth
2
- VERSION = "0.10.0"
2
+ VERSION = "0.11.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sports_south
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.0
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dale Campbell