economic-rest 0.6.5 → 0.6.6
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/lib/economic/models/customer.rb +1 -1
- data/lib/economic/models/delivery.rb +12 -0
- data/lib/economic/models/departmental_distribution.rb +13 -0
- data/lib/economic/models/invoice.rb +2 -2
- data/lib/economic/models/invoices/booked.rb +1 -0
- data/lib/economic/models/line.rb +2 -2
- data/lib/economic/models/pdf.rb +14 -0
- data/lib/economic/models/product.rb +2 -2
- data/lib/economic/models/product_group.rb +10 -0
- data/lib/economic/models/supplier.rb +30 -0
- data/lib/economic/models/supplier_group.rb +10 -0
- data/lib/economic/repos/product.rb +20 -0
- data/lib/economic/repos/supplier.rb +6 -0
- data/lib/economic/rest/version.rb +1 -1
- data/lib/economic/rest.rb +8 -0
- metadata +11 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6a6df895546767151e1fff4a371b0dbf7998e5220e85d367a0253020d06e61a
|
4
|
+
data.tar.gz: 1f658c8cfdf3ef33d1de259b71d5149baa65d1407b6d37d2e9badbc7fb56a461
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61d1e1021d8a85ca366afadaab6ed2137ca3548a4f063e6a3f2ce35010b1717bb8f354f7945ddf4d266f7b99f43f04fbff228d6aa6207c647c5f01e3ad9485cc
|
7
|
+
data.tar.gz: 296dd4b76637c61deab509163af05458d937ea616bc4a655a85ed7df14871044189ffbe3bdf05d91a78edcc45dd976d8824f7834bfe67330b4a71b8159bfadf5
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module Economic
|
2
|
+
module Models
|
3
|
+
class DepartmentalDistribution < Economic::Model
|
4
|
+
field :id, as: :departmentalDistributionNumber
|
5
|
+
field :name
|
6
|
+
field :distribution_type
|
7
|
+
|
8
|
+
relation :customer
|
9
|
+
relation :distributions, multiple: true
|
10
|
+
# relation :sub_collections
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
data/lib/economic/models/line.rb
CHANGED
@@ -0,0 +1,30 @@
|
|
1
|
+
module Economic
|
2
|
+
module Models
|
3
|
+
class Supplier < Economic::Model
|
4
|
+
field :id, as: :supplierNumber
|
5
|
+
field :address
|
6
|
+
field :bank_account
|
7
|
+
field :barred
|
8
|
+
field :city
|
9
|
+
field :contacts
|
10
|
+
field :corporate_identification_number
|
11
|
+
field :country
|
12
|
+
field :currency
|
13
|
+
field :default_invoice_text
|
14
|
+
field :email
|
15
|
+
field :name
|
16
|
+
field :phone
|
17
|
+
field :zip
|
18
|
+
|
19
|
+
relation :attention
|
20
|
+
relation :cost_account
|
21
|
+
relation :layout
|
22
|
+
relation :payment_terms
|
23
|
+
relation :remittance_advice
|
24
|
+
relation :sales_person
|
25
|
+
relation :supplier_contact
|
26
|
+
relation :supplier_group
|
27
|
+
relation :vat_zone
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Economic
|
2
|
+
module Repos
|
3
|
+
class Product < Economic::Repo
|
4
|
+
def self.in_group(product_group_or_product_group_number)
|
5
|
+
id = product_group_or_product_group_number.product_group_number if product_group_or_product_group_number.respond_to? :product_group_number
|
6
|
+
id ||= product_group_or_product_group_number
|
7
|
+
|
8
|
+
end_point = [ProductGroupRepo.endpoint_url, id, "products"].join("/")
|
9
|
+
response = send_request(method: :get, url: end_point)
|
10
|
+
entry_hash = JSON.parse(response.body)
|
11
|
+
products = []
|
12
|
+
|
13
|
+
entry_hash["collection"].each do |product|
|
14
|
+
products.push Product.new(product)
|
15
|
+
end
|
16
|
+
products
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/economic/rest.rb
CHANGED
@@ -34,6 +34,7 @@ require "economic/repos/invoices/booked"
|
|
34
34
|
require "economic/models/invoices/booked"
|
35
35
|
require "economic/models/line"
|
36
36
|
require "economic/models/product"
|
37
|
+
require "economic/repos/product"
|
37
38
|
require "economic/models/unit"
|
38
39
|
require "economic/models/recipient"
|
39
40
|
require "economic/models/note"
|
@@ -44,6 +45,13 @@ require "economic/models/sales_person"
|
|
44
45
|
require "economic/models/vendor_reference"
|
45
46
|
require "economic/models/layout"
|
46
47
|
require "economic/models/attention"
|
48
|
+
require "economic/models/delivery"
|
49
|
+
require "economic/models/departmental_distribution"
|
50
|
+
require "economic/repos/supplier"
|
51
|
+
require "economic/models/supplier"
|
52
|
+
require "economic/models/supplier_group"
|
53
|
+
require "economic/models/pdf"
|
54
|
+
require "economic/models/product_group"
|
47
55
|
|
48
56
|
require "economic/attention"
|
49
57
|
require "economic/currency"
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: economic-rest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Klogborg
|
8
|
-
autorequire:
|
9
8
|
bindir: exe
|
10
9
|
cert_chain: []
|
11
|
-
date: 2025-
|
10
|
+
date: 2025-02-28 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: bundler
|
@@ -192,7 +191,6 @@ dependencies:
|
|
192
191
|
- - "~>"
|
193
192
|
- !ruby/object:Gem::Version
|
194
193
|
version: '8.0'
|
195
|
-
description:
|
196
194
|
email:
|
197
195
|
- klogborg@traels.it
|
198
196
|
executables: []
|
@@ -260,6 +258,8 @@ files:
|
|
260
258
|
- lib/economic/models/customer.rb
|
261
259
|
- lib/economic/models/customer_group.rb
|
262
260
|
- lib/economic/models/customers/contact.rb
|
261
|
+
- lib/economic/models/delivery.rb
|
262
|
+
- lib/economic/models/departmental_distribution.rb
|
263
263
|
- lib/economic/models/invoice.rb
|
264
264
|
- lib/economic/models/invoices/booked.rb
|
265
265
|
- lib/economic/models/invoices/draft.rb
|
@@ -267,10 +267,14 @@ files:
|
|
267
267
|
- lib/economic/models/line.rb
|
268
268
|
- lib/economic/models/note.rb
|
269
269
|
- lib/economic/models/payment_term.rb
|
270
|
+
- lib/economic/models/pdf.rb
|
270
271
|
- lib/economic/models/product.rb
|
272
|
+
- lib/economic/models/product_group.rb
|
271
273
|
- lib/economic/models/recipient.rb
|
272
274
|
- lib/economic/models/reference.rb
|
273
275
|
- lib/economic/models/sales_person.rb
|
276
|
+
- lib/economic/models/supplier.rb
|
277
|
+
- lib/economic/models/supplier_group.rb
|
274
278
|
- lib/economic/models/unit.rb
|
275
279
|
- lib/economic/models/vat_zone.rb
|
276
280
|
- lib/economic/models/vendor_reference.rb
|
@@ -304,6 +308,8 @@ files:
|
|
304
308
|
- lib/economic/repos/invoices/booked.rb
|
305
309
|
- lib/economic/repos/invoices/draft.rb
|
306
310
|
- lib/economic/repos/invoices/drafts/line.rb
|
311
|
+
- lib/economic/repos/product.rb
|
312
|
+
- lib/economic/repos/supplier.rb
|
307
313
|
- lib/economic/response.rb
|
308
314
|
- lib/economic/response/pagination.rb
|
309
315
|
- lib/economic/rest.rb
|
@@ -332,7 +338,6 @@ homepage: https://github.com/traels-it/economic-rest
|
|
332
338
|
licenses:
|
333
339
|
- MIT
|
334
340
|
metadata: {}
|
335
|
-
post_install_message:
|
336
341
|
rdoc_options: []
|
337
342
|
require_paths:
|
338
343
|
- lib
|
@@ -347,8 +352,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
347
352
|
- !ruby/object:Gem::Version
|
348
353
|
version: '0'
|
349
354
|
requirements: []
|
350
|
-
rubygems_version: 3.
|
351
|
-
signing_key:
|
355
|
+
rubygems_version: 3.6.3
|
352
356
|
specification_version: 4
|
353
357
|
summary: Ruby wrapper for the e-conomic REST API, that aims at making working with
|
354
358
|
the API bearable. E-conomic is a web-based accounting system. For their marketing
|