elmas 2.5.0 → 2.6.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 +4 -4
- data/Changelog.md +14 -0
- data/README.md +4 -0
- data/lib/elmas.rb +4 -0
- data/lib/elmas/resources/address.rb +36 -0
- data/lib/elmas/resources/bank_account.rb +1 -1
- data/lib/elmas/resources/goods_delivery.rb +37 -0
- data/lib/elmas/resources/goods_delivery_line.rb +38 -0
- data/lib/elmas/resources/printed_sales_invoice.rb +2 -2
- data/lib/elmas/resources/sales_invoice.rb +1 -1
- data/lib/elmas/resources/user.rb +27 -0
- data/lib/elmas/version.rb +1 -1
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4840a3f199ef30c829409b92a207b39fde8cdb1
|
4
|
+
data.tar.gz: 95aa8f2d9383565fbd3cca3199a1e983635830ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77744d31e6373970e4e8cb92668fd0802af0a5d91267de329020a756b0199379ffa5e64c3863f52afb54f1215c41e1360f29f427437068377409eca7c335385e
|
7
|
+
data.tar.gz: f7758eaae28006c2e346ddc95077a874489e74c891bb2e18078848deaf54a60a8f5ad9696df632c7250091673616e87a0087dddc826d9343950a1611efeb7391
|
data/Changelog.md
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
## 2.6.0
|
2
|
+
- Add main atttribute to bank account (thanks @Korstiaan)
|
3
|
+
- Add address object (thanks @chicks)
|
4
|
+
- Add user model (thanks @michielverkoijen)
|
5
|
+
- Add couple missing attrbutes (thanks @michielverkoijen)
|
6
|
+
|
7
|
+
## 2.5.0
|
8
|
+
- Fix some stuff in the Oauth logic (thanks @michielverkoijen)
|
9
|
+
- Add division class (thanks @michielverkoijen)
|
10
|
+
- Remove mandatory attribute from SalesInvoice (thanks @michielverkoijen)
|
11
|
+
- Add configurable logger (thanks @jdlombardozzi)
|
12
|
+
- Add refresh token logic so you do not always have to reauthorize (thanks @jdlombardozzi)
|
13
|
+
- Fix all rubocop issues (thanks @jdlombardozzi)
|
14
|
+
|
1
15
|
## 2.4.2
|
2
16
|
- Add thread safety
|
3
17
|
|
data/README.md
CHANGED
@@ -7,6 +7,10 @@
|
|
7
7
|
|
8
8
|
Elmas means diamond, but in this case it's an API wrapper for [Exact Online](https://developers.exactonline.com/). This gem was created by [@Marthyn](https://github.com/marthyn), [Hoppinger](http://www.hoppinger.com) and a few people:
|
9
9
|
|
10
|
+
# DISCLAIMER
|
11
|
+
|
12
|
+
Please read the Authorization part of this readme before opening an issue about it and realize it's a functionality that is only intented for debugging purposes really, or to allow App to App communication, but it's really better to CREATE YOUR OWN authentication/refresh/authorization logic for your customers through the normal OAUTH path. The code in the Oauth.rb file could break any time Exact changes their login form for example.
|
13
|
+
|
10
14
|
### Contributers
|
11
15
|
|
12
16
|
* [Commuun](https://github.com/commuun)
|
data/lib/elmas.rb
CHANGED
@@ -25,6 +25,7 @@ require "elmas/resources/sales_item_prices"
|
|
25
25
|
require "elmas/resources/item"
|
26
26
|
require "elmas/resources/item_group"
|
27
27
|
require "elmas/resources/account"
|
28
|
+
require "elmas/resources/address"
|
28
29
|
require "elmas/resources/gl_account"
|
29
30
|
require "elmas/resources/sales_entry"
|
30
31
|
require "elmas/resources/sales_entry_line"
|
@@ -45,7 +46,10 @@ require "elmas/resources/vat_code"
|
|
45
46
|
require "elmas/resources/general_journal_entry"
|
46
47
|
require "elmas/resources/general_journal_entry_line"
|
47
48
|
require "elmas/resources/payment_condition"
|
49
|
+
require "elmas/resources/goods_delivery"
|
50
|
+
require "elmas/resources/goods_delivery_line"
|
48
51
|
require "elmas/resources/division"
|
52
|
+
require "elmas/resources/user"
|
49
53
|
|
50
54
|
module Elmas
|
51
55
|
extend Config
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module Elmas
|
2
|
+
class Address
|
3
|
+
# An account needs a name
|
4
|
+
include Elmas::Resource
|
5
|
+
|
6
|
+
def base_path
|
7
|
+
"crm/Addresses"
|
8
|
+
end
|
9
|
+
|
10
|
+
def mandatory_attributes
|
11
|
+
[:type]
|
12
|
+
end
|
13
|
+
|
14
|
+
# https://start.exactonline.nl/docs/HlpRestAPIResourcesDetails.aspx?name=CRMAddresses
|
15
|
+
def other_attributes # rubocop:disable Metrics/MethodLength
|
16
|
+
[
|
17
|
+
:account, :account_is_supplier, :account_name,
|
18
|
+
:address_line1, :address_line2, :address_line3,
|
19
|
+
:city, :contact, :contact_name,
|
20
|
+
:country, :country_name, :created,
|
21
|
+
:creator, :creator_full_name, :division,
|
22
|
+
:fax, :free_bool_field_01, :free_bool_field_02,
|
23
|
+
:free_bool_field_03, :free_bool_field_04, :free_bool_field_05,
|
24
|
+
:free_date_field_01, :free_date_field_02, :free_date_field_03,
|
25
|
+
:free_date_field_04, :free_date_field_05, :free_number_field_01,
|
26
|
+
:free_number_field_02, :free_number_field_03, :free_number_field_04,
|
27
|
+
:free_number_field_05, :free_text_field_01, :free_text_field_02,
|
28
|
+
:free_text_field_03, :free_text_field_04, :free_text_field_05,
|
29
|
+
:mailbox, :main, :modified, :modifier, :modifier_full_name,
|
30
|
+
:nic_number, :notes, :phone, :phone_extension, :postcode,
|
31
|
+
:state, :state_description, :type,
|
32
|
+
:warehouse, :warehouse_code, :warehouse_description
|
33
|
+
]
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module Elmas
|
2
|
+
class GoodsDelivery
|
3
|
+
include Elmas::Resource
|
4
|
+
include Elmas::SharedSalesAttributes
|
5
|
+
|
6
|
+
# For some reason the Exact API for GoodsDelivery requires us to specify
|
7
|
+
# the fields we want returned. This isn't required for other calls. :/
|
8
|
+
# We get around this by specifying a wildcard on the $select param.
|
9
|
+
def find_all(options = {})
|
10
|
+
@order_by = options[:order_by]
|
11
|
+
@select = options[:select] ||= ['*']
|
12
|
+
response = get(uri([:order, :select]))
|
13
|
+
response.results if response
|
14
|
+
end
|
15
|
+
|
16
|
+
def base_path
|
17
|
+
"salesorder/GoodsDeliveries"
|
18
|
+
end
|
19
|
+
|
20
|
+
def mandatory_attributes
|
21
|
+
[:goods_delivery_lines]
|
22
|
+
end
|
23
|
+
|
24
|
+
def other_attributes
|
25
|
+
SHARED_SALES_ATTRIBUTES.inject(
|
26
|
+
[
|
27
|
+
:delivery_account, :delivery_account_code, :delivery_account_name,
|
28
|
+
:delivery_address, :delivery_contact, :delivery_contact_person_full_name,
|
29
|
+
:delivery_date, :delivery_number,
|
30
|
+
:shipping_method, :shipping_method_code, :shipping_method_description,
|
31
|
+
:tracking_number, :warehouse, :warehouse_code, :warehouse_description
|
32
|
+
],
|
33
|
+
:<<
|
34
|
+
)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module Elmas
|
2
|
+
class GoodsDeliveryLine
|
3
|
+
# TODO: Fill out mandatory and other attributes
|
4
|
+
include Elmas::Resource
|
5
|
+
include Elmas::SharedSalesAttributes
|
6
|
+
|
7
|
+
# For some reason the Exact API for GoodsDelivery requires us to specify
|
8
|
+
# the fields we want returned. This isn't required for other calls. :/
|
9
|
+
# We get around this by specifying a wildcard on the $select param.
|
10
|
+
def find_all(options = {})
|
11
|
+
@order_by = options[:order_by]
|
12
|
+
@select = options[:select] ||= ['*']
|
13
|
+
response = get(uri([:order, :select]))
|
14
|
+
response.results if response
|
15
|
+
end
|
16
|
+
|
17
|
+
def base_path
|
18
|
+
"salesorder/GoodsDeliveryLines"
|
19
|
+
end
|
20
|
+
|
21
|
+
def mandatory_attributes
|
22
|
+
[:delivery_date, :item, :line_number, :sales_order_number]
|
23
|
+
end
|
24
|
+
|
25
|
+
def other_attributes
|
26
|
+
SHARED_LINE_ATTRIBUTES.inject(
|
27
|
+
[
|
28
|
+
:quantity_delivered, :quantity_ordered,
|
29
|
+
:sales_order_line_id, :sales_order_line_number,
|
30
|
+
:serial_numbers, :storage_location,
|
31
|
+
:tracking_number, :unit_code
|
32
|
+
],
|
33
|
+
:<<
|
34
|
+
)
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
end
|
@@ -29,8 +29,8 @@ module Elmas
|
|
29
29
|
document_layout email_creation_error email_creation_success email_layout
|
30
30
|
extra_text invoice_date postbox_message_creation_error
|
31
31
|
postbox_message_creation_success postbox_sender reporting_period
|
32
|
-
reporting_year send_email_to_customer
|
33
|
-
send_output_based_on_account
|
32
|
+
reporting_year send_email_to_customer sender_email_address
|
33
|
+
send_invoice_to_customer_postbox send_output_based_on_account
|
34
34
|
]
|
35
35
|
end
|
36
36
|
end
|
@@ -17,7 +17,7 @@ module Elmas
|
|
17
17
|
|
18
18
|
def other_attributes
|
19
19
|
SHARED_SALES_ATTRIBUTES.inject(
|
20
|
-
%i[sales_invoice_lines due_date
|
20
|
+
%i[sales_invoice_lines due_date salesperson starter_sales_invoice_status type],
|
21
21
|
:<<
|
22
22
|
)
|
23
23
|
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Elmas
|
4
|
+
class User
|
5
|
+
include Elmas::Resource
|
6
|
+
|
7
|
+
def base_path
|
8
|
+
"users/Users"
|
9
|
+
end
|
10
|
+
|
11
|
+
def mandatory_attributes
|
12
|
+
[]
|
13
|
+
end
|
14
|
+
|
15
|
+
# https://start.exactonline.nl/docs/HlpRestAPIResourcesDetails.aspx?name=UsersUsers
|
16
|
+
def other_attributes
|
17
|
+
%i[
|
18
|
+
birth_date birth_name created creator creator_full_name customer
|
19
|
+
customer_name email end_date first_name full_name gender
|
20
|
+
has_registered_for_two_step_verification has_two_step_verification
|
21
|
+
initials language last_login last_name middle_name mobile modified
|
22
|
+
modifier modifier_full_name nationality notes phone phone_extension
|
23
|
+
profile_code start_date start_division title user_name
|
24
|
+
]
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
data/lib/elmas/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: elmas
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marthyn
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activeresource
|
@@ -281,6 +281,7 @@ files:
|
|
281
281
|
- lib/elmas/request.rb
|
282
282
|
- lib/elmas/resource.rb
|
283
283
|
- lib/elmas/resources/account.rb
|
284
|
+
- lib/elmas/resources/address.rb
|
284
285
|
- lib/elmas/resources/aging_receivables_list.rb
|
285
286
|
- lib/elmas/resources/bank_account.rb
|
286
287
|
- lib/elmas/resources/bank_entry.rb
|
@@ -297,6 +298,8 @@ files:
|
|
297
298
|
- lib/elmas/resources/general_journal_entry.rb
|
298
299
|
- lib/elmas/resources/general_journal_entry_line.rb
|
299
300
|
- lib/elmas/resources/gl_account.rb
|
301
|
+
- lib/elmas/resources/goods_delivery.rb
|
302
|
+
- lib/elmas/resources/goods_delivery_line.rb
|
300
303
|
- lib/elmas/resources/item.rb
|
301
304
|
- lib/elmas/resources/item_group.rb
|
302
305
|
- lib/elmas/resources/journal.rb
|
@@ -319,6 +322,7 @@ files:
|
|
319
322
|
- lib/elmas/resources/time_transaction.rb
|
320
323
|
- lib/elmas/resources/transaction.rb
|
321
324
|
- lib/elmas/resources/transaction_line.rb
|
325
|
+
- lib/elmas/resources/user.rb
|
322
326
|
- lib/elmas/resources/vat_code.rb
|
323
327
|
- lib/elmas/response.rb
|
324
328
|
- lib/elmas/result_set.rb
|