QNE 0.7.0 → 0.7.1
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/README.md +1 -1
- data/lib/QNE/version.rb +1 -1
- data/lib/stock_reports.rb +11 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2babe79332b2cb68b2728bdb74b1ae9515067ae3ce9e4c9264f055d3f48a8883
|
|
4
|
+
data.tar.gz: cd638f8b27b31ec8486e6e59e813472d177f0767c3879f247f468817e5bc67f6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b1ef31b2e8127eb29204c7287c80576149c151725010700410e3bbf4c43a0d0ff9c2f825febe49623a37e8cffa94d6b4f62d23105c2b5540b2d2f69f0afaaacc
|
|
7
|
+
data.tar.gz: 03a795ec899b3ff415a4506a0fb89a6947f994d46d48c376993b1c104821ae490590f292109371a71eccb34118150288dd04279eb1c019402b744563ede49cc3
|
data/README.md
CHANGED
|
@@ -391,7 +391,7 @@ conn.stock_reports.find_stocks_location_balance_by_date
|
|
|
391
391
|
```
|
|
392
392
|
|
|
393
393
|
```ruby
|
|
394
|
-
conn.stock_reports.find_stocks_location_balance_by_date(as_of_date: Time.current)
|
|
394
|
+
conn.stock_reports.find_stocks_location_balance_by_date(as_of_date: Time.current, stock_location: 'AL')
|
|
395
395
|
```
|
|
396
396
|
|
|
397
397
|
### Terms
|
data/lib/QNE/version.rb
CHANGED
data/lib/stock_reports.rb
CHANGED
|
@@ -6,12 +6,21 @@ module QNE
|
|
|
6
6
|
class StockReports < Base
|
|
7
7
|
include ::QNE::QueryBuilder
|
|
8
8
|
|
|
9
|
-
def find_stocks_location_balance_by_date(as_of_date: Date.today)
|
|
9
|
+
def find_stocks_location_balance_by_date(as_of_date: Date.today, stock_location: nil)
|
|
10
10
|
@response = QNE::StockReport::StockLocationBalance.new(
|
|
11
11
|
conn, as_of_date
|
|
12
12
|
).call
|
|
13
13
|
|
|
14
|
-
parse_to_json(
|
|
14
|
+
parsed = parse_to_json(response.body)
|
|
15
|
+
|
|
16
|
+
# Handle API error response
|
|
17
|
+
return parsed if parsed.is_a?(Hash)
|
|
18
|
+
|
|
19
|
+
if stock_location.present?
|
|
20
|
+
parsed.select { |stock| stock['locationCode'] == stock_location }
|
|
21
|
+
else
|
|
22
|
+
parsed
|
|
23
|
+
end
|
|
15
24
|
end
|
|
16
25
|
end
|
|
17
26
|
end
|