economic-rest 0.5.11 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +26 -24
- data/README.md +1 -1
- data/lib/economic/account.rb +12 -0
- data/lib/economic/account_repo.rb +4 -0
- data/lib/economic/accounts_summed.rb +6 -0
- data/lib/economic/base_repo.rb +0 -1
- data/lib/economic/contra_account.rb +5 -0
- data/lib/economic/customer.rb +1 -1
- data/lib/economic/invoice.rb +1 -1
- data/lib/economic/invoices/booked_repo.rb +1 -1
- data/lib/economic/journal_voucher_repo.rb +1 -1
- data/lib/economic/pricing_repo.rb +1 -1
- data/lib/economic/product_repo.rb +1 -1
- data/lib/economic/rest.rb +5 -0
- data/lib/economic/rest/version.rb +1 -1
- data/lib/economic/self_repo.rb +1 -1
- data/lib/economic/total_from_account.rb +5 -0
- data/lib/economic/vat_account.rb +5 -0
- metadata +8 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d725fc6ea433dd772584081b4e7880d395b732f84ee5ef5c7aafe9cef6f52236
|
4
|
+
data.tar.gz: bfc023ee2ac0b131d64662dba0b8859d687432cb37c9636d7cd66bfdb2401597
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f68d582a5e3118e7a9a56ec9302f993f8fabde03220e70782aa9cc200664eb586e12151addf44fdd474ccf59bb907843f3471f63ef31ca0158f03cc585c97fbc
|
7
|
+
data.tar.gz: cc97a9ed72046933f76bdff0624a119197a1697e0b17e8c8edcad434dc84aa7d30ef74a43d6450af985ff7d08130270f573a18370d29ef88e1eb70968f88182e
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
economic-rest (0.
|
4
|
+
economic-rest (0.6.1)
|
5
5
|
activesupport
|
6
6
|
rest-client
|
7
7
|
savon
|
@@ -9,12 +9,12 @@ PATH
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
activesupport (6.
|
12
|
+
activesupport (6.1.4)
|
13
13
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
14
|
-
i18n (>=
|
15
|
-
minitest (
|
16
|
-
tzinfo (~>
|
17
|
-
zeitwerk (~> 2.
|
14
|
+
i18n (>= 1.6, < 2)
|
15
|
+
minitest (>= 5.1)
|
16
|
+
tzinfo (~> 2.0)
|
17
|
+
zeitwerk (~> 2.3)
|
18
18
|
addressable (2.5.2)
|
19
19
|
public_suffix (>= 2.0.2, < 4.0)
|
20
20
|
akami (1.3.1)
|
@@ -22,8 +22,8 @@ GEM
|
|
22
22
|
nokogiri
|
23
23
|
ast (2.4.0)
|
24
24
|
awesome_print (1.8.0)
|
25
|
-
builder (3.2.
|
26
|
-
concurrent-ruby (1.1.
|
25
|
+
builder (3.2.4)
|
26
|
+
concurrent-ruby (1.1.9)
|
27
27
|
coveralls (0.8.23)
|
28
28
|
json (>= 1.8, < 3)
|
29
29
|
simplecov (~> 0.16.1)
|
@@ -40,12 +40,12 @@ GEM
|
|
40
40
|
builder (>= 2.1.2)
|
41
41
|
hashdiff (0.3.8)
|
42
42
|
http-accept (1.7.0)
|
43
|
-
http-cookie (1.0.
|
43
|
+
http-cookie (1.0.4)
|
44
44
|
domain_name (~> 0.5)
|
45
|
-
httpi (2.4.
|
45
|
+
httpi (2.4.5)
|
46
46
|
rack
|
47
47
|
socksify
|
48
|
-
i18n (1.
|
48
|
+
i18n (1.8.10)
|
49
49
|
concurrent-ruby (~> 1.0)
|
50
50
|
jaro_winkler (1.5.3)
|
51
51
|
json (2.1.0)
|
@@ -54,22 +54,24 @@ GEM
|
|
54
54
|
rake (>= 0.9.2.2)
|
55
55
|
metaclass (0.0.4)
|
56
56
|
method_source (0.9.2)
|
57
|
-
mime-types (3.3)
|
57
|
+
mime-types (3.3.1)
|
58
58
|
mime-types-data (~> 3.2015)
|
59
|
-
mime-types-data (3.
|
60
|
-
mini_portile2 (2.
|
59
|
+
mime-types-data (3.2021.0225)
|
60
|
+
mini_portile2 (2.5.3)
|
61
61
|
minitest (5.11.3)
|
62
62
|
mocha (1.9.0)
|
63
63
|
metaclass (~> 0.0.1)
|
64
64
|
netrc (0.11.0)
|
65
|
-
nokogiri (1.
|
66
|
-
mini_portile2 (~> 2.
|
65
|
+
nokogiri (1.11.7)
|
66
|
+
mini_portile2 (~> 2.5.0)
|
67
|
+
racc (~> 1.4)
|
67
68
|
nori (2.6.0)
|
68
69
|
parallel (1.17.0)
|
69
70
|
parser (2.6.4.1)
|
70
71
|
ast (~> 2.4.0)
|
71
72
|
public_suffix (3.0.3)
|
72
|
-
|
73
|
+
racc (1.5.2)
|
74
|
+
rack (2.2.3)
|
73
75
|
rainbow (3.0.0)
|
74
76
|
rake (10.5.0)
|
75
77
|
rest-client (2.1.0)
|
@@ -88,7 +90,7 @@ GEM
|
|
88
90
|
rubocop (>= 0.71.0)
|
89
91
|
ruby-progressbar (1.10.1)
|
90
92
|
safe_yaml (1.0.4)
|
91
|
-
savon (2.12.
|
93
|
+
savon (2.12.1)
|
92
94
|
akami (~> 1.2)
|
93
95
|
builder (>= 2.1.2)
|
94
96
|
gyoku (~> 1.2)
|
@@ -108,22 +110,22 @@ GEM
|
|
108
110
|
term-ansicolor (1.7.1)
|
109
111
|
tins (~> 1.0)
|
110
112
|
thor (0.20.3)
|
111
|
-
thread_safe (0.3.6)
|
112
113
|
tins (1.22.1)
|
113
|
-
tzinfo (
|
114
|
-
|
114
|
+
tzinfo (2.0.4)
|
115
|
+
concurrent-ruby (~> 1.0)
|
115
116
|
unf (0.1.4)
|
116
117
|
unf_ext
|
117
|
-
unf_ext (0.0.7.
|
118
|
+
unf_ext (0.0.7.7)
|
118
119
|
unicode-display_width (1.6.0)
|
119
|
-
wasabi (3.
|
120
|
+
wasabi (3.6.1)
|
121
|
+
addressable
|
120
122
|
httpi (~> 2.0)
|
121
123
|
nokogiri (>= 1.4.2)
|
122
124
|
webmock (3.5.1)
|
123
125
|
addressable (>= 2.3.6)
|
124
126
|
crack (>= 0.3.2)
|
125
127
|
hashdiff
|
126
|
-
zeitwerk (2.
|
128
|
+
zeitwerk (2.4.2)
|
127
129
|
|
128
130
|
PLATFORMS
|
129
131
|
ruby
|
data/README.md
CHANGED
@@ -65,7 +65,7 @@ copy pasta from https://restdocs.e-conomic.com/#specifying-operator-affinity
|
|
65
65
|
|
66
66
|
## Development
|
67
67
|
|
68
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `
|
68
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bundle exec m` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
69
69
|
|
70
70
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
71
71
|
|
data/lib/economic/account.rb
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
module Economic
|
2
2
|
class Account < Base
|
3
3
|
field :accountNumber, id: true
|
4
|
+
field :accountType
|
5
|
+
field :balance
|
6
|
+
field :barred
|
7
|
+
field :blockDirectEntries
|
8
|
+
field :debitCredit
|
9
|
+
field :draftBalance
|
10
|
+
field :name
|
11
|
+
|
12
|
+
relation :contraAccount, fields: [:accountNumber]
|
13
|
+
relation :accountsSummed, fields: [:fromAccount, :toAccount], multiple: true
|
14
|
+
relation :totalFromAccount, fields: [:accountNumber]
|
15
|
+
relation :vatAccount, fields: [:vatCode]
|
4
16
|
end
|
5
17
|
end
|
data/lib/economic/base_repo.rb
CHANGED
data/lib/economic/customer.rb
CHANGED
@@ -29,7 +29,7 @@ module Economic
|
|
29
29
|
relation :customerGroup, fields: [:customerGroupNumber]
|
30
30
|
# field :defaultDeliveryLocation
|
31
31
|
# field :invoices
|
32
|
-
|
32
|
+
relation :layout, fields: [:layoutNumber]
|
33
33
|
relation :paymentTerms, fields: [:paymentTermsNumber]
|
34
34
|
# field :salesPerson
|
35
35
|
# field :templates
|
data/lib/economic/invoice.rb
CHANGED
@@ -24,7 +24,7 @@ module Economic
|
|
24
24
|
relation :paymentTerms, fields: [:paymentTermsNumber]
|
25
25
|
relation :pdf, fields: [:download]
|
26
26
|
# relation :project, fields: []
|
27
|
-
relation :recipient, fields: [
|
27
|
+
relation :recipient, fields: []
|
28
28
|
relation :references, fields: [:other]
|
29
29
|
relation :lines, fields: [:lineNumber, :description, :sortKey, :quantity, :unitNetPrice, :discountPercentage, :unitCostPrice, :marginInBaseCurrency, :marginPercentage, :totalNetAmount], multiple: true
|
30
30
|
|
@@ -3,7 +3,7 @@ module Economic
|
|
3
3
|
class BookedRepo < Economic::Invoices::Repo
|
4
4
|
class << self
|
5
5
|
def send(invoice, book_with_number: nil)
|
6
|
-
response = send_request(method: :post, url:
|
6
|
+
response = send_request(method: :post, url: endpoint_url, payload: payload(invoice, book_with_number: book_with_number))
|
7
7
|
|
8
8
|
entry_hash = JSON.parse(response.body)
|
9
9
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Economic
|
2
2
|
class JournalVoucherRepo < Economic::BaseRepo
|
3
3
|
def self.save(voucher)
|
4
|
-
response = send_request(method: :post, url:
|
4
|
+
response = send_request(method: :post, url: "#{Economic::JournalRepo.endpoint_url}/#{voucher.journal.journalNumber}/vouchers", payload: voucher.to_h.to_json)
|
5
5
|
|
6
6
|
Voucher.new(JSON.parse(response.body).first)
|
7
7
|
end
|
@@ -6,7 +6,7 @@ module Economic
|
|
6
6
|
|
7
7
|
id = Economic::BaseRepo.id_to_url_formatted_id(id)
|
8
8
|
end_point = [superclass.endpoint_url, id, "pricing", "currency-specific-sales-prices"].join("/")
|
9
|
-
response = send_request(method: :get, url:
|
9
|
+
response = send_request(method: :get, url: end_point)
|
10
10
|
entry_hash = JSON.parse(response.body)
|
11
11
|
pricings = []
|
12
12
|
|
@@ -5,7 +5,7 @@ module Economic
|
|
5
5
|
id ||= product_group_or_product_group_number
|
6
6
|
|
7
7
|
end_point = [ProductGroupRepo.endpoint_url, id, "products"].join("/")
|
8
|
-
response = send_request(method: :get, url:
|
8
|
+
response = send_request(method: :get, url: end_point)
|
9
9
|
entry_hash = JSON.parse(response.body)
|
10
10
|
products = []
|
11
11
|
|
data/lib/economic/rest.rb
CHANGED
@@ -97,6 +97,11 @@ require "economic/distribution"
|
|
97
97
|
require "economic/departmental_distribution_repo"
|
98
98
|
|
99
99
|
require "economic/account"
|
100
|
+
require "economic/account_repo"
|
101
|
+
require "economic/accounts_summed"
|
102
|
+
require "economic/contra_account"
|
103
|
+
require "economic/total_from_account"
|
104
|
+
require "economic/vat_account"
|
100
105
|
|
101
106
|
module Economic
|
102
107
|
class Demo
|
data/lib/economic/self_repo.rb
CHANGED
@@ -4,7 +4,7 @@ module Economic
|
|
4
4
|
|
5
5
|
class << self
|
6
6
|
def self
|
7
|
-
response = send_request(method: :get, url:
|
7
|
+
response = send_request(method: :get, url: Economic::SelfRepo.endpoint_url)
|
8
8
|
entry_hash = JSON.parse(response.body)
|
9
9
|
model.new(entry_hash)
|
10
10
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: economic-rest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Klogborg
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -225,13 +225,16 @@ files:
|
|
225
225
|
- bin/setup
|
226
226
|
- economic-rest.gemspec
|
227
227
|
- lib/economic/account.rb
|
228
|
+
- lib/economic/account_repo.rb
|
228
229
|
- lib/economic/accounting_year.rb
|
229
230
|
- lib/economic/accounting_year_repo.rb
|
231
|
+
- lib/economic/accounts_summed.rb
|
230
232
|
- lib/economic/attention.rb
|
231
233
|
- lib/economic/base.rb
|
232
234
|
- lib/economic/base_repo.rb
|
233
235
|
- lib/economic/company.rb
|
234
236
|
- lib/economic/concerns/soap_methods.rb
|
237
|
+
- lib/economic/contra_account.rb
|
235
238
|
- lib/economic/cost_account.rb
|
236
239
|
- lib/economic/currency.rb
|
237
240
|
- lib/economic/customer.rb
|
@@ -296,9 +299,11 @@ files:
|
|
296
299
|
- lib/economic/supplier_group.rb
|
297
300
|
- lib/economic/supplier_group_repo.rb
|
298
301
|
- lib/economic/supplier_repo.rb
|
302
|
+
- lib/economic/total_from_account.rb
|
299
303
|
- lib/economic/unit.rb
|
300
304
|
- lib/economic/unit_repo.rb
|
301
305
|
- lib/economic/user.rb
|
306
|
+
- lib/economic/vat_account.rb
|
302
307
|
- lib/economic/vat_type.rb
|
303
308
|
- lib/economic/vat_type_repo.rb
|
304
309
|
- lib/economic/vat_zone.rb
|
@@ -324,8 +329,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
324
329
|
- !ruby/object:Gem::Version
|
325
330
|
version: '0'
|
326
331
|
requirements: []
|
327
|
-
|
328
|
-
rubygems_version: 2.7.6
|
332
|
+
rubygems_version: 3.0.3
|
329
333
|
signing_key:
|
330
334
|
specification_version: 4
|
331
335
|
summary: Ruby wrapper for the e-conomic REST API, that aims at making working with
|