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 +4 -4
- data/lib/sports_south/inventory.rb +31 -0
- data/lib/sports_south/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32664639ae431ea6c82263071e94099898aa6354
|
4
|
+
data.tar.gz: ad995db38cc2181dee6b70f7b8b329fe16361292
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/sports_south/version.rb
CHANGED