eol-client 1.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 +7 -0
- data/.drone.yaml +12 -0
- data/.gitignore +16 -0
- data/.rspec +2 -0
- data/.rubocop.yml +60 -0
- data/.ruby-version +1 -0
- data/.travis.yml +11 -0
- data/Changelog.md +3 -0
- data/Gemfile +6 -0
- data/Guardfile +13 -0
- data/LICENSE +21 -0
- data/README.md +247 -0
- data/Rakefile +13 -0
- data/bin/console +16 -0
- data/bin/setup +7 -0
- data/eol.gemspec +40 -0
- data/jenkins.sh +33 -0
- data/lib/eol.rb +79 -0
- data/lib/eol/api.rb +32 -0
- data/lib/eol/client.rb +13 -0
- data/lib/eol/config.rb +105 -0
- data/lib/eol/exception.rb +21 -0
- data/lib/eol/oauth.rb +117 -0
- data/lib/eol/parser.rb +42 -0
- data/lib/eol/request.rb +63 -0
- data/lib/eol/resource.rb +104 -0
- data/lib/eol/resources/account.rb +43 -0
- data/lib/eol/resources/address.rb +36 -0
- data/lib/eol/resources/aging_receivables_list.rb +34 -0
- data/lib/eol/resources/bank_account.rb +32 -0
- data/lib/eol/resources/bank_entry.rb +22 -0
- data/lib/eol/resources/bank_entry_line.rb +20 -0
- data/lib/eol/resources/base_entry_line.rb +20 -0
- data/lib/eol/resources/cash_entry.rb +22 -0
- data/lib/eol/resources/cash_entry_line.rb +20 -0
- data/lib/eol/resources/contact.rb +27 -0
- data/lib/eol/resources/costcenter.rb +19 -0
- data/lib/eol/resources/costunit.rb +19 -0
- data/lib/eol/resources/division.rb +26 -0
- data/lib/eol/resources/document.rb +23 -0
- data/lib/eol/resources/document_attachment.rb +19 -0
- data/lib/eol/resources/general_journal_entry.rb +19 -0
- data/lib/eol/resources/general_journal_entry_line.rb +11 -0
- data/lib/eol/resources/gl_account.rb +27 -0
- data/lib/eol/resources/goods_delivery.rb +37 -0
- data/lib/eol/resources/goods_delivery_line.rb +38 -0
- data/lib/eol/resources/item.rb +36 -0
- data/lib/eol/resources/item_group.rb +23 -0
- data/lib/eol/resources/journal.rb +23 -0
- data/lib/eol/resources/layout.rb +26 -0
- data/lib/eol/resources/mailbox.rb +22 -0
- data/lib/eol/resources/payment_condition.rb +25 -0
- data/lib/eol/resources/printed_sales_invoice.rb +37 -0
- data/lib/eol/resources/project.rb +26 -0
- data/lib/eol/resources/purchase_entry.rb +20 -0
- data/lib/eol/resources/purchase_entry_line.rb +11 -0
- data/lib/eol/resources/receivables_list.rb +31 -0
- data/lib/eol/resources/sales_entry.rb +22 -0
- data/lib/eol/resources/sales_entry_line.rb +12 -0
- data/lib/eol/resources/sales_invoice.rb +25 -0
- data/lib/eol/resources/sales_invoice_line.rb +24 -0
- data/lib/eol/resources/sales_item_prices.rb +18 -0
- data/lib/eol/resources/sales_order.rb +23 -0
- data/lib/eol/resources/sales_order_line.rb +23 -0
- data/lib/eol/resources/shared_sales_attributes.rb +11 -0
- data/lib/eol/resources/time_transaction.rb +24 -0
- data/lib/eol/resources/transaction.rb +23 -0
- data/lib/eol/resources/transaction_line.rb +23 -0
- data/lib/eol/resources/user.rb +27 -0
- data/lib/eol/resources/vat_code.rb +20 -0
- data/lib/eol/response.rb +72 -0
- data/lib/eol/result_set.rb +62 -0
- data/lib/eol/sanitizer.rb +54 -0
- data/lib/eol/uri.rb +87 -0
- data/lib/eol/utils.rb +50 -0
- data/lib/eol/version.rb +15 -0
- metadata +356 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Eol
|
|
4
|
+
class CashEntryLine < Eol::BaseEntryLine
|
|
5
|
+
# A sales entry line belongs to a sales entry
|
|
6
|
+
include Eol::Resource
|
|
7
|
+
|
|
8
|
+
def base_path
|
|
9
|
+
"financialtransaction/CashEntryLines"
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def other_attributes
|
|
13
|
+
%i[
|
|
14
|
+
account amount_VATFC asset cost_center cost_unit date
|
|
15
|
+
description notes document exchange_rate our_ref
|
|
16
|
+
project quantity VAT_code VAT_percentage VAT_type
|
|
17
|
+
]
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Eol
|
|
4
|
+
class Contact
|
|
5
|
+
# A contact needs a First and Last name and a reference to an account
|
|
6
|
+
include Eol::Resource
|
|
7
|
+
|
|
8
|
+
def base_path
|
|
9
|
+
"crm/Contacts"
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def mandatory_attributes
|
|
13
|
+
%i[first_name last_name account]
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def other_attributes
|
|
17
|
+
%i[
|
|
18
|
+
account_name birt_date birth_name birth_name_prefix birth_place
|
|
19
|
+
business_email business_fax business_mobile business_phone business_phone_extention
|
|
20
|
+
email end_date first_name gender HID initials is_mailing_excluded
|
|
21
|
+
job_title_description language marketing_notes middle_name
|
|
22
|
+
mobile nationality notes person phone picture picture_name
|
|
23
|
+
social_security_number start_date title
|
|
24
|
+
]
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Eol
|
|
4
|
+
class Costcenter
|
|
5
|
+
include Eol::Resource
|
|
6
|
+
|
|
7
|
+
def base_path
|
|
8
|
+
"hrm/Costcenters"
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def mandatory_attributes
|
|
12
|
+
%i[code description]
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def other_attributes
|
|
16
|
+
%i[active]
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Eol
|
|
4
|
+
class Costunit
|
|
5
|
+
include Eol::Resource
|
|
6
|
+
|
|
7
|
+
def base_path
|
|
8
|
+
"hrm/Costunits"
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def mandatory_attributes
|
|
12
|
+
%i[code description]
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def other_attributes
|
|
16
|
+
%i[account]
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Eol
|
|
4
|
+
class Division
|
|
5
|
+
include Eol::Resource
|
|
6
|
+
|
|
7
|
+
def base_path
|
|
8
|
+
"system/Divisions"
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def mandatory_attributes
|
|
12
|
+
[]
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# https//start.exactonline.nl/docs/HlpRestAPIResourcesDetails.aspx?name=SystemSystemDivisions
|
|
16
|
+
def other_attributes
|
|
17
|
+
%i[
|
|
18
|
+
code address_line1 address_line2 address_line3
|
|
19
|
+
chamber_of_commerce_number city country created currency
|
|
20
|
+
current customer customer_code customer_name description
|
|
21
|
+
email hid is_main_division modified phone postcode state
|
|
22
|
+
status VAT_number
|
|
23
|
+
]
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Eol
|
|
4
|
+
class Document
|
|
5
|
+
include Eol::Resource
|
|
6
|
+
|
|
7
|
+
def base_path
|
|
8
|
+
"documents/Documents"
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def mandatory_attributes
|
|
12
|
+
%i[subject type]
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def other_attributes
|
|
16
|
+
%i[
|
|
17
|
+
account amount_FC body category category_description creator_full_name
|
|
18
|
+
currency document_date document_folder financial_transaction_entry_ID
|
|
19
|
+
HID language opportunity sales_invoice_number shop_order_number
|
|
20
|
+
]
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Eol
|
|
4
|
+
class DocumentAttachment
|
|
5
|
+
include Eol::Resource
|
|
6
|
+
|
|
7
|
+
def base_path
|
|
8
|
+
"documents/DocumentAttachments"
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def mandatory_attributes
|
|
12
|
+
%i[attachment document file_name]
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def other_attributes
|
|
16
|
+
[]
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Eol
|
|
4
|
+
class GeneralJournalEntry
|
|
5
|
+
include Eol::Resource
|
|
6
|
+
|
|
7
|
+
def base_path
|
|
8
|
+
"generaljournalentry/GeneralJournalEntries"
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def mandatory_attributes
|
|
12
|
+
%i[journal_code general_journal_entry_lines]
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def other_attributes
|
|
16
|
+
%i[financial_period financial_year currency exchange_rate reversal]
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Eol
|
|
4
|
+
class GLAccount
|
|
5
|
+
include Eol::Resource
|
|
6
|
+
|
|
7
|
+
def base_path
|
|
8
|
+
"financial/GLAccounts"
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def mandatory_attributes
|
|
12
|
+
%i[code description]
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def other_attributes
|
|
16
|
+
%i[
|
|
17
|
+
assimilated_VAT_box balance_side balance_type belcotax_type compress
|
|
18
|
+
cost_center cost_unit exclude_VAT_listing expense_non_deductible_percentage
|
|
19
|
+
is_blocked matching private_GL_account private_percentage reporting_code
|
|
20
|
+
revalue_currency searc_code type use_cost_center use_cost_unit
|
|
21
|
+
VAT_code VAT_GL_account_type VAT_non_deductible_GL_account
|
|
22
|
+
VAT_non_deductible_percentage VAT_system year_end_cost_GL_account
|
|
23
|
+
year_end_reflection_GL_account
|
|
24
|
+
]
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
module Eol
|
|
2
|
+
class GoodsDelivery
|
|
3
|
+
include Eol::Resource
|
|
4
|
+
include Eol::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 Eol
|
|
2
|
+
class GoodsDeliveryLine
|
|
3
|
+
# TODO: Fill out mandatory and other attributes
|
|
4
|
+
include Eol::Resource
|
|
5
|
+
include Eol::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
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Eol
|
|
4
|
+
class Item
|
|
5
|
+
include Eol::Resource
|
|
6
|
+
|
|
7
|
+
def base_path
|
|
8
|
+
"logistics/Items"
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def mandatory_attributes
|
|
12
|
+
%i[code description]
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# rubocop:disable Metrics/MethodLength
|
|
16
|
+
def other_attributes
|
|
17
|
+
%i[
|
|
18
|
+
class_01 class_02 class_03 class_04 class_05 copy_remarks
|
|
19
|
+
cost_price_currency cost_price_new cost_price_standard end_date
|
|
20
|
+
extra_description free_bool_field_01 free_bool_field_02 free_bool_field_03
|
|
21
|
+
free_bool_field_04 free_bool_field_05 free_date_field_01 free_date_field_02
|
|
22
|
+
free_date_field_03 free_date_field_04 free_date_field_05 free_number_field_01
|
|
23
|
+
free_number_field_02 free_number_field_03 free_number_field_04 free_number_field_05
|
|
24
|
+
free_number_field_06 free_number_field_07 free_number_field_08 free_text_field_01
|
|
25
|
+
free_text_field_02 free_text_field_03 free_text_field_04 free_text_field_05
|
|
26
|
+
free_text_field_06 free_text_field_07 free_text_field_08 free_text_field_09
|
|
27
|
+
free_text_field_10 GL_costs GL_revenue GL_stock is_batch_item
|
|
28
|
+
is_batch_number_item is_fraction_allowed_item is_make_item is_new_contract
|
|
29
|
+
is_on_demand_item is_package_item is_registration_code_item is_purchase_item
|
|
30
|
+
is_sales_item is_serial_item is_serial_number_item is_stock_item
|
|
31
|
+
is_subcontracted_item is_time is_webshop_item item_group notes
|
|
32
|
+
sales_vat_code search_code security_level start_date unit
|
|
33
|
+
]
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Eol
|
|
4
|
+
class ItemGroup
|
|
5
|
+
include Eol::Resource
|
|
6
|
+
|
|
7
|
+
def valid_actions
|
|
8
|
+
%i[get]
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def base_path
|
|
12
|
+
"logistics/ItemGroups"
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def other_attributes
|
|
16
|
+
%i[code]
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def mandatory_attributes
|
|
20
|
+
[]
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Eol
|
|
4
|
+
class Journal
|
|
5
|
+
include Eol::Resource
|
|
6
|
+
|
|
7
|
+
def base_path
|
|
8
|
+
"financial/Journals"
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def mandatory_attributes
|
|
12
|
+
[]
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def other_attributes
|
|
16
|
+
%i[
|
|
17
|
+
code description allow_variable_currency allow_variable_exchange_rate
|
|
18
|
+
allow_VAT auto_save bank bank_account_ID bank_account_including_mask
|
|
19
|
+
currency GL_account payment_in_transit_account type
|
|
20
|
+
]
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Eol
|
|
4
|
+
class Layout
|
|
5
|
+
include Eol::Resource
|
|
6
|
+
|
|
7
|
+
def valid_actions
|
|
8
|
+
%i[get]
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def base_path
|
|
12
|
+
"salesinvoice/Layouts"
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def mandatory_attributes
|
|
16
|
+
[]
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def other_attributes
|
|
20
|
+
%i[
|
|
21
|
+
id created creator creator_full_name division
|
|
22
|
+
modified modifier modifier_full_name subject type
|
|
23
|
+
]
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Eol
|
|
4
|
+
class Mailbox
|
|
5
|
+
include Eol::Resource
|
|
6
|
+
|
|
7
|
+
def base_path
|
|
8
|
+
"mailbox/Mailboxes"
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def other_attributes
|
|
12
|
+
%i[
|
|
13
|
+
account description for_division publish
|
|
14
|
+
type valid_from valid_to
|
|
15
|
+
]
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def mandatory_attributes
|
|
19
|
+
%i[mailbox]
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|