elmas 2.4.2 → 2.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +9 -0
- data/Gemfile +3 -1
- data/Guardfile +6 -4
- data/README.md +15 -4
- data/Rakefile +3 -1
- data/elmas.gemspec +17 -15
- data/lib/elmas.rb +11 -2
- data/lib/elmas/api.rb +2 -0
- data/lib/elmas/client.rb +2 -0
- data/lib/elmas/config.rb +28 -21
- data/lib/elmas/exception.rb +2 -0
- data/lib/elmas/oauth.rb +40 -4
- data/lib/elmas/parser.rb +2 -0
- data/lib/elmas/request.rb +2 -0
- data/lib/elmas/resource.rb +7 -5
- data/lib/elmas/resources/account.rb +27 -24
- data/lib/elmas/resources/aging_receivables_list.rb +8 -6
- data/lib/elmas/resources/bank_account.rb +13 -19
- data/lib/elmas/resources/bank_entry.rb +6 -4
- data/lib/elmas/resources/bank_entry_line.rb +6 -4
- data/lib/elmas/resources/base_entry_line.rb +10 -6
- data/lib/elmas/resources/cash_entry.rb +22 -0
- data/lib/elmas/resources/cash_entry_line.rb +20 -0
- data/lib/elmas/resources/contact.rb +10 -8
- data/lib/elmas/resources/costcenter.rb +4 -2
- data/lib/elmas/resources/costunit.rb +4 -2
- data/lib/elmas/resources/division.rb +26 -0
- data/lib/elmas/resources/document.rb +7 -5
- data/lib/elmas/resources/document_attachment.rb +3 -1
- data/lib/elmas/resources/general_journal_entry.rb +4 -2
- data/lib/elmas/resources/general_journal_entry_line.rb +2 -0
- data/lib/elmas/resources/gl_account.rb +11 -9
- data/lib/elmas/resources/item.rb +21 -18
- data/lib/elmas/resources/item_group.rb +4 -2
- data/lib/elmas/resources/journal.rb +6 -4
- data/lib/elmas/resources/layout.rb +6 -4
- data/lib/elmas/resources/mailbox.rb +6 -4
- data/lib/elmas/resources/payment_condition.rb +9 -7
- data/lib/elmas/resources/printed_sales_invoice.rb +12 -10
- data/lib/elmas/resources/project.rb +11 -19
- data/lib/elmas/resources/purchase_entry.rb +5 -6
- data/lib/elmas/resources/purchase_entry_line.rb +2 -0
- data/lib/elmas/resources/receivables_list.rb +4 -5
- data/lib/elmas/resources/sales_entry.rb +5 -7
- data/lib/elmas/resources/sales_entry_line.rb +2 -0
- data/lib/elmas/resources/sales_invoice.rb +4 -5
- data/lib/elmas/resources/sales_invoice_line.rb +4 -5
- data/lib/elmas/resources/sales_item_prices.rb +4 -5
- data/lib/elmas/resources/sales_order.rb +4 -5
- data/lib/elmas/resources/sales_order_line.rb +4 -5
- data/lib/elmas/resources/shared_sales_attributes.rb +6 -11
- data/lib/elmas/resources/time_transaction.rb +8 -12
- data/lib/elmas/resources/transaction.rb +4 -2
- data/lib/elmas/resources/transaction_line.rb +4 -2
- data/lib/elmas/resources/vat_code.rb +5 -8
- data/lib/elmas/response.rb +5 -2
- data/lib/elmas/result_set.rb +4 -2
- data/lib/elmas/sanitizer.rb +7 -5
- data/lib/elmas/uri.rb +2 -0
- data/lib/elmas/utils.rb +2 -0
- data/lib/elmas/version.rb +4 -2
- metadata +29 -27
- data/lib/elmas/log.rb +0 -19
data/lib/elmas/resources/item.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Elmas
|
2
4
|
class Item
|
3
5
|
include Elmas::Resource
|
@@ -7,26 +9,27 @@ module Elmas
|
|
7
9
|
end
|
8
10
|
|
9
11
|
def mandatory_attributes
|
10
|
-
[
|
12
|
+
%i[code description]
|
11
13
|
end
|
12
14
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
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
|
30
33
|
]
|
31
34
|
end
|
32
35
|
end
|
@@ -1,9 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Elmas
|
2
4
|
class ItemGroup
|
3
5
|
include Elmas::Resource
|
4
6
|
|
5
7
|
def valid_actions
|
6
|
-
[
|
8
|
+
%i[get]
|
7
9
|
end
|
8
10
|
|
9
11
|
def base_path
|
@@ -11,7 +13,7 @@ module Elmas
|
|
11
13
|
end
|
12
14
|
|
13
15
|
def other_attributes
|
14
|
-
[
|
16
|
+
%i[code]
|
15
17
|
end
|
16
18
|
|
17
19
|
def mandatory_attributes
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Elmas
|
2
4
|
class Journal
|
3
5
|
include Elmas::Resource
|
@@ -11,10 +13,10 @@ module Elmas
|
|
11
13
|
end
|
12
14
|
|
13
15
|
def other_attributes
|
14
|
-
[
|
15
|
-
|
16
|
-
|
17
|
-
|
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
|
18
20
|
]
|
19
21
|
end
|
20
22
|
end
|
@@ -1,9 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Elmas
|
2
4
|
class Layout
|
3
5
|
include Elmas::Resource
|
4
6
|
|
5
7
|
def valid_actions
|
6
|
-
[
|
8
|
+
%i[get]
|
7
9
|
end
|
8
10
|
|
9
11
|
def base_path
|
@@ -15,9 +17,9 @@ module Elmas
|
|
15
17
|
end
|
16
18
|
|
17
19
|
def other_attributes
|
18
|
-
[
|
19
|
-
|
20
|
-
|
20
|
+
%i[
|
21
|
+
id created creator creator_full_name division
|
22
|
+
modified modifier modifier_full_name subject type
|
21
23
|
]
|
22
24
|
end
|
23
25
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Elmas
|
2
4
|
class Mailbox
|
3
5
|
include Elmas::Resource
|
@@ -7,14 +9,14 @@ module Elmas
|
|
7
9
|
end
|
8
10
|
|
9
11
|
def other_attributes
|
10
|
-
[
|
11
|
-
|
12
|
-
|
12
|
+
%i[
|
13
|
+
account description for_division publish
|
14
|
+
type valid_from valid_to
|
13
15
|
]
|
14
16
|
end
|
15
17
|
|
16
18
|
def mandatory_attributes
|
17
|
-
[
|
19
|
+
%i[mailbox]
|
18
20
|
end
|
19
21
|
end
|
20
22
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Elmas
|
2
4
|
class PaymentCondition
|
3
5
|
include Elmas::Resource
|
@@ -7,16 +9,16 @@ module Elmas
|
|
7
9
|
end
|
8
10
|
|
9
11
|
def mandatory_attributes
|
10
|
-
[
|
12
|
+
%i[code]
|
11
13
|
end
|
12
14
|
|
13
|
-
# https
|
15
|
+
# https//start.exactonline.nl/docs/HlpRestAPIResourcesDetails.aspx?name=CashflowPaymentConditions
|
14
16
|
def other_attributes
|
15
|
-
[
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
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
|
20
22
|
]
|
21
23
|
end
|
22
24
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Elmas
|
2
4
|
# We can use the PrintedSalesInvoice to change the status of SalesInvoices from
|
3
5
|
# Open to 'Verwerkt' while at the same time sending a PDF of the invoice to the
|
@@ -9,7 +11,7 @@ module Elmas
|
|
9
11
|
include Elmas::Resource
|
10
12
|
|
11
13
|
def valid_actions
|
12
|
-
[
|
14
|
+
%i[post]
|
13
15
|
end
|
14
16
|
|
15
17
|
def base_path
|
@@ -17,18 +19,18 @@ module Elmas
|
|
17
19
|
end
|
18
20
|
|
19
21
|
def mandatory_attributes
|
20
|
-
[
|
22
|
+
%i[invoice_ID]
|
21
23
|
end
|
22
24
|
|
23
|
-
# https
|
25
|
+
# https//start.exactonline.nl/docs/HlpRestAPIResourcesDetails.aspx?name=SalesInvoicePrintedSalesInvoices
|
24
26
|
def other_attributes
|
25
|
-
[
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
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 send_invoice_to_customer_postbox
|
33
|
+
send_output_based_on_account
|
32
34
|
]
|
33
35
|
end
|
34
36
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Elmas
|
2
4
|
class Project
|
3
5
|
include Elmas::Resource
|
@@ -7,28 +9,18 @@ module Elmas
|
|
7
9
|
end
|
8
10
|
|
9
11
|
def mandatory_attributes
|
10
|
-
[
|
12
|
+
%i[account description code type]
|
11
13
|
end
|
12
14
|
|
13
15
|
# https://start.exactonline.nl/docs/HlpRestAPIResourcesDetails.aspx?name=ProjectProjects
|
14
|
-
def other_attributes
|
15
|
-
[
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
:division, :division_name, :end_date, :fixed_price_item,
|
23
|
-
:fixed_price_item_description, :invoice_as_quoted, :invoice_terms,
|
24
|
-
:manager, :manager_fullname, :markup_percentage, :modified, :modifier,
|
25
|
-
:modifier_full_name, :notes, :prepaid_item, :prepaid_item_description,
|
26
|
-
:prepaid_type, :prepaid_type_description,
|
27
|
-
:project_restriction_employees, :project_restriction_items,
|
28
|
-
:project_restriction_rebillings, :sales_time_quantity,
|
29
|
-
:source_quotation, :start_date, :time_quantity_to_alert, :type,
|
30
|
-
:type_description, :use_billing_milestones
|
31
|
-
]
|
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]
|
32
24
|
end
|
33
25
|
end
|
34
26
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Elmas
|
2
4
|
class PurchaseEntry
|
3
5
|
include Elmas::Resource
|
@@ -7,15 +9,12 @@ module Elmas
|
|
7
9
|
end
|
8
10
|
|
9
11
|
def mandatory_attributes
|
10
|
-
[
|
12
|
+
%i[journal purchase_entry_lines supplier]
|
11
13
|
end
|
12
14
|
|
13
15
|
def other_attributes
|
14
|
-
[
|
15
|
-
|
16
|
-
:entry_number, :external_link_reference, :invoice_number, :rate, :reporting_period,
|
17
|
-
:reporting_year, :reversal, :VAT_amount_FC, :your_ref
|
18
|
-
]
|
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]
|
19
18
|
end
|
20
19
|
end
|
21
20
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Elmas
|
2
4
|
# We can use the AgingReceivablesList to change the status of SalesInvoices from
|
3
5
|
# Open to 'Verwerkt' while at the same time sending a PDF of the invoice to the
|
@@ -22,11 +24,8 @@ module Elmas
|
|
22
24
|
|
23
25
|
# https://start.exactonline.nl/docs/HlpRestAPIResourcesDetails.aspx?name=ReadFinancialReceivablesList
|
24
26
|
def other_attributes
|
25
|
-
[
|
26
|
-
|
27
|
-
:currency_code, :description, :due_date, :entry_number, :id, :invoice_date, :invoice_number,
|
28
|
-
:journal_code, :journal_description, :your_ref
|
29
|
-
]
|
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]
|
30
29
|
end
|
31
30
|
end
|
32
31
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Elmas
|
2
4
|
class SalesEntry
|
3
5
|
# A sales entry needs multiple sales entry lines
|
@@ -9,16 +11,12 @@ module Elmas
|
|
9
11
|
end
|
10
12
|
|
11
13
|
def mandatory_attributes
|
12
|
-
[
|
14
|
+
%i[journal customer sales_entry_lines]
|
13
15
|
end
|
14
16
|
|
15
17
|
def other_attributes
|
16
|
-
[
|
17
|
-
|
18
|
-
:entry_number, :invoice_number, :order_number, :payment_condition,
|
19
|
-
:payment_reference, :process_number, :rate, :reporting_period,
|
20
|
-
:reporting_year, :reversal, :VAT_amount_FC, :your_ref, :description
|
21
|
-
]
|
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]
|
22
20
|
end
|
23
21
|
end
|
24
22
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Elmas
|
2
4
|
class SalesInvoice
|
3
5
|
# An sales_invoice usually has multiple sales_invoice lines
|
@@ -10,15 +12,12 @@ module Elmas
|
|
10
12
|
end
|
11
13
|
|
12
14
|
def mandatory_attributes
|
13
|
-
[:
|
15
|
+
[:ordered_by]
|
14
16
|
end
|
15
17
|
|
16
18
|
def other_attributes
|
17
19
|
SHARED_SALES_ATTRIBUTES.inject(
|
18
|
-
[
|
19
|
-
:sales_invoice_lines, :due_date, :sales_person,
|
20
|
-
:starter_sales_invoice_status, :type
|
21
|
-
],
|
20
|
+
%i[sales_invoice_lines due_date sales_person starter_sales_invoice_status type],
|
22
21
|
:<<
|
23
22
|
)
|
24
23
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Elmas
|
2
4
|
class SalesInvoiceLine
|
3
5
|
# An sales_invoice_line should always have a reference to an item and to an sales_invoice.
|
@@ -9,15 +11,12 @@ module Elmas
|
|
9
11
|
end
|
10
12
|
|
11
13
|
def mandatory_attributes
|
12
|
-
[
|
14
|
+
%i[item invoice_ID]
|
13
15
|
end
|
14
16
|
|
15
17
|
def other_attributes
|
16
18
|
SHARED_LINE_ATTRIBUTES.inject(
|
17
|
-
[
|
18
|
-
:employee, :end_time, :line_number, :start_time, :subscription,
|
19
|
-
:VAT_amount_DC, :VAT_amount_FC, :GL_account, :discount, :unit_price
|
20
|
-
],
|
19
|
+
%i[employee end_time line_number start_time subscription VAT_amount_DC VAT_amount_FC GL_account discount unit_price],
|
21
20
|
:<<
|
22
21
|
)
|
23
22
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Elmas
|
2
4
|
class SalesItemPrices
|
3
5
|
include Elmas::Resource
|
@@ -9,11 +11,8 @@ module Elmas
|
|
9
11
|
def mandatory_attributes; end
|
10
12
|
|
11
13
|
def other_attributes
|
12
|
-
[
|
13
|
-
|
14
|
-
:division, :end_date, :item, :item_code, :item_description, :modified, :modifier, :modifier_full_name, :number_of_items_per_unit,
|
15
|
-
:price, :quantity, :start_date, :unit, :unit_description
|
16
|
-
]
|
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]
|
17
16
|
end
|
18
17
|
end
|
19
18
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Elmas
|
2
4
|
class SalesOrder
|
3
5
|
include Elmas::Resource
|
@@ -8,15 +10,12 @@ module Elmas
|
|
8
10
|
end
|
9
11
|
|
10
12
|
def mandatory_attributes
|
11
|
-
[
|
13
|
+
%i[sales_order_lines ordered_by]
|
12
14
|
end
|
13
15
|
|
14
16
|
def other_attributes
|
15
17
|
SHARED_SALES_ATTRIBUTES.inject(
|
16
|
-
[
|
17
|
-
:deliver_to_contact_person, :delivery_date, :delivery_status,
|
18
|
-
:sales_person, :shipping_method, :status, :tax_schedule, :warehouse_ID
|
19
|
-
],
|
18
|
+
%i[deliver_to_contact_person delivery_date delivery_status sales_person shipping_method status tax_schedule warehouse_ID],
|
20
19
|
:<<
|
21
20
|
)
|
22
21
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Elmas
|
2
4
|
class SalesOrderLine
|
3
5
|
include Elmas::Resource
|
@@ -8,15 +10,12 @@ module Elmas
|
|
8
10
|
end
|
9
11
|
|
10
12
|
def mandatory_attributes
|
11
|
-
[
|
13
|
+
%i[item order_ID]
|
12
14
|
end
|
13
15
|
|
14
16
|
def other_attributes
|
15
17
|
SHARED_LINE_ATTRIBUTES.inject(
|
16
|
-
[
|
17
|
-
:amount_FC, :delivery_date, :item_version, :order_number, :unit_price,
|
18
|
-
:use_drop_shipment, :VAT_amount
|
19
|
-
],
|
18
|
+
%i[amount_FC delivery_date item_version order_number unit_price use_drop_shipment VAT_amount],
|
20
19
|
:<<
|
21
20
|
)
|
22
21
|
end
|