shopkeep_reports 1.1.0 → 2.0.0
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
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4a5026b4d4d59c46876338d8bd8f6f17d68a2504
|
|
4
|
+
data.tar.gz: d0e9bb4728b3e3904d909198c42eed92a6aa149e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b1a76e7bb4cfe415448692b44ec27f141317af5130617c9bd9aa7a80f0b3bd26e2f88147a1304316890deb7d42beb6e2fdc2fc12cdc6d959044b1785232b62af
|
|
7
|
+
data.tar.gz: ff01435e42b627e563061878743e7b0027d41111a784234d3bdaf2ac178d7198736b909756c0f0c89dfc1c1cd93c55b90241b0ae04bd0a4edef0f73208b74966
|
|
@@ -56,10 +56,10 @@ module ShopkeepReports
|
|
|
56
56
|
raise ShopkeepException, "#{e.message}"
|
|
57
57
|
end
|
|
58
58
|
|
|
59
|
-
def download_transaction_report_link(report_link)
|
|
59
|
+
def download_transaction_report_link(report_link, start, finish)
|
|
60
60
|
new_agent = Mechanize.new
|
|
61
61
|
new_agent.cookie_jar = @@cookie_jar
|
|
62
|
-
new_agent.
|
|
62
|
+
new_agent.post(report_link, { 'authenticity_token' => @@token, 'start' => start, 'finish' => finish })
|
|
63
63
|
sleep(5)
|
|
64
64
|
export_list = new_agent.get(configuration.uri("/export_center.json"))
|
|
65
65
|
export_json = export_list.body
|
|
@@ -32,6 +32,10 @@ module ShopkeepReports
|
|
|
32
32
|
"https://" + @account + ".shopkeepapp.com" + path
|
|
33
33
|
end
|
|
34
34
|
|
|
35
|
+
def transaction_uri(path)
|
|
36
|
+
"https://www.shopkeepapp.com" + path
|
|
37
|
+
end
|
|
38
|
+
|
|
35
39
|
private
|
|
36
40
|
def default_email
|
|
37
41
|
ENV['SHOPKEEP_EMAIL']
|
|
@@ -45,4 +49,4 @@ module ShopkeepReports
|
|
|
45
49
|
ENV['SHOPKEEP_ACCOUNT']
|
|
46
50
|
end
|
|
47
51
|
end
|
|
48
|
-
end
|
|
52
|
+
end
|
|
@@ -39,14 +39,14 @@ module ShopkeepReports
|
|
|
39
39
|
end_date = args.fetch(:end_date, Time.now)
|
|
40
40
|
detailed = args.fetch(:detailed, false)
|
|
41
41
|
tenders = args.fetch(:tenders, false)
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
link = ""
|
|
43
|
+
if detailed == true
|
|
44
|
+
link = "/exports/rogue/transacted_items"
|
|
45
|
+
elsif tenders == true
|
|
46
|
+
link = "/exports/rogue/tenders"
|
|
47
|
+
end
|
|
48
48
|
Client.instance.authorize
|
|
49
|
-
Client.instance.download_transaction_report_link(configuration.
|
|
49
|
+
Client.instance.download_transaction_report_link(configuration.transaction_uri(link), start_date.iso8601, end_date.iso8601)
|
|
50
50
|
end
|
|
51
51
|
|
|
52
52
|
private
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: shopkeep_reports
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 2.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kunwar Aditya Raghuwanshi
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-08
|
|
11
|
+
date: 2016-09-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|