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,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Eol
|
|
4
|
+
class PaymentCondition
|
|
5
|
+
include Eol::Resource
|
|
6
|
+
|
|
7
|
+
def base_path
|
|
8
|
+
"cashflow/PaymentConditions"
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def mandatory_attributes
|
|
12
|
+
%i[code]
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# https//start.exactonline.nl/docs/HlpRestAPIResourcesDetails.aspx?name=CashflowPaymentConditions
|
|
16
|
+
def other_attributes
|
|
17
|
+
%i[
|
|
18
|
+
created description discount_payment_days
|
|
19
|
+
discount_percentage payment_days payment_discount_type
|
|
20
|
+
payment_end_of_months payment_method percentage
|
|
21
|
+
VAT_calculation
|
|
22
|
+
]
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Eol
|
|
4
|
+
# We can use the PrintedSalesInvoice to change the status of SalesInvoices from
|
|
5
|
+
# Open to 'Verwerkt' while at the same time sending a PDF of the invoice to the
|
|
6
|
+
# end user by e-mail.
|
|
7
|
+
#
|
|
8
|
+
# This endpoint only supports the POST method.
|
|
9
|
+
#
|
|
10
|
+
class PrintedSalesInvoice
|
|
11
|
+
include Eol::Resource
|
|
12
|
+
|
|
13
|
+
def valid_actions
|
|
14
|
+
%i[post]
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def base_path
|
|
18
|
+
"salesinvoice/PrintedSalesInvoices"
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def mandatory_attributes
|
|
22
|
+
%i[invoice_ID]
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# https//start.exactonline.nl/docs/HlpRestAPIResourcesDetails.aspx?name=SalesInvoicePrintedSalesInvoices
|
|
26
|
+
def other_attributes
|
|
27
|
+
%i[
|
|
28
|
+
division document document_creation_error document_creation_success
|
|
29
|
+
document_layout email_creation_error email_creation_success email_layout
|
|
30
|
+
extra_text invoice_date postbox_message_creation_error
|
|
31
|
+
postbox_message_creation_success postbox_sender reporting_period
|
|
32
|
+
reporting_year send_email_to_customer sender_email_address
|
|
33
|
+
send_invoice_to_customer_postbox send_output_based_on_account
|
|
34
|
+
]
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Eol
|
|
4
|
+
class Project
|
|
5
|
+
include Eol::Resource
|
|
6
|
+
|
|
7
|
+
def base_path
|
|
8
|
+
"project/Projects"
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def mandatory_attributes
|
|
12
|
+
%i[account description code type]
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# https://start.exactonline.nl/docs/HlpRestAPIResourcesDetails.aspx?name=ProjectProjects
|
|
16
|
+
def other_attributes
|
|
17
|
+
%i[account account_code AccountContact account_name allow_additional_invoicing block_entry block_rebilling budgeted_amount budgeted_costs
|
|
18
|
+
budgeted_hours_per_hour_type BudgetedRevenue BudgetType BudgetTypeDescription clasification classification_description code costs_amount_fc
|
|
19
|
+
created creator creator_full_name customer_p_onumber description division division_name end_date fixed_price_item
|
|
20
|
+
fixed_price_item_description invoice_as_quoted invoice_terms manager manager_fullname markup_percentage modified modifier modifier_full_name
|
|
21
|
+
notes prepaid_item prepaid_item_description prepaid_type prepaid_type_description project_restriction_employees project_restriction_items
|
|
22
|
+
project_restriction_rebillings sales_time_quantity source_quotation start_date time_quantity_to_alert type type_description
|
|
23
|
+
use_billing_milestones]
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Eol
|
|
4
|
+
class PurchaseEntry
|
|
5
|
+
include Eol::Resource
|
|
6
|
+
|
|
7
|
+
def base_path
|
|
8
|
+
"purchaseentry/PurchaseEntries"
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def mandatory_attributes
|
|
12
|
+
%i[journal purchase_entry_lines supplier]
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def other_attributes
|
|
16
|
+
%i[currency batch_number description document due_date entry_date entry_number external_link_reference invoice_number rate reporting_period
|
|
17
|
+
reporting_year reversal VAT_amount_FC your_ref]
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Eol
|
|
4
|
+
# We can use the AgingReceivablesList to change the status of SalesInvoices from
|
|
5
|
+
# Open to 'Verwerkt' while at the same time sending a PDF of the invoice to the
|
|
6
|
+
# end user by e-mail.
|
|
7
|
+
#
|
|
8
|
+
# This endpoint only supports the POST method.
|
|
9
|
+
#
|
|
10
|
+
class ReceivablesList
|
|
11
|
+
include Eol::Resource
|
|
12
|
+
|
|
13
|
+
def valid_actions
|
|
14
|
+
[:get]
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def base_path
|
|
18
|
+
"read/financial/ReceivablesList"
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def mandatory_attributes
|
|
22
|
+
[]
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# https://start.exactonline.nl/docs/HlpRestAPIResourcesDetails.aspx?name=ReadFinancialReceivablesList
|
|
26
|
+
def other_attributes
|
|
27
|
+
%i[description hid account_code account_id account_name amount amount_in_transit currency_code description due_date entry_number id
|
|
28
|
+
invoice_date invoice_number journal_code journal_description your_ref]
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Eol
|
|
4
|
+
class SalesEntry
|
|
5
|
+
# A sales entry needs multiple sales entry lines
|
|
6
|
+
# It should also have a journal id and a contact id who ordered it
|
|
7
|
+
include Eol::Resource
|
|
8
|
+
|
|
9
|
+
def base_path
|
|
10
|
+
"salesentry/SalesEntries"
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def mandatory_attributes
|
|
14
|
+
%i[journal customer sales_entry_lines]
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def other_attributes
|
|
18
|
+
%i[batch_number currency document due_date entry_date entry_number invoice_number order_number payment_condition payment_reference
|
|
19
|
+
process_number rate reporting_period reporting_year reversal VAT_amount_FC your_ref description]
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Eol
|
|
4
|
+
class SalesInvoice
|
|
5
|
+
# An sales_invoice usually has multiple sales_invoice lines
|
|
6
|
+
# It should also have a journal id and a contact id who ordered it
|
|
7
|
+
include Eol::Resource
|
|
8
|
+
include Eol::SharedSalesAttributes
|
|
9
|
+
|
|
10
|
+
def base_path
|
|
11
|
+
"salesinvoice/SalesInvoices"
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def mandatory_attributes
|
|
15
|
+
[:ordered_by]
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def other_attributes
|
|
19
|
+
SHARED_SALES_ATTRIBUTES.inject(
|
|
20
|
+
%i[sales_invoice_lines due_date salesperson starter_sales_invoice_status type journal],
|
|
21
|
+
:<<
|
|
22
|
+
)
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Eol
|
|
4
|
+
class SalesInvoiceLine
|
|
5
|
+
# An sales_invoice_line should always have a reference to an item and to an sales_invoice.
|
|
6
|
+
include Eol::Resource
|
|
7
|
+
include Eol::SharedSalesAttributes
|
|
8
|
+
|
|
9
|
+
def base_path
|
|
10
|
+
"salesinvoice/SalesInvoiceLines"
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def mandatory_attributes
|
|
14
|
+
%i[item invoice_ID]
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def other_attributes
|
|
18
|
+
SHARED_LINE_ATTRIBUTES.inject(
|
|
19
|
+
%i[employee end_time line_number start_time subscription VAT_amount_DC VAT_amount_FC GL_account discount unit_price],
|
|
20
|
+
:<<
|
|
21
|
+
)
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Eol
|
|
4
|
+
class SalesItemPrices
|
|
5
|
+
include Eol::Resource
|
|
6
|
+
|
|
7
|
+
def base_path
|
|
8
|
+
"logistics/SalesItemPrices"
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def mandatory_attributes; end
|
|
12
|
+
|
|
13
|
+
def other_attributes
|
|
14
|
+
%i[account account_name created creator creator_full_name currency default_item_unit default_item_unit_description division end_date item
|
|
15
|
+
item_code item_description modified modifier modifier_full_name number_of_items_per_unit price quantity start_date unit unit_description]
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Eol
|
|
4
|
+
class SalesOrder
|
|
5
|
+
include Eol::Resource
|
|
6
|
+
include Eol::SharedSalesAttributes
|
|
7
|
+
|
|
8
|
+
def base_path
|
|
9
|
+
"salesorder/SalesOrders"
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def mandatory_attributes
|
|
13
|
+
%i[sales_order_lines ordered_by]
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def other_attributes
|
|
17
|
+
SHARED_SALES_ATTRIBUTES.inject(
|
|
18
|
+
%i[deliver_to_contact_person delivery_date delivery_status sales_person shipping_method status tax_schedule warehouse_ID],
|
|
19
|
+
:<<
|
|
20
|
+
)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Eol
|
|
4
|
+
class SalesOrderLine
|
|
5
|
+
include Eol::Resource
|
|
6
|
+
include Eol::SharedSalesAttributes
|
|
7
|
+
|
|
8
|
+
def base_path
|
|
9
|
+
"salesorder/SalesOrderLines"
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def mandatory_attributes
|
|
13
|
+
%i[item order_ID]
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def other_attributes
|
|
17
|
+
SHARED_LINE_ATTRIBUTES.inject(
|
|
18
|
+
%i[amount_FC delivery_date item_version order_number unit_price use_drop_shipment VAT_amount],
|
|
19
|
+
:<<
|
|
20
|
+
)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Eol
|
|
4
|
+
module SharedSalesAttributes
|
|
5
|
+
SHARED_SALES_ATTRIBUTES = %i[currency invoice_to invoice_to_contact_person invoice_date description document order_date ordered_by_contact_person
|
|
6
|
+
tax_schedule order_number payment_condition payment_reference remarks your_ref amount_DC].freeze
|
|
7
|
+
|
|
8
|
+
SHARED_LINE_ATTRIBUTES = %i[discount quantity amount_FC description VAT_code cost_center cost_unit VAT_percentage unit_code tax_schedule
|
|
9
|
+
net_price notes pricelist project amount_DC].freeze
|
|
10
|
+
end
|
|
11
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Eol
|
|
4
|
+
class TimeTransaction
|
|
5
|
+
include Eol::Resource
|
|
6
|
+
|
|
7
|
+
def base_path
|
|
8
|
+
"project/TimeTransactions"
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def mandatory_attributes
|
|
12
|
+
%i[account item quantity]
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# https://start.exactonline.nl/docs/HlpRestAPIResourcesDetails.aspx?name=ProjectTimeTransactions
|
|
16
|
+
def other_attributes
|
|
17
|
+
%i[account account_name activity activity_description amount amount_fc attachment created creator creator_full_name currency date division
|
|
18
|
+
division_description employee end_time entry_number error_text hour_status item item_description item_divisable modified modifier
|
|
19
|
+
modifier_full_name notes price price_fc project project_account project_account_code project_account_name project_description quantity
|
|
20
|
+
start_time subscription subscription_account subscription_account_code subscription_account_name subscription_description
|
|
21
|
+
subscription_number type]
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Eol
|
|
4
|
+
class Transaction
|
|
5
|
+
include Eol::Resource
|
|
6
|
+
|
|
7
|
+
def valid_actions
|
|
8
|
+
%i[get]
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def base_path
|
|
12
|
+
"financialtransaction/Transactions"
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def mandatory_attributes
|
|
16
|
+
[]
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def other_attributes
|
|
20
|
+
%i[description]
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Eol
|
|
4
|
+
class TransactionLine
|
|
5
|
+
include Eol::Resource
|
|
6
|
+
|
|
7
|
+
def valid_actions
|
|
8
|
+
%i[get]
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def base_path
|
|
12
|
+
"financialtransaction/TransactionLines"
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def mandatory_attributes
|
|
16
|
+
[]
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def other_attributes
|
|
20
|
+
%i[asset_code]
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Eol
|
|
4
|
+
class User
|
|
5
|
+
include Eol::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
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Eol
|
|
4
|
+
class VatCode
|
|
5
|
+
include Eol::Resource
|
|
6
|
+
|
|
7
|
+
def base_path
|
|
8
|
+
"vat/VATCodes"
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def other_attributes
|
|
12
|
+
%i[account calculation_basis charged EU_sales_listing GL_discount_purchase GL_discount_sales GL_to_claim GL_to_pay intra_stat is_blocked
|
|
13
|
+
legal_text tax_return_type type vat_doc_type vat_margin VAT_partial_ratio VAT_percentages VAT_transaction_type]
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def mandatory_attributes
|
|
17
|
+
%i[code description]
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|